優(yōu)化(二)
多目標(biāo)規(guī)劃問題

決策變量? ? ? Xi表示購買第i個資產(chǎn)的額度,i可表示從1到n
目標(biāo)函數(shù)? ? ?收益“最大”,風(fēng)險“最小”

約束條件? ?資產(chǎn)額度

多目標(biāo)優(yōu)化問題的標(biāo)準(zhǔn)形式

多目標(biāo)優(yōu)化的算法
1、目標(biāo)達(dá)成法? ?fgoalattain
設(shè)定一個目標(biāo)解,使其滿足要求
2、最大最小法 fminimax
使最大的函數(shù)最小,其余的函數(shù)也自然足夠小
3、權(quán)重法
設(shè)置權(quán)重,化為單目標(biāo)優(yōu)化問題
當(dāng)使用不同的權(quán)重時,會有不同的有效解
pareto前沿
4、基于種群的啟發(fā)式算法
GA、PSO
目標(biāo)達(dá)成法

fgoalattain - 求解涉及多目標(biāo)的目標(biāo)達(dá)到問題
? ? fgoalattain 求解目標(biāo)達(dá)到問題,這是多目標(biāo)優(yōu)化問題最小化的一種表示。
? ? x = fgoalattain(fun,x0,goal,weight)
? ? x = fgoalattain(fun,x0,goal,weight,A,b)
? ? x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq)
? ? x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub)
? ? x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon)
? ? x = fgoalattain(fun,x0,goal,weight,A,b,Aeq,beq,lb,ub,nonlcon,options)
? ? x = fgoalattain(problem)
? ? [x,fval] = fgoalattain(___)
? ? [x,fval,attainfactor,exitflag,output] = fgoalattain(___)
? ? [x,fval,attainfactor,exitflag,output,lambda] = fgoalattain(___)

A = [-0.5,0,0;0 -2 10;0 1 -2];
B = [1 0;-2 2;0 1];
C = [1 0 0;0 0 1];
myfun = @(K)sort(eig(A+B*K*C));
K0 = [0,0;0,0];
goal = [-5;-3;-1];
weight = abs(goal);
lb = -4*ones(size(K0));
ub = 4*ones(size(K0));
options = optimoptions('fgoalattain','Display','iter','PlotFcn','optimplotx','UseParallel',true);
[x,fvals,attainfactor] = fgoalattain(myfun,K0,goal,weight,[],[],[],[],lb,ub,[],options)
Starting parallel pool (parpool) using the 'Processes' profile ...
Connected to the parallel pool (number of workers: 6).
? ? ? ? ? ? ? ? ?Attainment? ? ? ? Max? ? ?Line search? ? ?Directional?
?Iter F-count? ? ? ? factor? ? constraint? ?steplength? ? ? derivative? ?Procedure?
? ? 0? ? ? 6? ? ? ? ? ? ? 0? ? ? ?2.16228? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
? ? 1? ? ?13? ? ? ? ? 1.396? ? ? 0.006823? ? ? ? ? ? 1? ? ? ? ? ?0.847? ? ?
? ? 2? ? ?20? ? ? ? ?0.7369? ? ? ?0.02458? ? ? ? ? ? 1? ? ? ? ? ?-0.62? ? ?
? ? 3? ? ?27? ? ? ?-0.03774? ? ? ? 0.7425? ? ? ? ? ? 1? ? ? ? ? -0.228? ? Hessian modified??
? ? 4? ? ?34? ? ? ? ?0.6944? ? ? 0.001286? ? ? ? ? ? 1? ? ? ? ? ?0.892? ? Hessian modified??
? ? 5? ? ?41? ? ? ? ?0.6688? ? ? 0.007303? ? ? ? ? ? 1? ? ? ? ?-0.0208? ? ?
? ? 6? ? ?48? ? ? ? ?0.6697? ? ?0.0005198? ? ? ? ? ? 1? ? ? ? ?0.00177? ? ?
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
? ?66? ? 484? ? ? ? ?0.8289? ? ? 0.001015? ? ? ? ? ? 1? ? ? ? ? -0.169? ? ?
? ?67? ? 491? ? ? ? ?0.2704? ? ? ? ?2.748? ? ? ? ? ? 1? ? ? ? ?-0.0938? ? Hessian modified??
? ?68? ? 498? ? ? ?-0.07561? ? ? ? 0.4142? ? ? ? ? ? 1? ? ? ? ? -0.091? ? ?
? ?69? ? 505? ? ? ? -0.3449? ? ? ?0.05682? ? ? ? ? ? 1? ? ? ? ?-0.0862? ? ?
Solver stopped prematurely.
fgoalattain stopped because it exceeded the function evaluation limit,
options.MaxFunctionEvaluations = 5.000000e+02.
x =
? ?-1.7926? ? 1.6656
? ? 1.4129? ?-4.0000
fvals =
? ?-5.3070
? ?-4.3241
? ?-0.6614
attainfactor =
? ?-0.0756

