You are on page 1of 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

You might also like