diff options
Diffstat (limited to '3434')
-rw-r--r-- | 3434/CH14/EX14.7/Ex14_7.sce | 49 | ||||
-rw-r--r-- | 3434/CH9/EX9.1.iii/Ex9_1_iii.sce | 48 |
2 files changed, 48 insertions, 49 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 diff --git a/3434/CH9/EX9.1.iii/Ex9_1_iii.sce b/3434/CH9/EX9.1.iii/Ex9_1_iii.sce index 6387a3e1d..5b1af1f5e 100644 --- a/3434/CH9/EX9.1.iii/Ex9_1_iii.sce +++ b/3434/CH9/EX9.1.iii/Ex9_1_iii.sce @@ -1,23 +1,25 @@ -clc
-// given data
-G=39.0 // temperature gradient in K/km.
-h2=10.0 // depth in km
-rhor=2700.0 // kg/m^3
-cr=820.0 // in J/kg-K
-
-h1=120/G // T1-T0=120 K is given
-h21=h2-h1 // in km
-E0byA=(rhor*(1000**3)*G*cr*h21**2)/2 // in J/km^2 Heat content per square km
-
-thetao=G*h21/2.0 // in degree K
-tau=rhor*cr*h21*(1000**3)/(QbyA*rhow*cw) // in seconds
-tau=tau/(2*60*60*24*365) // in years
-theta=thetao*exp(-t/tau) // in degree Kelvin
-
-Heatinitial=E0byA/(60*60*365*24*tau)/1000000 // intial heat extraction rate in MW /km^2
-
-Heat25=Heatinitial*exp(-t/tau) // heat extraction rate after 25 years in MW /km^2
-
-printf( "Initial Heat extraction rate is %.2f MW/km^2",Heatinitial)
-
-printf(" \n Final Heat extraction rate is %.2f MW/km^2",Heat25)
+clc +// given data +G=39.0 // temperature gradient in K/km. +h2=10.0 // depth in km +rhow = 1000; +rhor=2700.0 // kg/m^3 +cr=820.0 // in J/kg-K +cw=4200.0; // specific heat of water in J/kg-K +QbyA=0.5; +h1=120/G // T1-T0=120 K is given +h21=h2-h1 // in km +E0byA=(rhor*(1000**3)*G*cr*h21**2)/2 // in J/km^2 Heat content per square km +t=25 // time in years +thetao=G*h21/2.0 // in degree K +tau=rhor*cr*h21*(1000**3)/(QbyA*rhow*cw) // in seconds +tau=tau/(2*60*60*24*365) // in years +theta=thetao*exp(-t/tau) // in degree Kelvin + +Heatinitial=E0byA/(60*60*365*24*tau)/1000000 // intial heat extraction rate in MW /km^2 + +Heat25=Heatinitial*exp(-t/tau) // heat extraction rate after 25 years in MW /km^2 + +printf( "Initial Heat extraction rate is %.2f MW/km^2",Heatinitial) + +printf(" \n Final Heat extraction rate is %.2f MW/km^2",Heat25)
\ No newline at end of file |