##Ex7.15.1; calculate volume of biogas digester and power available from the digester
##Mass of the dry input
M0=2*5;##M0=2.5 kg/day * 5
pm=50.;##unit=kg/m^3
tr=20.;##retention time in days
C=0.24;##unit=m^3 per kg;Biogas yeild.
n=0.6;##efficiency of burner
Hm=28.;##unit=MJ/m^3##combustion of methane
Fm=0.8;##methane proportional
##Fluid volume Vf is =M0/pm
Vf=M0/pm;
print'%s %.2f %s %.2f %s '%(" Mass of the dry input M0=",M0," kg/day"and " \n Fluid volume Vf=",Vf," m^3 /day");
##for expression Vd=Vftr,the digester volume is
Vd=Vf*tr;
print'%s %.2f %s'%("\n Vd=",Vd," m^3");
##volume of biogas is Vb=C*M0= biogas yield input * mass of dry input
Vb=C*M0;
print'%s %.2f %s'%("\n volume of biogas is Vb=",Vb," m^3 /day");
##The Power available from the digester is
E=n*Hm*Fm*Vb;
print'%s %.2f %s'%("\n The Power available from the digester=",E," Mj/day");
E=E*0.2728;##unit=kWh/day
print'%s %.2f %s'%("=",E," kWh/day");
E=E*41.8##unit=W(continuous thermal)
print'%s %.2f %s'%("=",E," W(continuous thermal)");