economic load dispatch using lambda iteration method

15 views (last 30 days)
hi..can anybody help me to solve this error..i could'nt solve it
the code
%N = iteration count limit
%e = iteration tolerance
%lamda = Lagrange multiplier (Lambda)
%del_lamda = change in lambda
%PD = Power Demand
%Pmin & Pmax = minimum and maximum power limits
n=1; lamda=0; del_lamda=0; e=0.01; P=0;
Psum=0;
m=input('Input total number of thermal unit:')
for k=1:m
disp('plant')
disp(k)
Pmin(k)=input('insert minimum power:')
Pmax(k)=input('insert maximum power:')
end
disp('Input cost coefficients per plant in the form below:')
disp('[alpha1 beta1 gamma1;alpha2 beta2 gamma2;...]')
C=input('Insert Cost Coefficients:')
for k=1:m
P(k)=(lamda-C(k,2))/(2*C(k,3));
if P(k)<Pmin(k)
P(k)=Pmin(k);
elseif P(k)>Pmax(k)
P(k)=Pmax(k);
end
Psum=Psum+P(k);
end
if n>N
disp('Solution non-convergence');
disp('Number of Iterations:')
disp(n-1)
else
Pnet=Psum-PD;
del_lamda=abs(Pnet)/P(k);
if abs(Pnet)<e
disp('final value for lamda:')
disp(lamda)
disp('Power for plants 1 to m:')
disp(P)
disp('number of iterations:')
disp(n)
disp('iteration tolerance:')
disp(e)
elseif Pnet>0
lamda=lamda-del_lamda;
else
lamda=lamda+del_lamda;
end
end
Psum=0;
%n=n+1;
the error

Answers (1)

KALYAN ACHARJYA
KALYAN ACHARJYA on 19 Dec 2020
Here
P(k)=(lamda-C(k,2))/(2*C(k,3));
As per the P(k) statements, you have to pass the C vector size minimum of mx3
Here m=Input total number of thermal unit,as here P access the data of C having minimum 3rd cloumns,e.g
C(k,2) or C(k,3)
Inaddition, may be you did not define the 'N'.
Suggestion: Improvements needed to simplify code, Is there necessity of so many disp function?
Happy Learning!
:)
  3 Comments
syazwan sabri
syazwan sabri on 22 Dec 2020
because i use 15 thermal unit..so how can i solve it.
Abdalrahman Alharthy
Abdalrahman Alharthy on 6 Feb 2023
3. For problem (2), find Using MATLAB M-file program the minimum cost and optimal dispatch of generation when the total demand power is 800 MW if the transmission line losses is expressed as: 0.00014𝑃1 2 + 0.00013𝑃2 2 + 0.00012𝑃3 2 + 0.00011𝑃4 2 Take initial value of  with 8.0 and the acceptance tolerance 10-5 .

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!