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 | acot.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/acot.m | 807 | utf_8 | 8bec7762540393b0aae6b6b9ebc2864a | function varargout = acot(varargin)
%ACOT (overloaded)
switch class(varargin{1})
case 'double'
error('Overloaded SDPVAR/ACOT CALLED WITH DOUBLE. Report error')
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
operator = struct('convexity','... |
github | ssketch/motorControl-master | subsasgn.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/subsasgn.m | 10,933 | utf_8 | 475889576910cf95a1f4499015d6f2be | function y = subsasgn(X,I,Y)
%SUBASGN (overloaded)
try
if strcmp('()',I.type)
X_is_spdvar = isa(X,'sdpvar') | isa(X,'ndsdpvar');
Y_is_spdvar = isa(Y,'sdpvar') | isa(Y,'ndsdpvar');
if islogical(I.subs{1})
I.subs{1} = double(find(I.subs{1}));
end
if any(I.subs{1}... |
github | ssketch/motorControl-master | atan.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/atan.m | 1,152 | utf_8 | 071999f9ece4ebf3e24f7eb58e385149 | function varargout = atan(varargin)
%ATAN (overloaded)
switch class(varargin{1})
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
operator = struct('convexity','none','monotonicity','increasing','definiteness','none','model','callback');
operato... |
github | ssketch/motorControl-master | sqrt.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/sqrt.m | 3,036 | utf_8 | dbdc41fb98e355d38f7827f44c1095b5 | function varargout = sqrt(varargin)
%SQRT (overloaded)
%
% t = sqrt(x)
%
% The variable t can only be used in concavity preserving
% operations such as t>=1, max t etc.
%
% When SQRT is used in a problem, the domain constraint
% (x>=0) is automatically added to the problem.
%
% In nonconvex cases, use sqrtm instead.
%
... |
github | ssketch/motorControl-master | exp.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/exp.m | 1,679 | utf_8 | 7607374514cce6bcdf22afbb25606aa9 | function varargout = exp(varargin)
%EXP (overloaded)
switch class(varargin{1})
case 'sdpvar'
x = varargin{1};
d = size(x);
x = x(:);
y = [];
for i = 1:prod(d)
xi = extsubsref(x,i);
if isa(xi,'double')
y = [y;exp(xi)];
else... |
github | ssketch/motorControl-master | times.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/times.m | 11,578 | utf_8 | 446a9d604ec704ba3af6d3c341e133f8 | function y = times(X,Y)
%TIMES (overloaded)
% Check dimensions
[n,m]=size(X);
if ~((prod(size(X))==1) || (prod(size(Y))==1))
if ~((n==size(Y,1) && (m ==size(Y,2))))
error('Matrix dimensions must agree.')
end
end;
% Convert block objects
if isa(X,'blkvar')
X = sdpvar(X);
end
if isa(Y,'blkvar')
... |
github | ssketch/motorControl-master | erf.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/erf.m | 2,291 | utf_8 | 34e3cf2135d769bd1d33bc39a72655bd | function varargout = erf(varargin)
%ERF (overloaded)
switch class(varargin{1})
case 'double'
error('Overloaded SDPVAR/ERF CALLED WITH DOUBLE. Report error')
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
operator = struct('convexity','non... |
github | ssketch/motorControl-master | erfc.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/erfc.m | 756 | utf_8 | d1523f1dce8b03ea7377827749ac68ef | function varargout = erfc(varargin)
%ERFC (overloaded)
switch class(varargin{1})
case 'double'
error('Overloaded SDPVAR/ERFC CALLED WITH DOUBLE. Report error')
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
operator = struct('convexity','... |
github | ssketch/motorControl-master | power.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/power.m | 3,973 | utf_8 | 840a5282a2173feba3ea38f581a42286 | function y = power(x,d)
%POWER (overloaded)
% Vectorize x if d is vector
if numel(x)==1 & (numel(d)>1)
x = x.*ones(size(d));
end
% Vectorize if x is a vector
if numel(d)==1 & (numel(x)>1)
d = d.*ones(size(x));
end
if ~isequal(size(d),size(x))
error('Dimension mismatch in power');
end
if isa(x,'sdpvar')
... |
github | ssketch/motorControl-master | asin.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/asin.m | 733 | utf_8 | 3100afdb50eaff864a0e7f6331e7452b | function varargout = asin(varargin)
%ASIN (overloaded)
switch class(varargin{1})
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
operator = struct('convexity','none','monotonicity','increasing','definiteness','none','model','callback');
operato... |
github | ssketch/motorControl-master | lmior.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/lmior.m | 1,467 | utf_8 | cc3cd29a91a762b089e33a55547aac55 | function varargout = lmior(varargin)
%OR (overloaded)
% Models OR using a nonlinear operator definition
switch class(varargin{1})
case 'char'
z = varargin{2};
allextvars = yalmip('extvariables');
X = {};
for i = 3:nargin
Xtemp = expandor(varargin{i},allextvars);
... |
github | ssketch/motorControl-master | ismember.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/ismember.m | 3,414 | utf_8 | fb8583f41aa5b455ee06f14d295c8b5f | function varargout = ismember(varargin)
%ISMEMBER Define membership constraint on SDPVAR object
%
% F = ISMEMBER(x,P)
%
% Input
% x : SDPVAR object
% P : MPT polytope object, double, or CONSTRAINT object
% Output
% F : Constraints
%
% Depending on the second argument P, different classes of constraint are
% generat... |
github | ssketch/motorControl-master | lmixor.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/lmixor.m | 1,474 | utf_8 | 08dbdab504839a1207e532b611ea5c1f | function varargout = lmixor(varargin)
%XOR (overloaded)
% Models XOR using a nonlinear operator definition
switch class(varargin{1})
case 'char'
z = varargin{2};
allextvars = yalmip('extvariables');
X = {};
for i = 3:nargin
Xtemp = expandxor(varargin{i},allextvars);
... |
github | ssketch/motorControl-master | model.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/model.m | 4,132 | utf_8 | 875ed9e5691dfe8921448baee0c20edf | function [properties,F,arguments,fcn]=model(X,method,options,extstruct,w)
%MODEL Internal function to extracts nonlinear operator models
%
% [properties,F] = model(x)
%
% MODEL returns the constraints needed to model a variable related to an
% extended operator such as min, max, abs, norm, geomean, ...
%
% Examples :
... |
github | ssketch/motorControl-master | log.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/log.m | 2,585 | utf_8 | 39c91997bea9e861421411a1caa9ff54 | function varargout = log(varargin)
%LOG (overloaded)
switch class(varargin{1})
case 'double'
error('Overloaded SDPVAR/LOG CALLED WITH DOUBLE. Report error')
case 'sdpvar'
% Try to detect logsumexp construction etc
varargout{1} = check_for_special_cases(varargin{:});
% Nope, t... |
github | ssketch/motorControl-master | subsref.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/subsref.m | 9,006 | utf_8 | e636173f46339faf5538514fa0149273 | function varargout = subsref(varargin)
%SUBSREF (overloaded)
% Stupid first slice call (supported by MATLAB)
% x = sdpvar(2);x(1,:,:)
Y = varargin{2};
if length(Y)==1
if length(Y.subs) > 2 && isequal(Y.type,'()')
i = 3;
ok = 1;
while ok && (i <= length(Y.subs))
ok = ok && (iseq... |
github | ssketch/motorControl-master | sinh.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/sinh.m | 738 | utf_8 | 167ff99de55c2333af9b1e2479b71a75 | function varargout = sinh(varargin)
%SINH (overloaded)
switch class(varargin{1})
case 'double'
error('Overloaded SDPVAR/ACOT CALLED WITH DOUBLE. Report error')
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
operator = struct('convexity','... |
github | ssketch/motorControl-master | pwa.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/pwa.m | 4,366 | utf_8 | 47c565d662055a330df89467ca9366bd | 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 : SET object
%
% Output
%
% p : scalar SDPVAR object representing the PWA function
% Bi,Ci,Pn,Pfinal : Data in MPT format
%
% The command tries to expa... |
github | ssketch/motorControl-master | max.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/max.m | 4,500 | utf_8 | 0471f061098b8020cc74fb92b65b67b6 | function [y,loc] = max(varargin)
%MAX (overloaded)
%
% t = max(X)
% t = max(X,Y)
% t = max(X,[],DIM)
%
% Creates an internal structure relating the variable t with convex
% operator max(X).
%
% The variable t is primarily meant to be used in convexity preserving
% operations such as t<=..., minimize t etc.
%
% If the v... |
github | ssketch/motorControl-master | deadhub.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/deadhub.m | 1,425 | utf_8 | 19c2ad46cb40a73e2e3512d91f306a52 | function varargout = deadhub(varargin)
switch class(varargin{1})
case 'double'
error('Overloaded SDPVAR/SIN CALLED WITH DOUBLE. Report error')
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
operator = struct('convexity','convex','monotoni... |
github | ssketch/motorControl-master | mtimes.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/mtimes.m | 31,634 | utf_8 | 59c8e0f342536c12a5643835918fa1f3 | function Z = mtimes(X,Y)
%MTIMES (overloaded)
% Cannot use isa here since blkvar is marked as sdpvar
X_class = class(X);
Y_class = class(Y);
X_is_spdvar = strcmp(X_class,'sdpvar');
Y_is_spdvar = strcmp(Y_class,'sdpvar');
% Convert block objects
if ~X_is_spdvar
if isa(X,'blkvar')
X = sdpvar(X);
X_i... |
github | ssketch/motorControl-master | cosh.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/cosh.m | 867 | utf_8 | c13a2d8c9f1f455224d9d5fc5a232af4 | function varargout = cosh(varargin)
%COSH (overloaded)
switch class(varargin{1})
case 'double'
error('Overloaded SDPVAR/COSH CALLED WITH DOUBLE. Report error')
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
operator = struct('convexity','... |
github | ssketch/motorControl-master | det.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/det.m | 2,020 | utf_8 | c62ed564f88ca694ab3f483f7c7664ef | function varargout = det(varargin)
%DET (overloaded)
%
% t = DET(X)
switch class(varargin{1})
case 'sdpvar' % Overloaded operator for SDPVAR objects. Pass on args and save them.
X = varargin{1};
[n,m] = size(X);
if n~=m
error('Matrix must be square.')
en... |
github | ssketch/motorControl-master | value.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/value.m | 11,490 | utf_8 | 808ae573d8e0ca8f5a08c6b16ff7fb30 | function [sys,values] = value(X,allextended,allevaluators,allStruct,mt,variabletype,solution,values)
%VALUE Returns current numerical value of an SDPVAR object
%
% After solving an optimization problem, we can extract the current
% solution by applying VALUE on a variable of interest
%
% xvalue = value(x)
%
% If you h... |
github | ssketch/motorControl-master | cos.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/cos.m | 1,708 | utf_8 | 8f6b7d263e781c2959afd94381b1a131 | function varargout = cos(varargin)
%COS (overloaded)
switch class(varargin{1})
case 'double'
error('Overloaded SDPVAR/COS CALLED WITH DOUBLE. Report error')
case 'sdpvar'
varargout{1} = InstantiateElementWiseUnitary(mfilename,varargin{:});
case 'char'
operator = ... |
github | ssketch/motorControl-master | erfcx.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/erfcx.m | 674 | utf_8 | 1f0ede69a805c09aa20815d4ee2aa46b | function varargout = erfcx(varargin)
%ERFCX (overloaded)
switch class(varargin{1})
case 'double'
error('Overloaded SDPVAR/ERFCX CALLED WITH DOUBLE. Report error')
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
operator = struct('convexity... |
github | ssketch/motorControl-master | sin.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/sin.m | 1,835 | utf_8 | 70d381366a829f9cd6b32d6075ea3ce2 | function varargout = sin(varargin)
%SIN (overloaded)
switch class(varargin{1})
case 'double'
error('Overloaded SDPVAR/SIN CALLED WITH DOUBLE. Report error')
case 'sdpvar'
varargout{1} = InstantiateElementWiseUnitary(mfilename,varargin{:});
%varargout{1} = InstantiateElementWise(mfilen... |
github | ssketch/motorControl-master | min.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/min.m | 4,893 | utf_8 | 0728988604c617566a2b5ac23c64e867 | function [y,loc]=min(varargin)
%MIN (overloaded)
%
% t = MIN(X)
% t = MIN(X,Y)
% t = MIN(X,[],DIM)
%
% Creates an internal structure relating the variable t with concave
% operator MIN(X).
%
% The variable t is primarily meant to be used in convexity preserving
% operations such as t>=0, maximize t etc.
%
% If the vari... |
github | ssketch/motorControl-master | pow2.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/pow2.m | 975 | utf_8 | 39f0baec231cb6e3e01ff432c5ec3237 | function varargout = pow2(varargin)
%POW2 (overloaded)
switch class(varargin{1})
case 'double'
error('Overloaded SDPVAR/POW2 CALLED WITH DOUBLE. Report error')
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
operator = struct('conv... |
github | ssketch/motorControl-master | acosh.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/acosh.m | 716 | utf_8 | b0d93d0f408c0c67ffbc9791f4e52e1b | function varargout = acosh(varargin)
%ACOSH (overloaded)
switch class(varargin{1})
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
operator = struct('convexity','none','monotonicity','none','definiteness','positive','model','callback');
operato... |
github | ssketch/motorControl-master | diff.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/diff.m | 2,025 | utf_8 | 2a39574fd1ff1b4b733230eeead686ba | function Y=diff(varargin)
%DIFF (overloaded)
X = varargin{1};
n = X.dim(1);
m = X.dim(2);
switch nargin
case 1
if n == 1
% Default is diff along first dimension, unless we only have
% one row. This happens to be the case in which the core function operates
Y... |
github | ssketch/motorControl-master | erfinv.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/@sdpvar/erfinv.m | 803 | utf_8 | 810f64595d183f3910c960d722dcc702 | function varargout = erfinv(varargin)
%ERFINV (overloaded)
switch class(varargin{1})
case 'double'
error('Overloaded SDPVAR/ERFINV CALLED WITH DOUBLE. Report error')
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
X = varargin{3};
... |
github | ssketch/motorControl-master | callkypd.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callkypd.m | 4,451 | utf_8 | 62267054f26da5f4af3119e87fecc8f8 | function diagnostic = callkypd(F,h,options)
%F = constraint2kyp(F);
kyps = is(F,'kyp');
if all(kyps)
kypConstraints = F;
otherConstraints = lmi;
else
kypConstraints = F(find(kyps));
otherConstraints = F(find(~kyps));
end
% Trivial case
if length(kypConstraints) == 0
if ~isempty(options)
... |
github | ssketch/motorControl-master | callscs.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callscs.m | 5,231 | utf_8 | cb0485aa52460acfcd3274f9c4aed817 | function output = callscs(model)
% Retrieve needed data
options = model.options;
F_struc = model.F_struc;
c = model.c;
K = model.K;
ub = model.ub;
lb = model.lb;
% *********************************************
% Bounded variables converted to constraints
% N.B. Only happens when caller is BNB
% ... |
github | ssketch/motorControl-master | callsdpnal.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callsdpnal.m | 3,584 | utf_8 | 285ad40ba01cbc6c1ccf210c0be0f745 | function output = callsdpnal(interfacedata)
% Retrieve needed data
options = interfacedata.options;
F_struc = interfacedata.F_struc;
c = interfacedata.c;
K = interfacedata.K;
x0 = interfacedata.x0;
ub = interfacedata.ub;
lb = interfacedata.lb;
% Bounded variables converted to constraints
if... |
github | ssketch/motorControl-master | callquadprogbb.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callquadprogbb.m | 2,112 | utf_8 | 9c075a2736463b4b85a7c58e6fa44997 | function output = callquadprogbb(interfacedata)
options = interfacedata.options;
model = yalmip2quadprog(interfacedata);
if options.savedebug
save debugfile model
end
if options.showprogress;showprogress(['Calling ' interfacedata.solver.tag],options.showprogress);end
solvertime = tic;
solveroutput = callsolver(m... |
github | ssketch/motorControl-master | callmpt3.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callmpt3.m | 3,688 | utf_8 | ad7eb3b682d81797392f46cd553fad13 | function output = callmpt3(interfacedata)
% Speeds up solving LPs in mpmilp
global MPTOPTIONS
if ~isstruct(MPTOPTIONS)
mpt_error
end
% Convert
Matrices = yalmip2mpt(interfacedata);
% Get some MPT options
options = interfacedata.options;
options.mpt.lpsolver = MPTOPTIONS.lpsolver;
options.mpt.milpsolver = MPTOPTI... |
github | ssketch/motorControl-master | callsedumi.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callsedumi.m | 4,226 | utf_8 | 9d1741422584e1fff64182ba87a2f586 | function output = callsedumi(model)
% Retrieve needed data
options = model.options;
F_struc = model.F_struc;
c = model.c;
K = model.K;
ub = model.ub;
lb = model.lb;
% Create the parameter structure
pars = options.sedumi;
pars.fid = double(options.verbose);
% ************************************... |
github | ssketch/motorControl-master | callscipnl.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callscipnl.m | 6,643 | utf_8 | eb1a63a10553a041f4b536ce146a8c68 | function output = callscipnl(model)
% This sets up everything and more. Can be simplified significantly since
% baron handles its own computational tree etc
model = yalmip2nonlinearsolver(model);
% [Anonlinear*f(x) <= b;Anonlinear*f(x) == b]
cu = full([model.bnonlinineq;model.bnonlineq]);
cl = full([repmat(-inf,lengt... |
github | ssketch/motorControl-master | callcdcs.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callcdcs.m | 2,930 | utf_8 | 39b198a05d0a5cab1824d0fc8f2dd252 | function output = callcdcs(model)
% Retrieve needed data
options = model.options;
F_struc = model.F_struc;
c = model.c;
K = model.K;
ub = model.ub;
lb = model.lb;
% *********************************************
% Bounded variables converted to constraints
% N.B. Only happens when caller is BNB
... |
github | ssketch/motorControl-master | callsdplr.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callsdplr.m | 5,266 | utf_8 | 5c7764fc2491c871ade190c92aad167f | function output = callsdplr(interfacedata)
% Retrieve needed data
options = interfacedata.options;
F_struc = interfacedata.F_struc;
c = interfacedata.c;
K = interfacedata.K;
ub = interfacedata.ub;
lb = interfacedata.lb;
lowrankdetails = interfacedata.lowrankdetails;
% Create the parameter struc... |
github | ssketch/motorControl-master | callmpt.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callmpt.m | 4,259 | utf_8 | 0efb3007f158b670add775bac3639d40 | function output = callmpt(interfacedata)
% This file is kept for MPT2 compatability
% Speeds up solving LPs in mpmilp
global mptOptions
if ~isstruct(mptOptions)
mpt_error
end
% Convert
Matrices = yalmip2mpt(interfacedata);
% Get some MPT options
options = interfacedata.options;
options.mpt.lpsolver = mptOptions... |
github | ssketch/motorControl-master | callpenbmim.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callpenbmim.m | 8,300 | utf_8 | 6e308fd29949fd8db28d9fedcc2289e4 | function output = callpenbmi(interfacedata);
if any(interfacedata.variabletype > 2)
% Polynomial problem, YALMIP has to bilienarize
interfacedata.high_monom_model=[];
output = callpenbmi_with_bilinearization(interfacedata);
else
% Old standard code
output = callpenbmi_without_bilinearization(interf... |
github | ssketch/motorControl-master | yalmip2xpress.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/yalmip2xpress.m | 3,380 | utf_8 | 939c179fa34ef53a916b36c325cff8ab | function model = yalmip2xpress(interfacedata)
options = interfacedata.options;
F_struc = interfacedata.F_struc;
H = interfacedata.Q;
c = interfacedata.c;
K = interfacedata.K;
x0 = interfacedata.x0;
integer_variables = interfacedata.integer_variables;
binary_variables = interfacedata.binary_varia... |
github | ssketch/motorControl-master | calllogdetppa.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/calllogdetppa.m | 4,747 | utf_8 | 10e3256ecd1c67a8b9922351016e74dd | function output = calllogdetppa(interfacedata)
% Retrieve needed data
options = interfacedata.options;
F_struc = interfacedata.F_struc;
c = interfacedata.c;
K = interfacedata.K;
x0 = interfacedata.x0;
ub = interfacedata.ub;
lb = interfacedata.lb;
% Bounded variables converted to constraints... |
github | ssketch/motorControl-master | callbaron.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callbaron.m | 5,164 | utf_8 | 1da9c6bf9cd2e25663ddea6329ebc2d1 | function output = callbaron(model)
% This sets up everything and more. Can be simplified significantly since
% baron handles its own computational tree etc
model = yalmip2nonlinearsolver(model);
% [Anonlinear*f(x) <= b;Anonlinear*f(x) == b]
cu = full([model.bnonlinineq;model.bnonlineq]);
cl = full([repmat(-inf,length... |
github | ssketch/motorControl-master | mpcvx.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/mpcvx.m | 11,816 | utf_8 | 9c49d6f2332bc7a0b4d072b435a732a1 | function output = mpcvx(p)
%MPCVX Approximate multi-parametric programming
%
% MPCVX is never called by the user directly, but is called by
% YALMIP from SOLVESDP, by choosing the solver tag 'mpcvx' in sdpsettings
%
% The behaviour of MPCVX can be altered using the fields
% in the field 'mpcvx' in SDPSETTINGS
... |
github | ssketch/motorControl-master | callvsdp.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callvsdp.m | 4,304 | utf_8 | 46fa5a591dd2c1b8b120105321f65f2a | function output = callvsdp(interfacedata)
% Retrieve needed data
options = interfacedata.options;
F_struc = interfacedata.F_struc;
c = interfacedata.c;
K = interfacedata.K;
x0 = interfacedata.x0;
ub = interfacedata.ub;
lb = interfacedata.lb;
% Bounded variables converted to constraints
if ~... |
github | ssketch/motorControl-master | callsparsecolo.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callsparsecolo.m | 4,510 | utf_8 | 2711e764081b1a7ed2fef33a83b15b5c | function output = callsparsecolo(interfacedata)
% Retrieve needed data
options = interfacedata.options;
F_struc = interfacedata.F_struc;
c = interfacedata.c;
K = interfacedata.K;
x0 = interfacedata.x0;
ub = interfacedata.ub;
lb = interfacedata.lb;
% Bounded variables converted to constraint... |
github | ssketch/motorControl-master | yalmip2mosek.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/yalmip2mosek.m | 2,991 | utf_8 | b793cd2a38c2e96dcf47933b6a79a456 | function prob = yalmip2mosek(interfacedata);
% Retrieve needed data
options = interfacedata.options;
F_struc = interfacedata.F_struc;
c = interfacedata.c;
Q = interfacedata.Q;
K = interfacedata.K;
x0 = interfacedata.x0;
integer_variables = interfacedata.integer_variables;
binary_variables = inte... |
github | ssketch/motorControl-master | callsdpt34.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callsdpt34.m | 8,436 | utf_8 | 9d7a48c05b34a61a0f8336349a786c59 | function output = callsdpt34(interfacedata)
% Retrieve needed data
options = interfacedata.options;
F_struc = interfacedata.F_struc;
c = interfacedata.c;
K = interfacedata.K;
x0 = interfacedata.x0;
ub = interfacedata.ub;
lb = interfacedata.lb;
% Bounded variables converted to constraints
if... |
github | ssketch/motorControl-master | callquadprog.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callquadprog.m | 3,589 | utf_8 | df4c71254d4cbd98d13d5afe1f230957 | function output = callquadprog(interfacedata)
options = interfacedata.options;
model = yalmip2quadprog(interfacedata);
if options.savedebug
save debugfile model
end
if options.showprogress;showprogress(['Calling ' interfacedata.solver.tag],options.showprogress);end
solvertime = tic;
solveroutput = callsolver(mod... |
github | ssketch/motorControl-master | callmosek.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callmosek.m | 14,246 | utf_8 | 2123fdd23d02ec233b23f9afa9ab3c6b | function output = callmosek(model)
% Retrieve needed data
options = model.options;
F_struc = model.F_struc;
c = model.c;
Q = model.Q;
K = model.K;
x0 = model.x0;
integer_variables = model.integer_variables;
binary_variables = model.binary_variables;
extended_variables = model.extended_variables;... |
github | ssketch/motorControl-master | calllsqlin.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/calllsqlin.m | 2,847 | utf_8 | 170763f45e1ac6f29996fc8e82535665 | function output = calllsqlin(interfacedata)
K = interfacedata.K;
c = interfacedata.c;
CA = interfacedata.F_struc;
options = interfacedata.options;
% To begin with, with try to figure out if this is a simple non-negative
% least squares in disguise
if length(K.q)~=1
output = error_output;
return
end
% total n... |
github | ssketch/motorControl-master | callbonmin.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callbonmin.m | 4,532 | utf_8 | 3e4061b2327fce758da882c69816d9fe | function output = callbonmin(model)
model = yalmip2nonlinearsolver(model);
options = [];
try
options.bonmin = optiRemoveDefaults(model.options.bonmin,bonminset());
catch
options.bonmin = model.options.bonmin;
end
options.ipopt = model.options.ipopt;
options.display = model.options.verbose;
if ~model.derivat... |
github | ssketch/motorControl-master | calllsqnonneg.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/calllsqnonneg.m | 2,939 | utf_8 | f42645b72b16302e04543c90729d2f65 | function output = calllsqnonneg(interfacedata)
K = interfacedata.K;
c = interfacedata.c;
CA = interfacedata.F_struc;
options = interfacedata.options;
% To begin with, with try to figure out if this is a simple non-negative
% least squares in disguise
if length(K.q)~=1
output = error_output;
return
end
% tota... |
github | ssketch/motorControl-master | callqpoases.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/solvers/callqpoases.m | 1,710 | utf_8 | 42faef3cd8048ea6e498b94d4de8bb35 | function output = callqpoases(interfacedata)
options = interfacedata.options;
model = yalmip2quadprog(interfacedata);
if options.savedebug
save debugfile model
end
if options.showprogress;showprogress(['Calling ' interfacedata.solver.tag],options.showprogress);end
solvertime = tic;
solution = callsolver(model,op... |
github | ssketch/motorControl-master | sdpfun.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/sdpfun.m | 5,350 | utf_8 | 5b5fa3dbe34d335b03433f73348dbf37 | function varargout = sdpfun(varargin)
%SDPFUN Gateway to general (elementwise) functions on SDPVAR variables (overloaded)
if ~isa(varargin{1},'char') && any(strcmp(cellfun(@class,varargin,'UniformOutput',0),'sdpvar'))
fun_handles = zeros(nargin,1);
for i = 1:nargin
if isstr(varargin{end}) && isequa... |
github | ssketch/motorControl-master | absexp.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/absexp.m | 972 | utf_8 | 1c9eb8d6258431984094357b18a76a4a | function varargout = absexp(varargin)
switch class(varargin{1})
case 'double'
varargout{1} = abs(exp(varargin{1}) - 1);
case 'sdpvar'
varargout{1} = InstantiateBuiltInScalar(mfilename,varargin{:});
case 'char'
t = varargin{2};
X = varargin{3};
F = SetupEvaluation... |
github | ssketch/motorControl-master | entropy.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/entropy.m | 2,329 | utf_8 | c7fcaf9a586bef89f9b47139c2b5aa9f | function varargout = entropy(varargin)
%ENTROPY
%
% y = ENTROPY(x)
%
% Computes/declares concave entropy -sum(x.*log(x))
%
% Implemented as evalutation based nonlinear operator. Hence, the concavity
% of this function is exploited to perform convexity analysis and rigorous
% modelling.
%
% See also CROSSENTROPY, KULLBA... |
github | ssketch/motorControl-master | xexpintinv.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/xexpintinv.m | 816 | utf_8 | bd8857363df0521d4ca537237872b1f5 | function varargout = xexpintinv(varargin)
%XEXPINTINV EXPINT(1/Z)/Z
switch class(varargin{1})
case 'double'
z = varargin{1};
varargout{1} = (1./z).*expint(1./z);
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
varar... |
github | ssketch/motorControl-master | kullbackleibler.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/kullbackleibler.m | 1,913 | utf_8 | b60195db713567cbb6515e32703c04e8 | function varargout = kullbackleibler(varargin)
% KULLBACKLEIBLER
%
% y = KULLBACKLEIBLER(x,y)
%
% Computes/declares the convex Kullback-Leibler divergence sum(x.*log(x./y))
% Alternatively -sum(x.*log(y/x)), i.e., negated perspectives of log(y)
%
% See also ENTROPY, CROSSENTROPY
switch class(varargin{1})
case 'd... |
github | ssketch/motorControl-master | plog.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/plog.m | 2,378 | utf_8 | 1fbff63d07b747a5626c64a78b853a90 | function varargout = plog(varargin)
%PLOG
%
% y = PLOG(x)
%
% Computes concave perspective log, x(1)*log(x(2)/x(1)) on x>0
%
% Implemented as evalutation based nonlinear operator. Hence, the concavity
% of this function is exploited to perform convexity analysis and rigorous
% modelling.
switch class(varargin{1})
... |
github | ssketch/motorControl-master | crossentropy.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/crossentropy.m | 1,815 | utf_8 | dd20a786dd2a42dbd13576cf33b307b0 | function varargout = crossentropy(varargin)
% CROSSENTROPY
%
% y = CROSSENTROPY(x,y)
%
% Computes/declares cross entropy -sum(x.*log(y))
%
% See also ENTROPY, KULLBACKLEIBLER
switch class(varargin{1})
case 'double'
if nargin == 1
% YALMIP flattens internally to [x(:);y(:)]
z = ... |
github | ssketch/motorControl-master | max_internal.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/max_internal.m | 2,213 | utf_8 | 2edcf0a9b2ba0bb9c7c83143b1267945 | function varargout = max_internal(varargin)
switch class(varargin{1})
case 'double'
varargout{1} = max(varargin{:});
case 'char'
extstruct.var = varargin{2};
extstruct.arg = {varargin{3:end}};
[F,properties,arguments]=max_model([],varargin{1},[],extstruct);
varargout{1} ... |
github | ssketch/motorControl-master | expexpintinv.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/expexpintinv.m | 842 | utf_8 | 2befcb9c4f10aff4f339806f9a4828a5 | function varargout = expexpintinv(varargin)
%EXPINT (overloaded)
switch class(varargin{1})
case 'double'
z = varargin{1};
varargout{1} = exp(1./z).*expint(1./z);
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
varar... |
github | ssketch/motorControl-master | logistic.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/logistic.m | 1,813 | utf_8 | cda6c71081d16601fd785bb2c12ff46e | function varargout = logistic(varargin)
% LOGISTIC Returns logistic function 1./(1+exp(-x))
%
% y = LOGISTIC(x)
%
% For a real vector x, LOGISTIC returns (1+exp(-x)).^-1
switch class(varargin{1})
case 'double'
x = varargin{1};
varargout{1} = 1./(1+exp(-x));
case 'sdpvar'
varargout{1}... |
github | ssketch/motorControl-master | slog.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/slog.m | 2,540 | utf_8 | 337f77232e578d581ec03cc60aaec8a1 | function varargout = slog(varargin)
%ENTROPY
%
% y = SLOG(x)
%
% Computes/declares concave shifted logarithm log(1+x)
%
% Implemented as evalutation based nonlinear operator. Hence, the concavity
% of this function is exploited to perform convexity analysis and rigorous
% modelling. Implemented in order to avoid singul... |
github | ssketch/motorControl-master | pexp.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/pexp.m | 1,926 | utf_8 | 9f393a82b8186ab6fbbc6ef1ed1b8fc6 | function varargout = pexp(varargin)
%PEXP
%
% y = PEXP(x)
%
% Computes perspective exp, x(1)*exp(x(2)/x(1)) on x>0
%
% Implemented as evalutation based nonlinear operator. Hence, the convexity
% of this function is exploited to perform convexity analysis and rigorous
% modelling.
switch class(varargin{1})
cas... |
github | ssketch/motorControl-master | acos_internal.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/acos_internal.m | 879 | utf_8 | 1e3261fde0507f4701cb739fbb4be919 | function varargout = acos_internal(varargin)
%ACOS (overloaded)
switch class(varargin{1})
case 'double'
x = varargin{1};
y = acos(x);
y(x<-1) = pi;
y(x>1) = 0;
varargout{1} = y;
case 'char'
operator = struct('convexity','none','monotonicity','decreasi... |
github | ssketch/motorControl-master | implies_internal.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/implies_internal.m | 5,075 | utf_8 | e53fb93c351693a8fa46d1e56ec7162a | function varargout = implies_internal(varargin)
X = varargin{1};
Y = varargin{2};
if nargin == 2
zero_tolerance = 1e-5;
else
zero_tolerance = varargin{3};
end
% Normalize
if isa(X,'constraint')
X = lmi(X,[],[],1);
end
if isa(Y,'constraint')
Y = lmi(Y,[],[],1);
end
% % Special case something implies ... |
github | ssketch/motorControl-master | cpower.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/cpower.m | 2,821 | utf_8 | 7da9a3176a88314e9825801fed666649 | function varargout = cpower(varargin)
%CPOWER Power of SDPVAR variable with convexity knowledge
%
% CPOWER is recommended if your goal is to obtain
% a convex model, since the function CPOWER is implemented
% as a so called nonlinear operator. (For p/q ==2 you can
% however just as well use the overloaded power)
%
% t ... |
github | ssketch/motorControl-master | min_internal.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/min_internal.m | 1,846 | utf_8 | 000eee732402247d0ba89563345fdef3 | function varargout = min_internal(varargin)
switch class(varargin{1})
case 'double'
varargout{1} = min(varargin{:});
case 'char'
extstruct.var = varargin{2};
extstruct.arg = {varargin{3:end}};
[F,properties,arguments]=min_model([],varargin{1},[],extstruct);
varargout{1} ... |
github | ssketch/motorControl-master | interp2_internal.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/interp2_internal.m | 1,962 | utf_8 | 1f61b6e9e3944cab8eed839c6df10ad4 | function varargout = interp2_internal(varargin)
%INTERP1_INTERNAL (overloaded)
switch class(varargin{1})
case 'double'
varargout{1} = interp2(varargin{2},varargin{3},varargin{4},varargin{1}(1),varargin{1}(2),varargin{5});
case 'char'
L = [min(varargin{4}(:));min(... |
github | ssketch/motorControl-master | cabs.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/cabs.m | 1,385 | utf_8 | 368c7b73e8ce5c0bdec8be9f1aabfc06 | function varargout = cabs(varargin)
%cabs (overloaded)
switch class(varargin{1})
case 'double'
varargout{1} = abs(varargin{1});
case 'sdpvar'
varargout{1} = InstantiateElementWise(mfilename,varargin{:});
case 'char'
operator = struct('convexity','convex','monotonicity','... |
github | ssketch/motorControl-master | hinge.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/hinge.m | 1,849 | utf_8 | ab2ac5552cc620872747dce02433b918 | function varargout = hinge(varargin)
%HINGE Models convex operator max(0,x^p) for integer p>=1
%
% t = hinge(x,p)
switch class(varargin{1})
case 'double'
if nargin == 1
varargout{1} = max(0,varargin{1});
else
varargout{1} = max(0,varargin{1}.^varargin{2});
end
... |
github | ssketch/motorControl-master | interp1_internal.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/interp1_internal.m | 1,880 | utf_8 | e19c36850c5f134b2c4fd93ffcf31375 | function varargout = interp1_internal(varargin)
%INTERP1_INTERNAL (overloaded)
switch class(varargin{1})
case 'double'
varargout{1} = interp1(varargin{2},varargin{3},varargin{1},varargin{4});
case 'char'
t = varargin{2};
x = varargin{3};
xi = varargin{4}... |
github | ssketch/motorControl-master | power_internal1.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/power_internal1.m | 2,608 | utf_8 | 5db5689788823be7f324d5c8525ce8eb | function varargout = power_internal1(varargin)
%power_internal1
% Used for cases such as 2^x, and is treated as evaluation-based operators
switch class(varargin{1})
case 'double'
varargout{1} = varargin{2}.^varargin{1};
case 'sdpvar'
if isa(varargin{2},'sdpvar')
x = varargin{2};
... |
github | ssketch/motorControl-master | pnorm.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/pnorm.m | 3,905 | utf_8 | 6ea7721daa042f84ee690bffafed5bdf | function varargout = pnorm(varargin)
%PNORM P-Norm of SDPVAR variable with convexity knowledge
%
% PNORM is recommended if your goal is to obtain
% a convex model, since the function PNORM is implemented
% as a so called nonlinear operator. (For p/q ==1,2,inf you should use the
% overloaded norm)
%
% t = pnorm(x,p/q), ... |
github | ssketch/motorControl-master | logsumexp.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/logsumexp.m | 1,468 | utf_8 | e8b870ebd122b54b3a803f3d409d33e6 | function varargout = logsumexp(varargin)
%LOGSUMEXP
%
% y = LOGSUMEXP(x)
%
% Computes/declares log of sum of exponentials log(sum(exp(x)))
%
% Implemented as evalutation based nonlinear operator. Hence, the convexity
% of this function is exploited to perform convexity analysis and rigorous
% modelling.
switch class(v... |
github | ssketch/motorControl-master | iff_internal.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20160930/all/YALMIP-master/operators/iff_internal.m | 4,537 | utf_8 | d8584f718a3990f1a962d3f84359f366 | function varargout = iff_internal(varargin)
X = varargin{1};
Y = varargin{2};
if nargin == 2
zero_tolerance = 1e-5;
else
zero_tolerance = abs(varargin{3});
end
% Normalize data
if isa(Y,'constraint')
Y=lmi(Y,[],[],1);
end
if isa(X,'constraint')
X=lmi(X,[],[],1);
end
if isa(X,'lmi') & isa(Y,'sdpvar')
... |
github | ssketch/motorControl-master | yalmiptest.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20150918/all/yalmip/yalmiptest.m | 17,035 | utf_8 | 4a8ad7d56c1153743ca991381cc2f3a6 | function out = yalmiptest(prefered_solver,auto)
%YALMIPTEST Runs a number of test problems.
%
% YALMIPTEST is recommended when a new solver or a new version
% of YALMIP installed.
%
% EXAMPLES
% YALMIPTEST % Without argument, default solver used
% YALMIPTEST('solver tag') % Test with specified... |
github | ssketch/motorControl-master | solvesdp.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20150918/all/yalmip/solvesdp.m | 15,551 | utf_8 | 8aa9cfafe34ac3e4c7a88041a3fd9d2d | 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 | deriveBasis.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20150918/all/yalmip/modules/sos/deriveBasis.m | 323 | utf_8 | 0401f866c43215ad1c43d68dd8499dd3 | function H = deriveBasis(A_equ)
[L,U,P] = lu(A_equ);
[L,U,P] = lu(A_equ');
r = colspaces(L');
AA = L';
H1 = AA(:,r);
H2 = AA(:,setdiff(1:size(AA,2),r));
H = P'*[-H1\H2;speye(size(H2,2))];
function [indx]=colspaces(A)
indx = [];
for i = 1:size(A,2)
s = max(find(A(:,i)));
indx = [indx s];
end
indx = unique(indx)... |
github | ssketch/motorControl-master | postprocesssos.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20150918/all/yalmip/modules/sos/postprocesssos.m | 3,702 | utf_8 | 6716cb77d4d92dcbb793f478d7c47993 | function [BlockedQ,residuals] = postprocesssos(BlockedA,Blockedb,BlockedQ,sparsityPattern,options);
BlockedQ=applysparsity(BlockedQ,sparsityPattern);
for passes = 1:1:options.sos.postprocess
for constraint = 1:length(BlockedQ)
mismatch = computeresiduals(BlockedA,Blockedb,BlockedQ,constraint);
[ii... |
github | ssketch/motorControl-master | generate_kernel_representation_data.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20150918/all/yalmip/modules/sos/generate_kernel_representation_data.m | 9,746 | utf_8 | 408c65ea2806342ae7e7998a85c98ba7 | function [A,b] = generate_kernel_representation_data(N,N_unique,exponent_m2,exponent_p,p,options,p_base_parametric,ParametricIndicies,MonomIndicies,FirstRun)
persistent saveData
exponent_p_parametric = exponent_p(:,ParametricIndicies);
exponent_p_monoms = exponent_p(:,MonomIndicies);
pcoeffs = getbase(p);
if any(expo... |
github | ssketch/motorControl-master | solvebilevel.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20150918/all/yalmip/modules/bilevel/solvebilevel.m | 28,584 | utf_8 | ca5553a39360503959e1ef8141c91ee0 | function [sol,info] = solvebilevel(OuterConstraints,OuterObjective,InnerConstraints,InnerObjective,InnerVariables,options)
%SOLVEBILEVEL Simple global bilevel solver
%
% min CO(x,y)
% subject to OO(x,y)>0
% y = arg min OI(x,y)
% subject to CI(x,y)>0
%
% [DIAGNOSTIC,INFO] = SOLVEBI... |
github | ssketch/motorControl-master | robust_classify_variables_newest.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20150918/all/yalmip/modules/robust/robust_classify_variables_newest.m | 5,032 | utf_8 | 71ff61f98a9e321589e7b9db9f902871 | function [VariableType,F_x,F_w,F_xw,h] = robust_classify_variables_newest(F,h,ops,w);
Dependency = iterateDependance( yalmip('monomtable') | yalmip('getdependence') | yalmip('getdependenceUser'));
DependsOnw = find(any((Dependency(:,getvariables(w))),2));
h_variables = getvariables(h);
h_w = find(ismember(h_variable... |
github | ssketch/motorControl-master | filter_polya.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20150918/all/yalmip/modules/robust/filter_polya.m | 5,003 | utf_8 | 55fbd1c40e70d698b82c42d8aee3287f | function [F_xw,F_polya] = filter_polya(F_xw,w,N)
F_polya = [];
Fvars = getvariables(F_xw);
wvars = getvariables(w);
[mt,vt] = yalmip('monomtable');
if ~(N==ceil(N)) & (N>=0)
error('The power in robust.polya must be a non-negative integer');
end
F_new = [];
if any(sum(mt(Fvars,wvars),2)>1)
removeF = zeros(lengt... |
github | ssketch/motorControl-master | dualtososrobustness.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20150918/all/yalmip/modules/robust/dualtososrobustness.m | 3,252 | utf_8 | 499ac2bd7b66be04e843f1a3edb0611c | function SOSModel = dualtososrobustness(UncertainConstraint,UncertaintySet,UncertainVariables,DecisionVariables,p_tau_degree,localizer_tau_degree,Z_degree)
[E,F] = getEFfromSET(UncertaintySet);
[F0,Fz,Fx,Fxz] = getFzxfromSET(UncertainConstraint,UncertainVariables,DecisionVariables);
if is(UncertainConstraint,'sdp')... |
github | ssketch/motorControl-master | filter_duality.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20150918/all/yalmip/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/R20150918/all/yalmip/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/R20150918/all/yalmip/modules/robust/decomposeUncertain.m | 25,501 | utf_8 | de52048b978e055a2e273ab28fa80d85 | 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 | root_node_tighten.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20150918/all/yalmip/modules/global/root_node_tighten.m | 4,114 | utf_8 | 337752e11e3b4918818b979f123b0ae4 | % *************************************************************************
% 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/R20150918/all/yalmip/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 | updateonenonlinearbound.m | .m | motorControl-master/MPC/include/tbxmanager/toolboxes/yalmip/R20150918/all/yalmip/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/R20150918/all/yalmip/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/R20150918/all/yalmip/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/R20150918/all/yalmip/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/R20150918/all/yalmip/modules/global/bnb_solvelower.m | 6,280 | utf_8 | 2876e0b094d4dbbf73fc45f1454c259e | 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.