plateform
stringclasses
1 value
repo_name
stringlengths
13
113
name
stringlengths
3
74
ext
stringclasses
1 value
path
stringlengths
12
229
size
int64
23
843k
source_encoding
stringclasses
9 values
md5
stringlengths
32
32
text
stringlengths
23
843k
github
ssketch/motorControl-master
filter_duality.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/robust/filter_duality.m
8,603
utf_8
91b1d25b80045a73fe70a694f9784e1a
function [F,feasible] = filter_duality(F_xw,Zmodel,x,w,ops) % Creates robustified version of the uncertain set of linear inequalities % s.t A(w)*x <= b(w) for all F(w) >= 0 where F(w) is a conic set, here % given in YALMIP numerical format. % % Based on Robust Optimization - Methodology and Applications. A. Ben-Tal % ...
github
ssketch/motorControl-master
filter_enumeration.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/robust/filter_enumeration.m
7,383
utf_8
fd994fa46ec75e11eb5b4480d7d81510
function [F,mptmissing] = filter_enumeration(F_xw,Zmodel,x,w,ops,uncertaintyTypes,separatedZmodel,VariableType) mptmissing = 0; if length(F_xw) == 0 F = []; return; else if any(Zmodel.K.q) | any(Zmodel.K.s) error('Only polytope uncertainty supported in duality based robustification'); else...
github
ssketch/motorControl-master
decomposeUncertain.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/robust/decomposeUncertain.m
25,652
utf_8
fc9895076f3c5a34e5ebae8bdd5ba81b
function [UncertainModel,Uncertainty,VariableType,ops,failure] = decomposeUncertain(F,h,w,ops) failure = 0; % Do we have any uncertainty declarations variables? [F,w] = extractUncertain(F,w); if isempty(w) error('There is no uncertainty in the model.'); end % Partition the model into % F_x : Constraints in de...
github
ssketch/motorControl-master
convexhullConcave2D.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/convexhullConcave2D.m
1,288
utf_8
d02c5e581867d684ec4c32eefa59cc88
function [Ax,Ay,b,K] = convexhullConcave(x1,f1,df1,x2,f2,df2,x3,f3,df3,x4,f4,df4,x5,f5,df5) % x1-x4 corner points, 5 point in center % Lower bounds from tangents % z < f(x1) + (x-x1)*df(x1) % z < f(x2) + (x-x2)*df(x2) % z < f(x3) + (x-x3)*df(x3) % z < f(x4) + (x-x4)*df(x4) % z < f(x5) + (x-x5)*df(x5) % Possible upper...
github
ssketch/motorControl-master
root_node_tighten.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/root_node_tighten.m
4,115
utf_8
31025955e4d5e04ba8278308ce6235f5
% ************************************************************************* % Tighten bounds at root % ************************************************************************* function p = root_node_tighten(p,upper); p.feasible = all(p.lb<=p.ub) & p.feasible; if p.options.bmibnb.roottight & p.feasible pin = p; ...
github
ssketch/motorControl-master
update_sumsepquad_bounds.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/update_sumsepquad_bounds.m
2,079
utf_8
88e62143dd9ee6975b8f13423f79f346
function p = update_sumsepquad_bounds(p); % Looking for case z = b+ q1(x1) + q2(x2) + ... where q quadratic if p.boundpropagation.sepquad found = 0; for j = 1:p.K.f a = p.F_struc(j,2:end); b = p.F_struc(j,1); used = find(a); data = []; if nnz(a) > 2 && all(p.variabletype...
github
ssketch/motorControl-master
convexhullConvex2D.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/convexhullConvex2D.m
1,601
utf_8
87d494fc8c247891f8732fa1d9ff2251
function [Ax,Ay,b,K] = convexhullConvex2D(x1,f1,df1,x2,f2,df2,x3,f3,df3,x4,f4,df4,x5,f5,df5) % Lower bounds from tangents % z > f(x1) + (x-x1)*df(x1) % z > f(x2) + (x-x2)*df(x2) % z > f(x3) + (x-x3)*df(x3) % z > f(x4) + (x-x4)*df(x4) % z > f(x5) + (x-x5)*df(x5) % Possible upper bound from creatin hyperplane from thre...
github
ssketch/motorControl-master
updateonenonlinearbound.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/updateonenonlinearbound.m
805
utf_8
97d5341706cf3ef397ec3383332f38ee
% ************************************************************************* % Code for setting the numerical values of nonlinear terms % ************************************************************************* function p = updateonenonlinearbound(p,changed_var) if ~isempty(p.bilinears) impactedVariables = find((p....
github
ssketch/motorControl-master
dmpermblockeig.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/dmpermblockeig.m
3,417
utf_8
7b1470816ba1634bcc2b8457f9a98036
function [V,D,permutation,failure] = dmpermblockeig(X,switchtosparse) [permutation,aux1,aux2,blocks] = dmperm(X+speye(length(X))); Xpermuted = X(permutation,permutation); V = []; D = []; V = zeros(size(X,1),1); top = 1; left = 1; anycholfail = 0; failure = 0; for i = 1:length(blocks)-1 Xi = Xpermuted(blocks(...
github
ssketch/motorControl-master
evaluate_nonlinear.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/evaluate_nonlinear.m
1,184
utf_8
6cee29d0c8963567fd541ab3ee434dcf
function x = evaluate_nonlinear(p,x,qq) % FIX: We have to apply computations to make sure we are evaluating % expressions such as log(1+sin(x.^2).^2) correctly if ~isempty(p.bilinears) & all(p.variabletype <= 2) & length(p.evalMap)==0 x(p.bilinears(:,1)) = x(p.bilinears(:,2)).*x(p.bilinears(:,3)); else oldx =...
github
ssketch/motorControl-master
cutsdp.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/cutsdp.m
26,156
utf_8
b0da964912e005a872def387efd1ee2c
function output = cutsdp(p) % CUTSDP % % See also OPTIMIZE, BNB, BINVAR, INTVAR, BINARY, INTEGER % ************************************************************************* %% INITIALIZE DIAGNOSTICS IN YALMIP % ************************************************************************* bnbsolvertime = clock; showprogres...
github
ssketch/motorControl-master
bnb_solvelower.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/bnb_solvelower.m
6,288
utf_8
818775f03856e7052151184b74a3e5d2
function output = bnb_solvelower(lowersolver,relaxed_p,upper,lower) if all(relaxed_p.lb==relaxed_p.ub) x = relaxed_p.lb; if checkfeasiblefast(relaxed_p,relaxed_p.lb,relaxed_p.options.bnb.feastol) output.problem = 0; else output.problem = 1; end output.Primal = x; return end p ...
github
ssketch/motorControl-master
addEvalVariableCuts.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/addEvalVariableCuts.m
3,589
utf_8
e372e483ffe3ff808d8afc384a9aed2e
function pcut = addEvalVariableCuts(p) pcut = p; if ~isempty(p.evalMap) pcut = emptyNumericalModel; for i = 1:length(p.evalMap) y = p.evalVariables(i); x = p.evalMap{i}.variableIndex; xL = p.lb(x); xU = p.ub(x); % Generate a convex hull polytope if xL<x...
github
ssketch/motorControl-master
branch_and_bound.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/branch_and_bound.m
27,840
utf_8
9c05da945a8e634cb1ddb18dac80bbc0
function [x_min,solved_nodes,lower,upper,lower_hist,upper_hist,timing,counter] = branch_and_bound(p,x_min,upper,timing) % ************************************************************************* % Create handles to solvers % ************************************************************************* lowersolver = p.sol...
github
ssketch/motorControl-master
propagate_bounds_from_equalities.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/propagate_bounds_from_equalities.m
10,599
utf_8
0b92e3f86afb808b84cd37e29ff8c766
function p = propagate_bounds_from_equalities(p) LU = [p.lb p.ub]; p_F_struc = p.F_struc; n_p_F_struc_cols = size(p_F_struc,2); fixedVars = find(p.lb == p.ub & p.variabletype(:) == 0); if ~isempty(fixedVars) p_F_struc_forbilin = p_F_struc; p_F_struc_forbilin(:,1) = p_F_struc(:,1) + p_F_struc(:,1+fixedVars)*p...
github
ssketch/motorControl-master
bnb.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/bnb.m
44,352
utf_8
f914518e67ae6b93a8cf36f9b0fabdf0
function output = bnb(p) %BNB General branch-and-bound scheme for conic programs % % BNB applies a branch-and-bound scheme to solve mixed integer % conic programs (LP, QP, SOCP, SDP) and mixed integer geometric programs. % % BNB is never called by the user directly, but is called by % YALMIP from SOLVESDP, by ...
github
ssketch/motorControl-master
update_monomial_bounds.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/update_monomial_bounds.m
2,544
utf_8
d5ad776f01d587f1e7c5b70478d633e6
function model = update_monomial_bounds(model,these) if nargin == 1 & all(model.variabletype<=2) & any(model.variabletype) % Fast code for purely quadratic case x = model.bilinears(:,2); y = model.bilinears(:,3); z = model.bilinears(:,1); corners = [model.lb(x).*model.lb(y) model.ub(x).*model.lb(y)...
github
ssketch/motorControl-master
updatebounds_recursive_evaluation.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/updatebounds_recursive_evaluation.m
1,128
utf_8
ea7474325c03f63f6c8e286a9ab08de8
function p = updatebounds_recursive_evaluation(p) if p.changedbounds if isempty(p.evalMap) & all(p.variabletype <= 2) % Bilinear/quadratic case can be done much faster p = updatemonomialbounds(p); else for i = 1:length(p.evaluation_scheme) switch p.evaluation_scheme{i}.group...
github
ssketch/motorControl-master
rounder.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/rounder.m
5,889
utf_8
88ad60f43086ef44b94f4f9d1011a82a
function [upper,x_min] = rounder(p,relaxedsolution,prelaxed) % Extremely simple heuristic for finding integer % solutions. % % Rounds up and down, fixes etc. % This was the relaxed solution x = relaxedsolution.Primal; % Assume we fail upper = inf; x_min = x; % These should be integer intvars = [p.integer_variables(...
github
ssketch/motorControl-master
initializesolution.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/global/initializesolution.m
2,998
utf_8
792f46b6b802380d0b130505eeda93a4
function [p,x_min,upper] = initializesolution(p); x_min = zeros(length(p.c),1); upper = inf; if p.options.usex0 x = p.x0; z = evaluate_nonlinear(p,x); residual = constraint_residuals(p,z); relaxed_feasible = all(residual(1:p.K.f)>=-p.options.bmibnb.eqtol) & all(residual(1+p.K.f:end)>=p.options.bmibnb.p...
github
ssketch/motorControl-master
mpt_solvenode.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/parametric/mpt_solvenode.m
4,757
utf_8
5ba2e2ea43c2ecbf8cfb0336f50e41a9
function model = mpt_solvenode(Matrices,lower,upper,OriginalModel,model,options) % This is the core code. Lot of pre-processing to get rid of strange stuff % arising from odd problems, big-M etc etc Matrices.lb = lower; Matrices.ub = upper; % Remove equality constraints and trivial stuff from big-M [equalities,redund...
github
ssketch/motorControl-master
mpt_parbb.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/parametric/mpt_parbb.m
5,172
utf_8
9ed244f3afde3125092cc9cd08a5feb0
function model = mpt_parbb(Matrices,options) % For simple development, the code is currently implemented in high-level % YALMIP and MPT code. Hence, a substantial part of the computation time is % stupid over-head. [Matrices.lb,Matrices.ub] = mpt_detect_and_improve_bounds(Matrices,Matrices.lb,Matrices.ub,Matrices.bin...
github
ssketch/motorControl-master
mpt_appendmodel.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/modules/parametric/mpt_appendmodel.m
9,545
utf_8
1d7ce75903476d3b64c70bdd45442498
function model = savemptmodel(model,Pfinal,Pn,Fi,Gi,details); if length(Fi)>0 if length(model) == 0 model{1} = fakemptmodel(Pfinal, Pn, Fi, Gi, details.Ai, details.Bi, details.Ci); [H,K] = double(Pfinal); model{1}.epicost = []; model{1}.convex = 1; else anyqp = nnz([deta...
github
ssketch/motorControl-master
dualize.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/dualize.m
24,839
utf_8
95f053810de0314bbbbff10c9d8c9125
function [Fdual,objdual,X,t,err,complexInfo] = dualize(F,obj,auto,extlp,extend,options) % DUALIZE Create the dual of an SDP given in primal form % % [Fd,objd,X,t,err] = dualize(F,obj,auto) % % Input % F : Primal constraint in form AX=b+dt, X>0, t free. % obj : Primal cost CX+ct % auto : If set to 0, YALMIP will ...
github
ssketch/motorControl-master
polyprint.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/polyprint.m
2,602
utf_8
98455d0a41ce36cf7c72c346fa924f64
function symb_pvec = polyprint(pvec) %POLYPRINT Pretty print polynomial expression % % POLYPRINT is obsolete. Use SDISPLAY instead. for pi = 1:size(pvec,1) for pj = 1:size(pvec,2) p = pvec(pi,pj); if isa(p,'double') symb_p = num2str(p); else LinearVariables ...
github
ssketch/motorControl-master
sdd.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/sdd.m
478
utf_8
1e88bdde340f1e917f70ca6ea28f36f3
function Constraint = sdd(X) if issymmetric(X) Constraint = []; n = size(X,1); M = 0; for ii = 1:n for jj = [1:1:ii-1 ii+1:1:n] Mij = sdpvar(2); Constraint = Constraint + sdp2socp(Mij); M = M + sparse([ii jj ii jj],[ii ii jj jj],Mij(:),n,n); end end...
github
ssketch/motorControl-master
variable_replace.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/variable_replace.m
2,976
utf_8
24789bb29ef27f6c6f2e20d6ea39217f
function Z = variable_replace(X,Y,W) % Check so that Y is a simple unit variable Ybase = getbase(Y); Yvariables = getvariablesSORTED(Y); Xbase = getbase(X); Xvariables = getvariables(X); [i,j,k] = find(Ybase); if ~isequal(sort(i),1:length(i)) end if ~isequal(sort(j),2:(length(i)+1)) end if ~all(k == 1) end [mt,variab...
github
ssketch/motorControl-master
separable.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/separable.m
1,525
utf_8
10bbf0c3ce778c85f88b4dde2c05da0b
function exponent_m = separable(exponent_m,exponent_p,options); %SEPARABLE Internal function, not used % %exponent_m(sum((exponent_m>0),2)>2,:)=[]; % % card = max(sum((exponent_p>0),2)); % % n_less = exponent_m(sum((exponent_m>0),2)<card,:); % n_equ = exponent_m(sum((exponent_m>0),2)==card,:); % n_larg = exponent_...
github
ssketch/motorControl-master
convert_polynomial_to_sdpfun.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/convert_polynomial_to_sdpfun.m
5,293
utf_8
1282b1c3b7f96c19912ea8bbbc911873
function [model,changed] = convert_polynomial_to_sdpfun(model) % Assume we don't do anything changed = 0; found_and_converted = []; if any(model.variabletype > 2) % Bugger... changed = 1; % Find a higher order term sigmonials = find(model.variabletype == 3); model = update_monomial_bounds(model)...
github
ssketch/motorControl-master
apply_recursive_evaluation.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/apply_recursive_evaluation.m
4,180
utf_8
82ec59b307f369541a2702e44e03bb2b
function xevaled = apply_recursive_evaluation(p,xevaled) xevaled = xevaled(:)'; for i = 1:length(p.evaluation_scheme) switch p.evaluation_scheme{i}.group case 'eval' xevaled = process_evals(p,xevaled,p.evaluation_scheme{i}.variables); case 'monom' xevaled = process_monomials...
github
ssketch/motorControl-master
sdpt3struct2sdpt3block.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/sdpt3struct2sdpt3block.m
1,867
utf_8
dc8d29d2e8699f12a49253ce3dc1c69d
function [C,A,b,blk] = sdpt3struct2sdpt3block(F_struc,c,K) %SDPT3STRUCT2SDPT3BLOCK Internal function to convert data to SDPT3 format nvars = size(F_struc,2)-1; block = 1; top = 1; block = 1; blksz = 100; if K.l>0 blk{block,1} = 'l'; blk{block,2} = K.l; C{block,1} = sparse(F_struc(top:top+K.l-1,1)); for var_index...
github
ssketch/motorControl-master
coefficients.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/coefficients.m
6,992
utf_8
071772bad3d379ac9c6bdfa2a59483c8
function [base,v] = coefficients(p,x,vin) %COEFFICIENTS Extract coefficients and monomials from polynomials % % [c,v] = COEFFICIENTS(p,x) extracts the coefficents % of a scalar polynomial p(x) = c'*v(x) % % c = COEFFICIENTS(p,x) extracts the all coefficents % of a matrix polynomial. % % INPUT % p : SDPVAR...
github
ssketch/motorControl-master
shadowjacobian.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/shadowjacobian.m
2,364
utf_8
f46a1b7f9bb3d8e236fea4f759ca7036
function dfdx = shadowjacobian(f,x) % See SDPVAR/jacobian if isa(f,'double') dfdx = zeros(size(f,1),length(x)); return end if ~isempty(intersect(deepdepends(f),depends(x))) % Under development end if nargin==1 if isa(f,'sdpvar') x = recover(depends(f)); else x = 0; end ...
github
ssketch/motorControl-master
convert_sigmonial_to_sdpfun.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/convert_sigmonial_to_sdpfun.m
9,554
utf_8
0fc74a0f354cc96d27758fef13e848ac
function [model,changed] = convert_sigmonial_to_sdpfun(model) % Always add this dummy struct model.high_monom_model = []; % Assume we don't do anything changed = 0; found_and_converted = []; if any(model.variabletype > 3) % Bugger... changed = 1; % Find a higher order term sigmonials = find(model.va...
github
ssketch/motorControl-master
expandmodel.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/expandmodel.m
14,898
utf_8
d969c77d2766c9985e6935c762569593
function [F,failure,cause,ALREADY_MODELLED] = expandmodel(F,h,options,w) % FIX : Current code experimental, complex, conservative, has issues with % nonlinearities and is slow... % % If it wasn't for polynomials and sigmonials, it would be trivial, but the % code is extremely messy since we want to have this functiona...
github
ssketch/motorControl-master
loadsedumidata.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/loadsedumidata.m
2,549
utf_8
bd6523935b1fd7c5c70b5bf8db27e0a7
function [F,h] = loadsedumidata(varargin) %LOADSEDUMIDATA Loads a problem definition in the SeDuMi format % % [F,h] = loadsedumidata('filename') Loads the problem min(h(x)), F(x)>0 from file 'filename' % [F,h] = loadsedumidata An "Open" - box will be opened filename = varargin{1}; % Does the file ...
github
ssketch/motorControl-master
convert_polynomial_to_quadratic.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/convert_polynomial_to_quadratic.m
6,093
utf_8
e42036044ee1903d0c693160c460a838
function [model,changed] = convert_polynomial_to_quadratic(model) % Assume we don't do anything changed = 0; % Are there really any non-quadratic terms? already_done = 0; while any(model.variabletype > 2) % Bugger... changed = 1; % Find a higher order term polynomials = find(model.variabletype >= 3);...
github
ssketch/motorControl-master
convert_perspective_log.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/convert_perspective_log.m
5,164
utf_8
8e4d2ae723ef8d67f6f5029200ce2985
function p = convert_perspective_log(p) p.kept = 1:length(p.c); if isempty(p.evalMap) return end if ~any(p.variabletype == 4) return end variableIndex = []; for i=1:length(p.evalMap) variableIndex = [variableIndex p.evalMap{i}.variableIndex]; end removable = []; for i = 1:length(p.evalMap) if strcmp...
github
ssketch/motorControl-master
yalmiptable.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/yalmiptable.m
1,761
utf_8
9d3d69d9a7db32cbea823623e730f309
function yalmiptable(superheader,header,data,formats) %TABLE Internal function to display tables [nheadersy,nheadersx] = size(header); [ndatay,ndatax] = size(data); datasizes = zeros(ndatay,ndatax); for i = 1:ndatay for j = 1:ndatax if isa(data{i,j},'double') data{i,j} = num2str(data{i,j}); ...
github
ssketch/motorControl-master
sdisplay2.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/sdisplay2.m
7,460
utf_8
1580149b36a2d9dad048527aa6633013
function symb_pvec = sdisplay2(p,names) % TODO: sdpvar a b % x = (a+b)^0.3 -- writes "mpower_internal" % % TODO: sdpvar h x k % sdisplay2(h*x - k) -- misses the minus in front of "k" if nargin < 2 LinearVariables = 1:yalmip('nvars'); x = recover(LinearVariables); names = cell(length(x...
github
ssketch/motorControl-master
dissect.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/dissect.m
2,898
utf_8
287c87ea98e36a7d4b0f42fb58700649
function varargout = dissect(X); % DISSECT Dissect SDP constraint % % G = unblkdiag(F) Converts SDP to several smaller SDPs with more variables % % See also UNBLKDIAG if isa(X,'constraint') X = lmi(X); end switch class(X) case 'sdpvar' % Get sparsity pattern Z=spy(X); % Partition as ...
github
ssketch/motorControl-master
fmincon_con.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/fmincon_con.m
3,980
utf_8
bb638cd9a153556cf293b5b1615934b5
function [g,geq,dg,dgeq,xevaled] = fmincon_con(x,model,xevaled) global latest_xevaled global latest_x_xevaled % Early bail for linear problems g = []; geq = []; dg = []; dgeq = []; if model.linearconstraints xevaled = []; return end if nargin<3 if isequal(x,latest_x_xevaled) xevaled = latest_xeval...
github
ssketch/motorControl-master
sedumi2sdpt3.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/sedumi2sdpt3.m
4,093
utf_8
8f142cc073201468ac59c3aab8d61e4b
%SEDUMI2SDPT3 Internal function, obsolete %%******************************************************************* %% Converts from SeDuMi format. %% %% [blk,A,C,b] = sedumi2sdpt3(c,A,b,K) %% %% Input: fname.mat = name of the file containing SDP data in %% SeDuMi format. %% %% Important note: Sedum...
github
ssketch/motorControl-master
compress_evaluation_scheme.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/compress_evaluation_scheme.m
2,228
utf_8
ccf30e513f35e6ac7a6dc02416d6fae8
function model = compress_evaluation_scheme(model); scalars = {'erf','exp','log','sin','cos','log2','log10','slog','power_internal2','inverse_internal2','sqrtm_internal'}; for i = 1:length(model.evaluation_scheme) if strcmp(model.evaluation_scheme{i}.group,'eval') clear fun for k = 1:length(scalars)...
github
ssketch/motorControl-master
sdpvar2str.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/sdpvar2str.m
2,503
utf_8
dcd7bff7503ead1c19e49a6497f6e84b
function symb_pvec = sdpvar2str(pvec) %SDPVAR2STR Converts an SDPVAR object to MATLAB string representation % % S = SDPVAR2STR(P) % % S : String % P : SDPVAR object for pi = 1:size(pvec,1) for pj = 1:size(pvec,2) p = pvec(pi,pj); if isa(p,'double') symb_p = num2str(p); ...
github
ssketch/motorControl-master
compileinterfacedata.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/compileinterfacedata.m
50,288
utf_8
afc44e995cea6d95fd64cf8a158b0c41
function [interfacedata,recoverdata,solver,diagnostic,F,Fremoved,ForiginalQuadratics] = compileinterfacedata(F,aux_obsolete,logdetStruct,h,options,findallsolvers,parametric) persistent CACHED_SOLVERS persistent allsolvers persistent EXISTTIME persistent NCHECKS %% Initilize default empty outputs diagnostic = []; inte...
github
ssketch/motorControl-master
selectsolver.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/selectsolver.m
23,046
utf_8
1cf76f327e2fcc2f98d45d6024ced027
function [solver,problem,forced_choice] = selectsolver(options,ProblemClass,solvers,socp_are_really_qc,allsolvers); %SELECTSOLVER Internal function to select solver based on problem category problem = 0; % UNDOCUMENTED force_solver = yalmip('solver'); if length(force_solver)>0 options.solver = force_solver; end ...
github
ssketch/motorControl-master
build_recursive_scheme.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/build_recursive_scheme.m
4,788
utf_8
cc087abecc5e343a16c095e07dc5b733
function model = build_recursive_scheme(model); model.evaluation_scheme = []; model.deppattern = model.monomtable | model.monomtable; % Figure out arguments in all polynomials & sigmonials. This info is % used on several places, so we might just as well save it model.monomials = find(model.variabletype); model.monomi...
github
ssketch/motorControl-master
dual2cell.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/dual2cell.m
546
utf_8
18deb951cf9dacb4b2e3d2faf4166ccd
function X = dual2cell(dual_vec,K) %DUAL2CELL Internal function for organizing dual data row = 1; X.f = dual_vec(row:row+K.f-1); row = row + K.f; X.l = dual_vec(row:row+K.l-1); row = row + K.l; for k = 1:length(K.q) X.q{k} = dual_vec(row:row+K.q(k)-1); row = row + K.q(k); end for k = 1:length(K.r) X.r...
github
ssketch/motorControl-master
amplexpr.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/amplexpr.m
2,162
utf_8
0a47dd2e95c44a17fd78af99ed8950d6
function symb_pvec = amplexpr(pvec) %AMPLEXPR Converts SDPVAR variable to AMPL string for pi = 1:size(pvec,1) for pj = 1:size(pvec,2) p = pvec(pi,pj); if isa(p,'double') symb_p = num2str(p); else LinearVariables = depends(p); x = recover(LinearVariables)...
github
ssketch/motorControl-master
saveampl.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/saveampl.m
7,486
utf_8
0b44bf1f619d5b35fc97f2c1e9b865f5
function solution = saveampl(varargin) %SAVEAMPL Saves a problem definition in AMPL format % % SAVEAMPL(F,h,'filename') Saves the problem min(h(x)), F(x)>0 to the file filename % SAVEAMPL(F,h) A "Save As"- box will be opened % % YALMIP is currently able to save problems with linear and non-linear...
github
ssketch/motorControl-master
plotInternalModel.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/plotInternalModel.m
6,539
utf_8
dd4ba77a4a15fc73821420df4884d25f
function x_opt = PlotInternalModel(internalmodel,x,n,localindex,color,opts) % Code used by both lmi/plot and optimizer/plot if isempty(internalmodel.binary_variables) [x_opt{1},errorstatus] = generateBoundary(internalmodel,x,n,localindex); else if strcmp(internalmodel.solver.tag,'BNB') internalmodel.so...
github
ssketch/motorControl-master
monolist.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/monolist.m
7,193
utf_8
dfe7495e41d589eb47d0d0df0acc3890
function new_x = monolist(x,dmax,dmin) % MONOLIST Generate monomials % % y = MONOLIST(x,dmax,dmin) % % Returns the monomials [1 x(1) x(1)^2 ... x(1)^dmax(1) x(2) x(1)x(2) etc...] % % >>sdpvar x y z % >>sdisplay(monolist([x y z],4)) % % Input % x : Vector with SDPVAR variables % dmax : Integers > 0 % % ...
github
ssketch/motorControl-master
eliminatevariables.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/eliminatevariables.m
12,054
utf_8
b55cf541bd9397c940a02e4ee9694e0c
function [model,keptvariablesIndex] = eliminatevariables(model,removedparameters,value,parameters) if isempty(removedparameters) keptvariablesIndex = 1:length(model.c); return end keptvariablesIndex = 1:length(model.c); rmvmonoms = model.rmvmonoms; newmonomtable = model.newmonomtable; % Assign evaluati...
github
ssketch/motorControl-master
savecplexlp.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/savecplexlp.m
3,862
utf_8
d62ee5da3ba7f3c01ad267cdafef9bf6
function filename = savecplexlp(varargin) %SAVCPLEXLP Saves a problem definition in CPLEX-LP format % % SAVCPLEXLP(F,h,'filename') Saves the problem min(h(x)), F(x)>0 to the file filename % SAVCPLEXLP(F,h) A "Save As"- box will be opened % F = varargin{1}; h = varargin{2}; [aux1,aux2,aux3,model...
github
ssketch/motorControl-master
solvesdp_multiple.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/solvesdp_multiple.m
5,574
utf_8
c5412bd27722e2bcb8fe758c99a95fb7
function diagnostic = solvesdp_multiple(varargin); yalmiptime = clock; h = varargin{2}; varargin{2} = sum(recover(depends(h))); if ~is(h,'linear') error('Parts of your matrix objective is not linear (multiple solutions can currently only be obtained for linear objectives)'); end if is(h,'complex') error('Par...
github
ssketch/motorControl-master
computedimacs.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/computedimacs.m
2,052
utf_8
87d06eb1f6270fd74593f205c3343f1d
function dimacs = computedimacs(b,c,A,xin,y,s,K); % COMPUTEDIMACS % % min <C,X> s.t AX = b, X > 0 % max b'y s.t S-C+A'y =0, S > 0 % If no primal exist, fake till later if isempty(xin) x = c*0; else x = xin; end if isempty(s) s = c-A'*y; end xres = inf; sres = inf; % Not officially defined in DIMAC...
github
ssketch/motorControl-master
binmodel.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/binmodel.m
9,313
utf_8
0128e2f618a9bc78ea94707dd7fa1499
function varargout = binmodel(varargin) %BINMODEL Converts nonlinear mixed binary expression to linear model % % Applied to individual terms p defined on domain D % [plinear1,..,plinearN,Cuts] = BINMODEL(p1,...,pN,D) % % Alternative on complete set of constraint % F = BINMODEL(F) % % binmodel is used to convert nonl...
github
ssketch/motorControl-master
derivedualBoundsParameterFree.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/derivedualBoundsParameterFree.m
2,514
utf_8
56f518715fc81d312aae626a72ea92bb
function [dualUpper,L,U] = derivedualBoundsParameterFree(H,c,A,b,E,f,ops,parametricDomain) if isempty(A) dualUpper = []; L = []; U = []; return end n = length(c); m = length(b); me = length(f); x = sdpvar(n,1); Lambda = sdpvar(m,1); mu = sdpvar(me,1); % Homogenization alpha = sdpvar(1); F = []; % ...
github
ssketch/motorControl-master
derandomize.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/derandomize.m
3,645
utf_8
14a3a6bc4823e6b81182566b82f8e393
function Fderandomized = derandomize(F) chanceDeclarations = find(is(F,'chance')); randomDeclarations = find(is(F,'random')); if isempty(randomDeclarations) error('Cannot derandomize, cannot find declaration of random variables'); end keep = ones(length(F),1); keep(randomDeclarations)=0; keep(chanceDeclarations)=...
github
ssketch/motorControl-master
solvesdp.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/solvesdp.m
16,184
utf_8
db8e6b46b38fd31dd106574e02038c5a
function diagnostic = solvesdp(varargin) %SOLVESDP Obsolete command, please use OPTIMIZE yalmiptime = clock; % Let us see how much time we spend % ********************************* % CHECK INPUT % ********************************* nargin = length(varargin); % First check of objective for early transfer to multiple s...
github
ssketch/motorControl-master
sdisplay.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/sdisplay.m
10,497
utf_8
f90455026b9451c20d71013181d0348a
function symb_pvec = sdisplay(pvec,symbolicname) %SDISPLAY Symbolic display of SDPVAR expression % % Note that the symbolic display only work if all % involved variables are explicitely defined as % scalar variables. % % Variables that not are defined as scalars % will be given the name ryv(i). ryv means % recovered YA...
github
ssketch/motorControl-master
yalmip.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/yalmip.m
55,609
utf_8
b7c479f7ee714fe7b7c3108950253015
function varargout = yalmip(varargin) %YALMIP Returns various information about YALMIP % % YALMIP can be used to check version numbers and find the SDPVAR and SET % objects available in workspace % % EXAMPLES % V = YALMIP('version') % Returns version % YALMIP('nvars') % Returns total number ...
github
ssketch/motorControl-master
gams2yalmip.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/gams2yalmip.m
13,976
utf_8
4e1639693ca899bd14a7436ffb74839c
function varargout = gams2yalmip(fileName,filenameOut); % GAMS2YALMIP Converts GAMS model to YALMIP % % [F,h] = GAMS2YALMIP(gamsfile,yalmipfile) converts the GAMS model in % the file 'gamsfile' to a YALMIP mpodel % % Input % GAMSFILE : Char with filename for GAMS model % YALMIPFILE : Char with filenam...
github
ssketch/motorControl-master
sdpsettings.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/sdpsettings.m
32,067
utf_8
1b353c15d097ac0ef1f42cafcb8846d7
function options = sdpsettings(varargin) %SDPSETTINGS Create/alter solver options structure. % % OPTIONS = SDPSETTINGS with no input arguments returns % setting structure with default values % % OPTIONS = SDPSETTINGS('NAME1',VALUE1,'NAME2',VALUE2,...) creates a % solution options structure OPTIONS in which the ...
github
ssketch/motorControl-master
findulb.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/findulb.m
1,661
utf_8
01608ade93f5720dd1ed28fbb581df02
function [lb,ub,cand_rows_eq,cand_rows_lp] = findulb(F_struc,K,lb,ub) %FINDULB Internal function to extract upper and lower variable bounds n = size(F_struc,2)-1; if nargin < 3 lb = -inf*ones(n,1); ub = inf*ones(n,1); end cand_rows_eq = []; cand_rows_lp = []; ub2 = ub; lb2 = lb; if (K.f ~=0) A = -F_struc(1...
github
ssketch/motorControl-master
optimizer.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@optimizer/optimizer.m
11,249
utf_8
aca5aefd5cbc9356b5c08f149b0d8651
function sys = optimizer(Constraints,Objective,options,x,u) %OPTIMIZER Container for optimization problem % % OPT = OPTIMIZER(Constraints,Objective,options,x,u) exports an object that % contains precompiled numerical data to be solved for varying arguments % x, returning the optimal value of the expression u. % ...
github
ssketch/motorControl-master
horzcat.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@optimizer/horzcat.m
4,742
utf_8
87422557b7a3a098093c81452da4d179
function P = horzcat(varargin) if isempty(varargin{1}) && isa(varargin{2},'optimizer') P = varargin{2}; return end % Are they similiar objects (same parameterization). % FIXME: Check will be strengthened for i = 1:nargin if isa(varargin{i},'optimizer') && isequal(varargin{i}.diminOrig,varargin{1}.diminOr...
github
ssketch/motorControl-master
or.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@constraint/or.m
2,713
utf_8
b9d25d1edf0b5f6d345264d39d3ffd90
function varargout = or(varargin) %OR (overloaded) % Prune empty clauses varargin = {varargin{find(~cellfun('isempty',varargin))}}; % Models OR using a nonlinear operator definition switch class(varargin{1}) case 'char' z = varargin{2}; X = varargin{3}; Y = varargin{4}; ...
github
ssketch/motorControl-master
groupchanceconstraints.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@lmi/groupchanceconstraints.m
710
utf_8
11836c904991112de5ae44d3a433fe11
function S = groupchanceconstraints(F) G = {}; S = {}; F = flatten(F); for i = 1:length(F.clauses) if ~isempty(F.clauses{i}.confidencelevel) G = addgroup(G,F.clauses{i}.jointprobabilistic); end end for i = 1:length(G) S{i} = []; end for i = 1:length(F.clauses) for j = 1:length(G) if ise...
github
ssketch/motorControl-master
display.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@lmi/display.m
4,251
utf_8
faa1a9761a6adc79bf84740db5d5d064
function sys = display(X) %display Displays a SET object. X = flatten(X); nlmi = length(X.LMIid); if (nlmi == 0) disp('empty SET') return end lmiinfo{1} = 'Matrix inequality'; lmiinfo{2} = 'Element-wise inequality'; lmiinfo{3} = 'Equality constraint'; lmiinfo{4} = 'Second order cone constraint'; lm...
github
ssketch/motorControl-master
check.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@lmi/check.m
7,708
utf_8
0d2bdf575bdb875d9478d5715aa2eca9
function [pres,dres] = check(F) % CHECK(F) Displays/calculates constraint residuals on constraint F % % [pres,dres] = check(F) % % pres : Primal constraint residuals % dres : Dual constraint residuals % % If no output argument is supplied, tabulated results are displayed % % Primal constraint residuals are calculated ...
github
ssketch/motorControl-master
kkt.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@lmi/kkt.m
7,682
utf_8
ea07f23f01d1dfab399aaaf73173effd
function [KKTConstraints, details] = kkt(F,h,parametricVariables,ops); %KKT Create KKT system % % [KKTConstraints, details] = kkt(Constraints,Objective,parameters,options) if ~isempty(F) if any(is(F,'sos2')) error('SOS2 structures not allowed in KKT'); end end [aux1,aux2,aux3,model] = export(F,h,sdpse...
github
ssketch/motorControl-master
getvariables.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@lmi/getvariables.m
905
utf_8
ef689619cd74e765cfe444b697d69eb0
function used = getvariables(F) F = flatten(F); if length(F.clauses) == 0 used = []; return end if isa(F.clauses{1},'cell') F = flatten(F); end used = recursivegetvariables(F,1,length(F.clauses)); function used = recursivegetvariables(F,startindex,endindex) if endindex-startindex>50 newstart = star...
github
ssketch/motorControl-master
depends.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@lmi/depends.m
826
utf_8
9d357105527d2957bed1f995761d9b8f
function LinearVariables = depends(F) F = flatten(F); % Get all used variables in this LMI object used = recursivedepends(F.clauses); % Now, determine the involved linear variables [mt,variabletype] = yalmip('monomtable'); if any(variabletype)%1%~isempty(nlv) & any(ismembc(used,nlv(1,:))) LinearVariables = find(...
github
ssketch/motorControl-master
polytope.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@lmi/polytope.m
2,367
utf_8
936949134726945ac12d1cf313b998c3
function [P,x] = polytope(X,options) % polytope Converts constraints to polytope object % % P = polytope(F) % [P,x] = polytope(F) % % P : polytope object (Requires the Multi-parametric Toolbox) % x : sdpvar object defining the variables in the polytope P.H*x<=P.K % F : Constraint object with linear inequal...
github
ssketch/motorControl-master
pwamodel.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@lmi/pwamodel.m
1,084
utf_8
b0d6a88e6f4c02018d6c85b072b057de
function [A,b] = pwamodel(F,x) [dummy,aux,s,model] = export(F,[]); A = -model.F_struc(:,2:end); b = model.F_struc(:,1); keep_these = find(ismember(aux.used_variables,getvariables(x))); A = [A(:,keep_these) A(:,setdiff(1:size(A,2),keep_these))]; [A,b] = fourier_motzkin(A,b,length(keep_these)); function [A,b] = four...
github
ssketch/motorControl-master
categorizeproblem.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@lmi/categorizeproblem.m
19,332
utf_8
cb847f4dd0e23678eb65446022b33f87
function [problem,integer_variables,binary_variables,parametric_variables,uncertain_variables,semicont_variables,quad_info] = categorizeproblem(F,P,h,relax,parametric,evaluation,F_vars,exponential_cone) %categorizeproblem Internal function: tries to determine the type of optimization problem F = flatten(F); C...
github
ssketch/motorControl-master
Polyhedron.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@lmi/Polyhedron.m
2,402
utf_8
30f5cf13a964070f9b800e10d49a372f
function [P,x] = polyhedron(X,options) % polyhedron Converts constraint to MPT polyhedron object % % P = polyhedron(F) % [P,x] = polyhedron(F) % % P : polyhedron object (Requires the Multi-parametric Toolbox) % x : sdpvar object defining the variables in the polyhedron % F : Constraint object with linear i...
github
ssketch/motorControl-master
lmi2sedumistruct.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@lmi/lmi2sedumistruct.m
20,660
utf_8
29d3ff75fe3b58db06487e773878882b
function [F_struc,K,KCut,schur_funs,schur_data,schur_variables] = lmi2sedumistruct(F) %lmi2sedumistruct Internal function: Converts LMI to format needed in SeDuMi nvars = yalmip('nvars'); %Needed lot'sa times... % We first browse to see what we have got and the % dimension of F_struc (massive speed improvement) F =...
github
ssketch/motorControl-master
plot.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@ncvar/plot.m
3,229
utf_8
dfbeaac5398f6b4128ffe8d0b28117f3
function Y=plot(varargin) %PLOT (overloaded) % Fast version for plotting simple PWA objects if nargin == 1 X = varargin{1}; if isa(varargin{1},'sdpvar') if length(X) == 1 if isequal(full(getbase(X)),[0 1]) extstruct = yalmip('extstruct',getvariables(X)); if ~...
github
ssketch/motorControl-master
subsasgn.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@ncvar/subsasgn.m
7,395
utf_8
0dc57809e264cdd2678ba09ef96ecf94
function y = subsasgn(X,I,Y) %SUBASGN (overloaded) try if strcmp('()',I.type) X_is_spdvar = isa(X,'sdpvar'); Y_is_spdvar = isa(Y,'sdpvar'); if any(I.subs{1} <=0) error('Index into matrix is negative or zero.'); end switch 2*X_is_spdvar+Y_is_spdvar cas...
github
ssketch/motorControl-master
sym.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@ncvar/sym.m
3,154
utf_8
07ae0f26ffe548a4af2b632bd01c0bdf
function symb_pvec = sdisplay(pvec,symbolicname) %SDISPLAY Symbolic display of SDPVAR expression % % Note that the symbolic display only work if all % involved variables are explicitely defined as % scalar variables. % % Variables that not are defined as scalars % will be given the name ryv(i). ryv means % recovered YA...
github
ssketch/motorControl-master
or.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@ncvar/or.m
2,236
utf_8
68a1641f6a288ec6b04d2e6630a99bd9
function varargout = or(varargin) %OR (overloaded) % % z = or(x,y) % z = x | y % % The OR operator is implemented using the concept of nonlinear operators % in YALMIP. X|Y defines a new so called derived variable that can be % treated as any other variable in YALMIP. When SOLVESDP is issued, % constraints are ...
github
ssketch/motorControl-master
repmat.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@ncvar/repmat.m
2,094
utf_8
695991712637a5274ff19d51a5fa40d2
function Y=repmat(varargin) %REPMAT (overloaded) try X = varargin{1}; Y = X; Y.basis = []; n = Y.dim(1); m = Y.dim(2); for i = 1:length(Y.lmi_variables)+1 temp = repmatfixed(reshape(X.basis(:,i),n,m),varargin{2:end}); Y.basis(:,i) = temp(:); end Y.dim(1) = size(temp,1); Y.dim(2) = size(temp,2...
github
ssketch/motorControl-master
subsref.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@ncvar/subsref.m
4,658
utf_8
844eb9433dfa4b2c8de950579397cde2
function varargout = subsref(varargin) %SUBSREF (overloaded) % Stupid first slice call (supported by MATLAB) if length(varargin{2}.subs) > 2 i = 3; ok = 1; while ok & (i <= length(varargin{2}.subs)) ok = ok & (isequal(varargin{2}.subs{i},1) | isequal(varargin{2}.subs{i},':')); i = i + 1; ...
github
ssketch/motorControl-master
pwa.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@ncvar/pwa.m
4,373
utf_8
22c949c81c11c00407c9edb6dab6066e
function [p,Bi,Ci,Pn,Pfinal] = PWA(h,Xdomain) % PWA Tries to create a PWA description % % [p,Bi,Ci,Pn,Pfinal] = PWA(h,X) % % Input % h : scalar SDPVAR object % X : Constraint object % % Output % % p : scalar SDPVAR object representing the PWA function % Bi,Ci,Pn,Pfinal : Data in MPT format % % The command tries ...
github
ssketch/motorControl-master
mtimes.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@ncvar/mtimes.m
5,659
utf_8
70cfba01103b6fc708e8b37cbf17df2e
function Z = mtimes(X,Y) %MTIMES (overloaded) % Brute-force implementation of multiplication of noncommuting variables % (with possible commuting variables involved) % Check classes X_is_spdvar = isa(X,'sdpvar'); Y_is_spdvar = isa(Y,'sdpvar'); X_is_ncvar = isa(X,'ncvar'); Y_is_ncvar = isa(Y,'ncvar'); % Get all the ...
github
ssketch/motorControl-master
and.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/extras/@ncvar/and.m
2,197
utf_8
e574e35b982582324eb3c78d9d965cab
function varargout = and(varargin) %AND (overloaded) % % z = and(x,y) % z = x & y % % The AND operator is implemented using the concept of nonlinear operators % in YALMIP. X|Y defines a new so called derived variable that can be % treated as any other variable in YALMIP. When SOLVESDP is issued, % constraints ...
github
ssketch/motorControl-master
addfactors.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/addfactors.m
2,579
utf_8
1a0e68ae8acfbe591015380fb18a28ad
function Z = addfactors(Z,X,Y) if isa(X,'double') || isa(X,'logical') if length(Y.midfactors)==0 return end % Y = refactor(Y); Z.midfactors = Y.midfactors; Z.leftfactors = Y.leftfactors; Z.rightfactors = Y.rightfactors; Z.midfactors{end+1} = X; if length(X)>1 Z.leftfact...
github
ssketch/motorControl-master
asec.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/asec.m
881
utf_8
210ec08cb20380016ffc9ab743ade4e9
function varargout = asec(varargin) %ASEC (overloaded) switch class(varargin{1}) case 'sdpvar' varargout{1} = InstantiateElementWise(mfilename,varargin{:}); case 'char' operator = struct('convexity','none','monotonicity','none','definiteness','none','model','callback'); operator.conv...
github
ssketch/motorControl-master
norm.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/norm.m
12,678
utf_8
833cfcffac8a86284f26c75e3bec8bc9
function varargout = norm(varargin) %NORM (overloaded) % % t = NORM(x,P) % % The variable t can only be used in convexity preserving % operations such as t<=1, max(t,y)<=1, minimize t etc. % % For matrices... % NORM(X) models the largest singular value of X, max(svd(X)). % NORM(X,2) is the same a...
github
ssketch/motorControl-master
pow10.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/pow10.m
979
utf_8
3c67d739166aa630ae6b9939611ab49c
function varargout = pow10(varargin) %POW10 (overloaded) switch class(varargin{1}) case 'double' error('Overloaded SDPVAR/POW10 CALLED WITH DOUBLE. Report error') case 'sdpvar' varargout{1} = InstantiateElementWise(mfilename,varargin{:}); case 'char' operator = struct('convexity...
github
ssketch/motorControl-master
tan.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/tan.m
841
utf_8
af58a56ca9dea8449e2c6fef9202be16
function varargout = tan (varargin) %TAN (overloaded) switch class(varargin{1}) case 'double' error('Overloaded SDPVAR/TAN CALLED WITH DOUBLE. Report error') case 'sdpvar' varargout{1} = InstantiateElementWise(mfilename,varargin{:}); case 'char' operator = struct('convexity','no...
github
ssketch/motorControl-master
asinh.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/asinh.m
677
utf_8
e3f8453d9133b82d52664494918be4c5
function varargout = asinh(varargin) %ASINH (overloaded) switch class(varargin{1}) case 'sdpvar' varargout{1} = InstantiateElementWise(mfilename,varargin{:}); case 'char' operator = struct('convexity','none','monotonicity','increasing','definiteness','none','model','callback'); opera...
github
ssketch/motorControl-master
plot.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/plot.m
4,864
utf_8
0e3843abf5f44e3a2a5e011a093f9bc3
function Y=plot(varargin) %PLOT (overloaded) % Fast version for plotting simple PWA objects if nargin == 1 X = varargin{1}; if isa(varargin{1},'sdpvar') if length(X) == 1 if isequal(full(getbase(X)),[zeros(length(X),1) eye(length(X))]) extstruct = yalmip('extstruct',getvaria...
github
ssketch/motorControl-master
ismember_internal.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/ismember_internal.m
3,293
utf_8
5c70c86d0d39f66f8b69c3e2f83b0508
function YESNO = ismember_internal(x,p) %ISMEMBER_INTERNAL Helper for ISMEMBER if isa(x,'sdpvar') & (isa(p,'polytope') | isa(p,'Polyhedron')) if length(p) == 1 [H,K,Ae,be] = poly2data(p); if min(size(x))>1 error('first argument should be a vector'); end if length(x) == ...
github
ssketch/motorControl-master
sqrtm_internal.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/sqrtm_internal.m
1,323
utf_8
b33f0b07880e3a33d7952c5da2aaf17b
function varargout = sqrtm_internal(varargin) %SQRTM (overloaded) switch class(varargin{1}) case 'double' varargout{1} = sqrt(varargin{1}); case 'sdpvar' varargout{1} = InstantiateElementWise(mfilename,varargin{:}); case 'char' X = varargin{3}; F = (X >= eps); ...
github
ssketch/motorControl-master
invsathub.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/invsathub.m
3,871
utf_8
36f5bf3e2525f27b871df12fa5223c98
function varargout = invsathub (varargin) %INVSATHUB (overloaded) switch class(varargin{1}) case 'sdpvar' varargout{1} = InstantiateElementWise(mfilename,varargin{:}); case 'char' operator = struct('convexity','none','monotonicity','none','definiteness','positive','model','callback'); ...
github
ssketch/motorControl-master
tanh.m
.m
motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/tanh.m
783
utf_8
30538db981e451f6b520b7c7895a8e3d
function varargout = tanh(varargin) %TANH (overloaded) switch class(varargin{1}) case 'double' error('Overloaded SDPVAR/TANH CALLED WITH DOUBLE. Report error') case 'sdpvar' varargout{1} = InstantiateElementWise(mfilename,varargin{:}); case 'char' operator = struct('convexity','...