calculate the power and the total cost of generation using lambda iteration method,considering generator limits and inluding transmission losses

37 views
Skip to first unread message

Mohamed Khairi Rafeek

unread,
Dec 3, 2015, 4:13:39 AM12/3/15
to YALMIP
Power demand 120MW
trylagi.m

Johan Löfberg

unread,
Dec 3, 2015, 6:16:49 AM12/3/15
to YALMIP
42mV

Mohamed Khairi Rafeek

unread,
Dec 3, 2015, 7:50:39 AM12/3/15
to YALMIP
what 42mV?

Johan Löfberg

unread,
Dec 3, 2015, 8:03:16 AM12/3/15
to YALMIP
A consistent answer to the question "120MW"

Johan Löfberg

unread,
Dec 3, 2015, 8:03:53 AM12/3/15
to YALMIP
and your question appears off-topic as I don't see any YALMIP code here

Mohamed Khairi Rafeek

unread,
Dec 3, 2015, 9:18:05 AM12/3/15
to YALMIP
i've attached the m-file..

Mohamed Khairi Rafeek

unread,
Dec 3, 2015, 9:18:45 AM12/3/15
to YALMIP
A=[200 180 140];
B=[7 6.3 6.8];
G=[0.008 0.009 0.007];
BL=[0.000218 0.000093 0.000028
    0.000093 0.000228 0.000017
    0.000028 0.000017 0.000179];
Pd=170;
Ng=3;
lambda=7;
dp=10;
dlambda=.01;
Pmin=[10 10 10];
Pmax=[85 80 70];
P=[0 0 0];
while abs(dp) >= .001
    SS=2*BL*P';
        for i=1:Ng;
        for j=1:Ng;
            S(i) = SS(i)-(2*BL(i,j)*P(i));
            P(i)=(lambda*(1-S(i)))-B(i)/2*(G(i)+lambda*BL(i,i));
            if P(i)>Pmax(i)
                P(i)=Pmax(i);
            elseif P(i)<Pmin(i)
                    P(i)=Pmin(i);
                end
        end
        end
    pt=sum(P);
    PL=P(i)*BL(i,j)*P(j);
    for i=Ng;
    dp=P(i)-PL-Pd;
    end
  
    if dp>0
        lambda=lambda-dlambda;
    elseif dp<0
        lambda=lambda+dlambda;
    end
end
Pd
P
lambda
Total_Cost=sum(A+B.*P+G.*P.^2)

Johan Löfberg

unread,
Dec 3, 2015, 12:31:30 PM12/3/15
to YALMIP
You still haven't asked any question, or told us what this has to do with yalmip
Reply all
Reply to author
Forward
0 new messages