#for low loads
p11=20;
p21=30;
t11=.1*p11+20;
t21=.12*p21+16;
#when load is further increased
t24=22;
p24=(t24-16)/.12;
t14=t24;
#upper limit 125MW
p25=125;
t15=1.12*p25+16;
p15=(t15-20)/.1;
n=7;
t21=19.6;
t22=20;
t23=21;
t24=22;
t25=31;
t26=32;
t27=32.5;
p15=110;
p2i=125;
p16=120;
p17=125;
p1i=125;
t2i=20;
for j in range(0,4):
p1j=20;
print"incremental cost(rs./MWhr)\tloading of unit 1(MW) \t loading of unit 2(MW)\ttotal generating power(MW)"
for i in range(0,n):
p2i1=(-16)/.12;
if(21>=31):
p2i=125;
pti=p1i+p2i;
print"\n\t\t\t\t\t\t\t\t",t2i,p1i,p2i,pti
p=180;
p2=(20-16+(180*.1))/(.1+.12);
p1=p-p2;
t=.1*p1+20;
print"loading of unit 1 P1=MW\nthe loading of unit 2 P2=MW\nincremental operating cost =Rs/MWhr",p1,p2,t
import scipy
from scipy import integrate
p11=80;
p12=90;
p21=100;
p22=90;
def fun1(x):
y=.1*x+20
return y
x=284#scipy.integrate.quad(fun1,p11,p12)
def fun2(x):
y=.2*x+6
return y
y=250#scipy.integrate.quad(fun2,p22,p21)
p=x+y;
aS=p*8760;
print"economic loading for unit 1=Rs/hr\neconomic loading for unit 2=Rs/hr\nannual savings=Rs",x,y,aS