summaryrefslogtreecommitdiff
path: root/23/CH5/EX5.5
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:38:01 +0530
committerprashantsinalkar2017-10-10 12:38:01 +0530
commitf35ea80659b6a49d1bb2ce1d7d002583f3f40947 (patch)
treeeb72842d800ac1233e9d890e020eac5fd41b0b1b /23/CH5/EX5.5
parent7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (diff)
downloadScilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.gz
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.bz2
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.zip
updated the code
Diffstat (limited to '23/CH5/EX5.5')
-rwxr-xr-x23/CH5/EX5.5/Example_5_5.sce65
1 files changed, 34 insertions, 31 deletions
diff --git a/23/CH5/EX5.5/Example_5_5.sce b/23/CH5/EX5.5/Example_5_5.sce
index b711fd6fe..4b14f2c03 100755
--- a/23/CH5/EX5.5/Example_5_5.sce
+++ b/23/CH5/EX5.5/Example_5_5.sce
@@ -1,32 +1,35 @@
-clear;
-clc;
-
-//Example 5.5
-//Caption : Program to Find the Rate of Heat Transfer and Entropy
-
-//Given Values
-
-//Gas A
-rn_A=1;//rate[mol/s]
-T_A=600;//[K]
-
-//Gas B
-rn_B=2;//rate[mol/s]
-T_B=450;//[K]
-
-//product
-rn=rn_A+rn_B;//[mol/s]
-T=400;//[K]
-R=8.314;
-Cp=(7/2)*R;
-T_s=300;//Temperature[K]
-
-//By equation (2.30) rQ=rn*H-rn_A*H_A-rn_B*H_B=rn_A(H-H_A)+rn_B*(H-H_B) Rate of heat transfer
-rQ=(rn_A*Cp*(T-T_A))+(rn_B*Cp*(T-T_B));//[J/s] or [W]
-//By eqn (5.22) rSg=rn*S-(rn_A*S_A)-(rn_B*S_B)-(rQ/T_s) rate of entropy generation for the process
-rSg=approx((rn_A*Cp*log(T/T_A))+(rn_B*Cp*log(T/T_B))-(rQ/T_s),3);//[J/K/s]
-
-disp('J/s or W',rQ,'Rate of heat transfer')
-disp('J/K/s',rSg,'Rate of entropy generation')
-
+clear;
+clc;
+function[A]=approx(V,n)
+ A=round(V*10^n)/10^n;//V-Value n-To what place
+ funcprot(0)
+endfunction
+//Example 5.5
+//Caption : Program to Find the Rate of Heat Transfer and Entropy
+
+//Given Values
+
+//Gas A
+rn_A=1;//rate[mol/s]
+T_A=600;//[K]
+
+//Gas B
+rn_B=2;//rate[mol/s]
+T_B=450;//[K]
+
+//product
+rn=rn_A+rn_B;//[mol/s]
+T=400;//[K]
+R=8.314;
+Cp=(7/2)*R;
+T_s=300;//Temperature[K]
+
+//By equation (2.30) rQ=rn*H-rn_A*H_A-rn_B*H_B=rn_A(H-H_A)+rn_B*(H-H_B) Rate of heat transfer
+rQ=(rn_A*Cp*(T-T_A))+(rn_B*Cp*(T-T_B));//[J/s] or [W]
+//By eqn (5.22) rSg=rn*S-(rn_A*S_A)-(rn_B*S_B)-(rQ/T_s) rate of entropy generation for the process
+rSg=approx((rn_A*Cp*log(T/T_A))+(rn_B*Cp*log(T/T_B))-(rQ/T_s),3);//[J/K/s]
+
+disp('J/s or W',rQ,'Rate of heat transfer')
+disp('J/K/s',rSg,'Rate of entropy generation')
+
//End \ No newline at end of file