fminimax
fminimax - 求解 minimax 約束問題
? ? fminimax 尋找能夠最小化一組目標(biāo)函數(shù)最大值的點。
? ? x = fminimax(fun,x0)
? ? x = fminimax(fun,x0,A,b)
? ? x = fminimax(fun,x0,A,b,Aeq,beq)
? ? x = fminimax(fun,x0,A,b,Aeq,beq,lb,ub)
? ? x = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon)
? ? x = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options)
? ? x = fminimax(problem)
? ? [x,fval] = fminimax(___)
? ? [x,fval,maxfval,exitflag,output] = fminimax(___)
? ? [x,fval,maxfval,exitflag,output,lambda] = fminimax(___)

myfun = @(x)[2*x(1)^2+x(2)^2-48*x(1)-40*x(2)+304;-x(1)^2-3*x(2)^2;
? ?x(1)+3*x(2)-18;-x(1)-x(2);x(1)+x(2)-8];
x0 = [0;0];
options = optimoptions('fminimax','Display','iter','PlotFcn','optimplotfval','UseParallel',true);
[x,fvals,maxfval,flag] = fminimax(myfun,x0,[],[],[],[],[],[],[],options)
Starting parallel pool (parpool) using the 'Processes' profile ...
Connected to the parallel pool (number of workers: 6).
? ? ? ? ? ? ? ? ? Objective? ? ? ? Max? ? ?Line search? ? ?Directional?
?Iter F-count? ? ? ? ?value? ? constraint? ?steplength? ? ? derivative? ?Procedure?
? ? 0? ? ? 4? ? ? ? ? ? ? 0? ? ? ? ? ?304? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
? ? 1? ? ? 9? ? ?-1.949e-07? ? ? ? ?37.64? ? ? ? ? ? 1? ? ? ?-4.01e-08? ? ?
? ? 2? ? ?14? ? ? ?-0.04824? ? ? ? ? 4.79? ? ? ? ? ? 1? ? ? ? ?-0.0236? ? Hessian modified twice??
? ? 3? ? ?19? ? ? ? 0.08054? ? ? ?0.03317? ? ? ? ? ? 1? ? ? ? ? ?0.707? ? ?
? ? 4? ? ?24? ? ? ? 0.06484? ? ? ?0.02827? ? ? ? ? ? 1? ? ? ? ? -0.111? ? ?
? ? 5? ? ?30? ? ? -0.006252? ? ? ? 0.6573? ? ? ? ? 0.5? ? ? ? ? -0.105? ? ?
? ? 6? ? ?35? ? ? ?-0.01464? ? ? ? 0.4839? ? ? ? ? ? 1? ? ? ? ?-0.0147? ? ?
? ? 7? ? ?40? ? ?-2.215e-05? ? ? 0.000731? ? ? ? ? ? 1? ? ? ? ? ?0.498? ? ?
? ? 8? ? ?45? ? ?-7.379e-10? ? ?2.786e-08? ? ? ? ? ? 1? ? ? ? ? ?0.167? ? Hessian modified??
Local minimum possible. Constraints satisfied.
fminimax stopped because the predicted change in the objective function
is less than the value of the function tolerance and constraints?
are satisfied to within the value of the constraint tolerance.
<stopping criteria details>
x =
? ? 4.0000
? ? 4.0000
fvals =
? ? 0.0000
? -64.0005
? ?-1.9999
? ?-8.0000
? ?-0.0000
maxfval =
? ?2.7124e-08
flag =
? ? ?5

