How to solve Langrage Multiplier

3 views (last 30 days)
nazrin mokhtar
nazrin mokhtar on 24 Apr 2020
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 ])

Answers (0)

Community Treasure Hunt

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

Start Hunting!