How to solve Langrage Multiplier

1 次查看(过去 30 天)
nazrin mokhtar
nazrin mokhtar 2020-4-24
Why i cannot solve the langrange...it say empty double matrix...please someone help me
SF=[ 0 -2/3 -1/3
0 -1/3 -2/3
0 1/3 -1/3 ];
A=[ 1 0
0 1
0 0 ];
B=[ 0
0
1 ];
PLmax=[ 30
150
150 ];
Cost=[ 10
12
11 ];
syms P1 P2 Pd
Pgen=[ P1
P2];
f=10*P1+12*P2; %obj func
Lmda=Pd-(P1+P2)==0;
Pi1=SF*(A*Pgen-B*Pd)<=PLmax;
Pi2=-SF*(A*Pgen-B*Pd)<=PLmax;
P1,P2>=0;
Pd==150;
Sol=solve ([f,Lmda,Pi1,-Pi2],[ P1 P2 Pd ])

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by