This code takes user input for the number of generators, demand value, and incremental value. It then inputs coefficients for each generator's quadratic cost function. It finds the maximum startup time among the generators and displays it. It then iteratively adjusts the dispatch time by the incremental value, calculates the total power output using each generator's cost function, and compares to the demand value. When total power equals demand, it displays the optimal dispatch time.
This code takes user input for the number of generators, demand value, and incremental value. It then inputs coefficients for each generator's quadratic cost function. It finds the maximum startup time among the generators and displays it. It then iteratively adjusts the dispatch time by the incremental value, calculates the total power output using each generator's cost function, and compares to the demand value. When total power equals demand, it displays the optimal dispatch time.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
n=input('Enter no.
Generators') Pd=input('Enter Demand') l=input('Enter Incremental Value') for i=1:n a(i)=input('enter ai') b(i)=input('enter bi') c(i)=input('enter ci') end t=1 for i=1:n disp(b(i)) if b(i)>t t=b(i) end end disp(t) P=0 t=t+1 while P~=Pd P=0 for i=1:n Pg(i)=(t-b(i))/(2*a(i)) P=P+Pg(i) end if P<Pd t=t+l end if P>Pd t=t-l end end if P==Pd disp(t) end