線性最小二乘問題
lsqlin - 求解約束線性最小二乘問題
? ? 具有邊界或線性約束的線性最小二乘求解器。
? ? x = lsqlin(C,d,A,b)
? ? x = lsqlin(C,d,A,b,Aeq,beq,lb,ub)
? ? x = lsqlin(C,d,A,b,Aeq,beq,lb,ub,x0,options)
? ? x = lsqlin(problem)
? ? [x,resnorm,residual,exitflag,output,lambda] = lsqlin(___)
? ? [wsout,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq,lb,ub,ws)

lsqnonneg - 求解非負(fù)線性最小二乘問題
? ? 求解以下形式的非負(fù)最小二乘曲線擬合問題
? ? x = lsqnonneg(C,d)
? ? x = lsqnonneg(C,d,options)
? ? x = lsqnonneg(problem)
? ? [x,resnorm,residual] = lsqnonneg(___)
? ? [x,resnorm,residual,exitflag,output] = lsqnonneg(___)
? ? [x,resnorm,residual,exitflag,output,lambda] = lsqnonneg(___)

非線性最小二乘問題
lsqcurvefit - 用最小二乘求解非線性曲線擬合(數(shù)據(jù)擬合)問題
? ? 非線性最小二乘求解器
? ? x = lsqcurvefit(fun,x0,xdata,ydata)
? ? x = lsqcurvefit(fun,x0,xdata,ydata,lb,ub)
? ? x = lsqcurvefit(fun,x0,xdata,ydata,lb,ub,options)
? ? x = lsqcurvefit(problem)
? ? [x,resnorm] = lsqcurvefit(___)
? ? [x,resnorm,residual,exitflag,output] = lsqcurvefit(___)
? ? [x,resnorm,residual,exitflag,output,lambda,jacobian] = lsqcurvefit(___)
x = [0.9 1.5 13.8 19.8 24.1 28.2 35.2 60.3 74.6 81.3];
y = [455.2 428.6 124.1 67.3 43.2 28.1 13.1 -0.4 -1.3 -1.5];
model = @(w,x)w(1)*exp(w(2)*x);
w0 = ?[1;-1];
options = optimoptions('lsqcurvefit','Display','iter','PlotFcn','optimplotfunccount','UseParallel',true);
w = lsqcurvefit(model,w0,x,y,[],[],options)
? ? ??
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Norm of? ? ? First-order?
?Iteration? Func-count? ? ?f(x)? ? ? ? ? step? ? ? ? ? optimality
? ? ?0? ? ? ? ? 3? ? ? ? ? 413105? ? ? ? ? ? ? ? ? ? ? ? ? ?310
Objective function returned Inf; trying a new point...
? ? ?1? ? ? ? ? 6? ? ? ? ? 413105? ? ? ? ? ? ?10? ? ? ? ? ? 310? ? ??
? ? ?2? ? ? ? ? 9? ? ? ? ? 412532? ? ? ? ? ? 0.5? ? ? ? ? ? 644? ? ??
? ? ?3? ? ? ? ?12? ? ? ? ? 412532? ? ? ? ? ? ? 1? ? ? ? ? ? 644? ? ??
? ? ?4? ? ? ? ?15? ? ? ? ? 412077? ? ? ? ? ?0.25? ? ? ? ? ? 924? ? ??
? ? ?5? ? ? ? ?18? ? ? ? ? 409495? ? ? ? ? ? 0.5? ? ? ?8.54e+03? ? ??
? ? ?6? ? ? ? ?21? ? ? ? ? 409495? ? ? ? ? ? ? 1? ? ? ?8.54e+03? ? ??
? ? ?7? ? ? ? ?24? ? ? ? ? 409495? ? ? ? ? ?0.25? ? ? ?8.54e+03? ? ??
? ? ?8? ? ? ? ?27? ? ? ? ? 409495? ? ? ? ?0.0625? ? ? ?8.54e+03? ? ??
? ? ?9? ? ? ? ?30? ? ? ? ? 409490? ? ? ?0.015625? ? ? ?1.97e+04? ? ??
? ? 10? ? ? ? ?33? ? ? ? ? 409399? ? ?0.00390625? ? ? ?5.13e+03? ? ??
? ? 11? ? ? ? ?36? ? ? ? ? 409373? ? ? 0.0078125? ? ? ?1.68e+03? ? ??
? ? 12? ? ? ? ?39? ? ? ? ? 409354? ? ? 0.0078125? ? ? ?1.26e+03? ? ??
? ? 13? ? ? ? ?42? ? ? ? ? 409317? ? ? ?0.015625? ? ? ?1.17e+03? ? ??
? ? 14? ? ? ? ?45? ? ? ? ? 409244? ? ? ? 0.03125? ? ? ?1.17e+03? ? ??
? ? 15? ? ? ? ?48? ? ? ? ? 409098? ? ? ? ?0.0625? ? ? ?1.17e+03? ? ??
? ? 16? ? ? ? ?51? ? ? ? ? 408806? ? ? ? ? 0.125? ? ? ?1.16e+03? ? ??
? ? 17? ? ? ? ?54? ? ? ? ? 408228? ? ? ? ? ?0.25? ? ? ?1.72e+03? ? ??
? ? 18? ? ? ? ?57? ? ? ? ? 407080? ? ? ? ? ? 0.5? ? ? ?2.21e+03? ? ??
? ? 19? ? ? ? ?60? ? ? ? ? 404831? ? ? ? ? ? ? 1? ? ? ? 5.9e+03? ? ??
? ? 20? ? ? ? ?63? ? ? ? ? 400436? ? ? ? ? ? ? 2? ? ? ? 9.5e+03? ? ??
? ? 21? ? ? ? ?66? ? ? ? ? 392000? ? ? ? ? ? ? 4? ? ? ? ? 2e+04? ? ??
? ? 22? ? ? ? ?69? ? ? ? ? 375932? ? ? ? ? ? ? 8? ? ? ?3.03e+04? ? ??
? ? 23? ? ? ? ?72? ? ? ? ? 346359? ? ? ? ? ? ?16? ? ? ?5.79e+04? ? ??
? ? 24? ? ? ? ?75? ? ? ? ? 293519? ? ? ? ? ? ?32? ? ? ?7.83e+04? ? ??
? ? 25? ? ? ? ?78? ? ? ? ? 206806? ? ? ? ? ? ?64? ? ? ?1.17e+05? ? ??
? ? 26? ? ? ? ?81? ? ? ? ?85325.3? ? ? ? ? ? 128? ? ? ?1.41e+05? ? ??
? ? 27? ? ? ? ?84? ? ? ? ?1076.22? ? ? ? 235.794? ? ? ?7.02e+04? ? ??
? ? 28? ? ? ? ?87? ? ? ? ?27.9038? ? ? ? 4.37309? ? ? ?1.16e+04? ? ??
? ? 29? ? ? ? ?90? ? ? ? ?9.50714? ? ? ?0.925607? ? ? ? ? ? 125? ? ??
? ? 30? ? ? ? ?93? ? ? ? ?9.50489? ? ?0.00973978? ? ? ? ? 0.504? ? ??
? ? 31? ? ? ? ?96? ? ? ? ?9.50489? ? 9.32741e-05? ? ? ? 0.00247? ? ??
Local minimum possible.
lsqcurvefit stopped because the final change in the sum of squares relative to?
its initial value is less than the value of the function tolerance.
<stopping criteria details>
w =
? 498.8309
? ?-0.1013
lsqnonlin - 求解非線性最小二乘(非線性數(shù)據(jù)擬合)問題
? ? 非線性最小二乘求解器
? ? x = lsqnonlin(fun,x0)
? ? x = lsqnonlin(fun,x0,lb,ub)
? ? x = lsqnonlin(fun,x0,lb,ub,options)
? ? x = lsqnonlin(problem)
? ? [x,resnorm] = lsqnonlin(___)
? ? [x,resnorm,residual,exitflag,output] = lsqnonlin(___)
? ? [x,resnorm,residual,exitflag,output,lambda,jacobian] = lsqnonlin(___)


