From f35ea80659b6a49d1bb2ce1d7d002583f3f40947 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:38:01 +0530 Subject: updated the code --- 3434/CH14/EX14.7/Ex14_7.sce | 49 +++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 26 deletions(-) (limited to '3434/CH14/EX14.7/Ex14_7.sce') diff --git a/3434/CH14/EX14.7/Ex14_7.sce b/3434/CH14/EX14.7/Ex14_7.sce index c3edd8ba7..21f42aa8c 100644 --- a/3434/CH14/EX14.7/Ex14_7.sce +++ b/3434/CH14/EX14.7/Ex14_7.sce @@ -1,26 +1,23 @@ -clc -//given data -i=12/100.0 // interest rate -n=10 // time in years - -time=100.0 // days geyser is used in year -effi=0.9 // efficiency of geyser -w=100.0 // weight of water in kg -C=4.2 // heat capacity in kJ/kg-degree C -theta=60-15 // temperature difference in C -cost=4 // cost of electricity per kWh - -Elec=(1/effi)*w*C*theta/3600.0 // electricity used in kWh/day - - - -A=Elec*time*cost // annual saving in Rs - -P=A*(((1+i)**n)-1)/(i*((1+i)**n)) // final amount in rs - -printf("The final amount after 10 years is Rs %i",P) - -// the answer is slightly different in textbook due to approximation while in scilab answers are precise -end - - +clc +//given data +i=12/100.0 // interest rate +n=10 // time in years + +time=100.0 // days geyser is used in year +effi=0.9 // efficiency of geyser +w=100.0 // weight of water in kg +C=4.2 // heat capacity in kJ/kg-degree C +theta=60-15 // temperature difference in C +cost=4 // cost of electricity per kWh + +Elec=(1/effi)*w*C*theta/3600.0 // electricity used in kWh/day + + + +A=Elec*time*cost // annual saving in Rs + +P=A*(((1+i)**n)-1)/(i*((1+i)**n)) // final amount in rs + +printf("The final amount after 10 years is Rs %i",P) + +// the answer is slightly different in textbook due to approximation while in scilab answers are precise \ No newline at end of file -- cgit