diff options
author | prashantsinalkar | 2017-10-10 12:38:01 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:38:01 +0530 |
commit | f35ea80659b6a49d1bb2ce1d7d002583f3f40947 (patch) | |
tree | eb72842d800ac1233e9d890e020eac5fd41b0b1b /3434/CH14/EX14.7/Ex14_7.sce | |
parent | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (diff) | |
download | Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.gz Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.bz2 Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.zip |
updated the code
Diffstat (limited to '3434/CH14/EX14.7/Ex14_7.sce')
-rw-r--r-- | 3434/CH14/EX14.7/Ex14_7.sce | 49 |
1 files changed, 23 insertions, 26 deletions
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 |