myfun = @(x)[3*x(1)^2+2*x(1)*x(2)+2*x(2)^2+x(3)+3*x(4)-6;2*x(1)^2+x(1)+x(2)^2+10*x(3)+2*x(4)-2;
? ?3*x(1)^2+x(1)*x(2)+2*x(2)^2+2*x(3)+9*x(4)-9;x(1)^2*3*x(2)^2+2*x(3)+3*x(4)-3];
x0 = ?[0;0;0;0];
options = optimoptions('lsqnonlin','Display','iter','PlotFcn','optimplotfunccount','UseParallel',true,"StepTolerance",1e-14,"FunctionTolerance",1e-14,"MaxFunctionEvaluations",4e3);
x = lsqnonlin(myfun,x0,[],[],options)
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Norm of? ? ? First-order?
?Iteration? Func-count? ? ?f(x)? ? ? ? ? step? ? ? ? ? optimality
? ? ?0? ? ? ? ? 5? ? ? ? ? ? ?130? ? ? ? ? ? ? ? ? ? ? ? ? ?112
? ? ?1? ? ? ? ?10? ? ? ? ? ? ?130? ? ? ? ? ? ?10? ? ? ? ? ? 112? ? ??
? ? ?2? ? ? ? ?15? ? ? ? ? ? ?130? ? ? ? ? ? 2.5? ? ? ? ? ? 112? ? ??
? ? ?3? ? ? ? ?20? ? ? ? ?22.1692? ? ? ?0.833678? ? ? ? ? ? ?23? ? ??
? ? ?4? ? ? ? ?25? ? ? ? ?10.1113? ? ? ? ? ?1.25? ? ? ? ? ?28.1? ? ??
? ? ?5? ? ? ? ?30? ? ? ? ?10.1113? ? ? ? ? ? 2.5? ? ? ? ? ?28.1? ? ??
? ? ?6? ? ? ? ?35? ? ? ? ?3.73635? ? ? ? ? 0.625? ? ? ? ? ?15.6? ? ??
? ? ?7? ? ? ? ?40? ? ? ? ?3.73635? ? ? ? ?1.1494? ? ? ? ? ?15.6? ? ??
? ? ?8? ? ? ? ?45? ? ? ? ?1.20046? ? ? ?0.287351? ? ? ? ? ?4.12? ? ??
? ? ?9? ? ? ? ?50? ? ? ? 0.786275? ? ? ?0.574702? ? ? ? ? ?5.61? ? ??
? ? 10? ? ? ? ?55? ? ? ? 0.238445? ? ? ? 0.39581? ? ? ? ? ?3.74? ? ??
? ? 11? ? ? ? ?60? ? ? ? 0.238445? ? ? ?0.574702? ? ? ? ? ?3.74? ? ??
? ? 12? ? ? ? ?65? ? ? ? 0.110943? ? ? ?0.143676? ? ? ? ? 0.484? ? ??
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
? ?106? ? ? ? 535? ? ? ?0.0767115? ? ?1.3702e-07? ? ? ?2.08e-06? ? ??
? ?107? ? ? ? 540? ? ? ?0.0767115? ? ?1.3702e-07? ? ? ?1.46e-06? ? ??
? ?108? ? ? ? 545? ? ? ?0.0767115? ? ?1.3702e-07? ? ? ?1.66e-06? ? ??
? ?109? ? ? ? 550? ? ? ?0.0767115? ? ?1.3702e-07? ? ? ?1.16e-06? ? ??
? ?110? ? ? ? 555? ? ? ?0.0767115? ? ?1.3702e-07? ? ? ?1.32e-06? ? ??
? ?111? ? ? ? 560? ? ? ?0.0767115? ? ?1.3702e-07? ? ? ?9.21e-07? ? ??
Local minimum found.
Optimization completed because the size of the gradient is less than
the value of the optimality tolerance.
<stopping criteria details>
x =
? ? 0.7034
? ? 0.8992
? ?-0.1727
? ? 0.6292
>> myfun(x)
ans =
? ? 0.0814
? ? 0.0331
? ? 0.0514
? ?-0.2576

