You are on page 1of 1

C:\Documents and Settings\s.a\Desktop\Lambda_eld.

m March 17, 2008

Page 1 2:07:20 PM

%Script M-file Lambda_eld n=3; disp('Number of Default Generating Units disp('Please Modify Number of Generating Demand=input('Demanded Power:'); p=zeros(1,n); sigma_p=0; delta_sigma_p=Demand-sigma_p; C=[0.004 5.3 500;0.006 5.5 400;0.009 5.8 ed according to new system and should be Alf=C(:,1);Bet=C(:,2);Gam=C(:,3);

Is:3') Units If Other Than 3 units');

200];%an example,it can be modifi a n*n matrix

IC=5;%primitive estimated Lambda step=0.1;%value which is added to or reduced from lamda in each iteration while abs(delta_sigma_p) >=0.001 for t=1:n p(t)=(IC-Bet(t))/(2*Alf(t)); end sigma_p=sum(p); if sigma_p < Demand IC=IC+step; else if sigma_p > Demand

else end end end p=p'; Lambda=IC Cost_P=zeros(n,1); Total_Cost=sum(Cost_P) bn=[1:1:n]'; disp(' unit Generation') disp(' number (MW) ') disp(' ------------------') outcoming=[bn p]; clear n disp(outcoming)

You might also like