Can I get the code for Economic Load Dispatch using Gradient Descent (matlab)?

조회 수: 17 (최근 30일)
Suzzane M
Suzzane M 2020년 6월 23일
편집: mahesh kumar 2020년 6월 29일
I'm not getting how to proceed after this!!
clc
a=[500;400;200];
b=[5.31;5.5;5.8];
g=[0.004;0.005;0.009];
lambda=input('enter vvalue of lambda');
iter=0;
Pd=800;
n=length(a);
delP=5;tcost=0;
tolerance=0.0001;
while abs(delP)>tolerance
iter=iter+1;
x=0;
for i=1:n
p(i)=(lambda-b(i))/(2*g(i));
x=x+(1/(2*g(i)));
cost=(a(i)+(b(i)*p(i))+(g(i)*p(i)*p(i)));
  댓글 수: 11
mahesh kumar
mahesh kumar 2020년 6월 27일
편집: mahesh kumar 2020년 6월 27일
try this::
B = [.00003 0 0;0 .00009 0 ; 0 0 .00012]; dB=diag(B); load=850;
x=max(b); dP=1;i=0;
z=randperm(10000,length(b))'; P=load*z/sum(z);
while abs(dP)>0.000001
i=i+1; disp(i);
dP=load+P'*B*P-sum(P); % loss=P'*B*P;
x=x+dP*2/(sum(1./a));
P=(x-b-2*(B*P-dB.*P))./(2*a+2*x*dB);
% plot(x,P,'x'); hold on; pause(1);
% C=c+b.*P+a.*P.*P;
% plot(x,sum(C)/100,'o');
end
Suzzane M
Suzzane M 2020년 6월 28일
Yes, it solves my problem. Thankyou so much for the help. Was badly stuck in for days. Fianlly got some clarity. Thankyou again

댓글을 달려면 로그인하십시오.

답변 (1개)

mahesh kumar
mahesh kumar 2020년 6월 29일
편집: mahesh kumar 2020년 6월 29일

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by