非線性方程(組)
fzero - 非線性函數(shù)的根
? ? 此 MATLAB 函數(shù) 嘗試求出 fun(x) = 0 的點 x。此解是 fun(x) 變號的位置 - fzero 無
? ? 法求函數(shù)(例如 x^2)的根。
? ? x = fzero(fun,x0)
? ? x = fzero(fun,x0,options)
? ? x = fzero(problem)
? ? [x,fval,exitflag,output] = fzero(___)
fsolve - 對非線性方程組求解
? ? 非線性方程組求解器
? ? x = fsolve(fun,x0)
? ? x = fsolve(fun,x0,options)
? ? x = fsolve(problem)
? ? [x,fval] = fsolve(___)
? ? [x,fval,exitflag,output] = fsolve(___)
? ? [x,fval,exitflag,output,jacobian] = fsolve(___)
線性規(guī)劃問題
linprog - 求解線性規(guī)劃問題
? ? 非線性規(guī)劃求解器
? ? x = linprog(f,A,b)
? ? x = linprog(f,A,b,Aeq,beq)
? ? x = linprog(f,A,b,Aeq,beq,lb,ub)
? ? x = linprog(f,A,b,Aeq,beq,lb,ub,options)
? ? x = linprog(problem)
? ? [x,fval] = linprog(___)
? ? [x,fval,exitflag,output] = linprog(___)
? ? [x,fval,exitflag,output,lambda] = linprog(___)

