//finding mass and energy //Example 15.5(pg 395) clc clear P=25//Output of diesel engine in kW s=12500//calorific value of fuel oil in k-cal/kgm e=0.35//overall efficiency of diesel set P1=P/e//input energy required in 1 hour in kWh P2=P1*860//input energy in kcal m=P2/s//mass of oil needed per hr in kgm w=1000//weight of 1 ton of oil in kgm Eg=(P*w)/m//Energy generated by 1ton of oil in kWh printf('(i)Mass of oil required per hr is %3.3f kgm \n',m) printf('(ii)Eletrical energy generated per ton of fuel is %4.1f Kwh',Eg)