混合整數(shù)規(guī)劃
有的決策變量可以取整數(shù),有的決策變量可以取連續(xù)值
intlinprog - 混合整數(shù)線性規(guī)劃 (MILP)
? ? 混合整數(shù)線性規(guī)劃求解器。
? ? x = intlinprog(f,intcon,A,b)
? ? x = intlinprog(f,intcon,A,b,Aeq,beq)
? ? x = intlinprog(f,intcon,A,b,Aeq,beq,lb,ub)
? ? x = intlinprog(f,intcon,A,b,Aeq,beq,lb,ub,x0)
? ? x = intlinprog(f,intcon,A,b,Aeq,beq,lb,ub,x0,options)
? ? x = intlinprog(problem)
? ? [x,fval,exitflag,output] = intlinprog(___)


f = [8 1];
intcon = 2;
A = [-1 -2;-4 -1;2 1];
b = [14;-33;20];
x = intlinprog(f,intcon,A,b)
LP:? ? ? ? ? ? ? ? Optimal objective value is 59.000000.? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
Optimal solution found.
Intlinprog stopped at the root node because the objective value is within a gap tolerance of the optimal
value, options.AbsoluteGapTolerance = 0 (the default value). The intcon variables are
integer within tolerance, options.IntegerTolerance = 1e-05 (the default value).
x =
? ? 6.5000
? ? 7.0000
二次規(guī)劃問題

quadprog - 二次規(guī)劃
? ? 具有線性約束的二次目標(biāo)函數(shù)的求解器。
? ? x = quadprog(H,f)
? ? x = quadprog(H,f,A,b)
? ? x = quadprog(H,f,A,b,Aeq,beq)
? ? x = quadprog(H,f,A,b,Aeq,beq,lb,ub)
? ? x = quadprog(H,f,A,b,Aeq,beq,lb,ub,x0)
? ? x = quadprog(H,f,A,b,Aeq,beq,lb,ub,x0,options)
? ? x = quadprog(problem)
? ? [x,fval] = quadprog(___)
? ? [x,fval,exitflag,output] = quadprog(___)
? ? [x,fval,exitflag,output,lambda] = quadprog(___)
? ? [wsout,fval,exitflag,output,lambda] = quadprog(H,f,A,b,Aeq,beq,lb,ub,ws)

H = [1 -1; -1 2];?
f = [-2; -6];
A = [1 1; -1 2; 2 1];
b = [2; 2; 3];
[x,fval,exitflag,output,lambda] = quadprog(H,f,A,b)
Minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in?
feasible directions, to within the value of the optimality tolerance,
and constraints are satisfied to within the value of the constraint tolerance.
<stopping criteria details>
x =
? ? 0.6667
? ? 1.3333
fval =
? ?-8.2222
exitflag =
? ? ?1
output =?
? 包含以下字段的 struct:
? ? ? ? ? message: 'Minimum found that satisfies the constraints.??Optimization completed because the objective function is non-decreasing in ?feasible directions, to within the value of the optimality tolerance,?and constraints are satisfied to within the value of the constraint tolerance.??<stopping criteria details>??Optimization completed: The relative dual feasibility, 2.254493e-13,?is less than options.OptimalityTolerance = 1.000000e-08, the complementarity measure,?7.525735e-13, is less than options.OptimalityTolerance, and the relative maximum constraint?violation, 5.033011e-15, is less than options.ConstraintTolerance = 1.000000e-08.'
? ? ? ? ? algorithm: 'interior-point-convex'
? ? ? firstorderopt: 1.3527e-12
? ? constrviolation: 1.7764e-15
? ? ? ? ?iterations: 4
? ? ? ?linearsolver: 'dense'
? ? ? ?cgiterations: []
lambda =?
? 包含以下字段的 struct:
? ? ineqlin: [3×1 double]
? ? ? eqlin: [0×1 double]
? ? ? lower: [2×1 double]
? ? ? upper: [2×1 double]