diff options
Diffstat (limited to '1919/CH2')
-rwxr-xr-x | 1919/CH2/EX2.1/Ex2_1.sce | 31 | ||||
-rwxr-xr-x | 1919/CH2/EX2.2/Ex2_2.sce | 38 | ||||
-rwxr-xr-x | 1919/CH2/EX2.3/Ex2_3.sce | 31 | ||||
-rwxr-xr-x | 1919/CH2/EX2.4/Ex2_4.sce | 25 | ||||
-rwxr-xr-x | 1919/CH2/EX2.5/Ex2_5.sce | 10 | ||||
-rwxr-xr-x | 1919/CH2/EX2.6/Ex2_6.sce | 10 | ||||
-rwxr-xr-x | 1919/CH2/EX2.7/Ex2_7.sce | 27 | ||||
-rwxr-xr-x | 1919/CH2/EX2.8/Ex2_8.sce | 35 |
8 files changed, 207 insertions, 0 deletions
diff --git a/1919/CH2/EX2.1/Ex2_1.sce b/1919/CH2/EX2.1/Ex2_1.sce new file mode 100755 index 000000000..c1c970383 --- /dev/null +++ b/1919/CH2/EX2.1/Ex2_1.sce @@ -0,0 +1,31 @@ +// Theory and Problems of Thermodynamics
+// Chapter 2
+// First Law of Thermodynamics
+// Example 1
+
+clear ;clc;
+
+//Given data
+// a system is taken from state 1 to state 2 along a path A
+Q_A_21 = 200 //heat energy received in kJ
+W_A_21 = 100 //work done in kJ
+// if the system is taken different path from state 2 to state 1
+W_A_12 = -150 //spend work on system
+// Path C
+Q_C_12 = 0; // for adiabatic Q = 0
+
+
+//Path A
+U_A_21 = Q_A_21 - W_A_21; // U_A_21 = U2 - U1 = Q - W
+
+// determine heat interaction along path B
+U_B_12 = - U_A_21; // U_B_12 = U1 - U2 = -(U2 - U1)
+Q_A_12 = U_B_12 + W_A_12 // U1 - U2 = Q - W
+
+// determine work done on system in surroundings in adiabatic path C
+U_C_12 = U_B_12;
+W_C_12 = Q_C_12 - U_C_12; // work done
+
+// Results
+mprintf('Heat interaction along path B = %3.0f kJ', Q_A_12)
+mprintf('\n The work done on surroundings in adiabatic path B = %3.0f kJ', W_C_12)
diff --git a/1919/CH2/EX2.2/Ex2_2.sce b/1919/CH2/EX2.2/Ex2_2.sce new file mode 100755 index 000000000..53ded0026 --- /dev/null +++ b/1919/CH2/EX2.2/Ex2_2.sce @@ -0,0 +1,38 @@ +// Theory and Problems of Thermodynamics
+// Chapter 2
+// First Law of Thermodynamics
+// Example 2
+
+clear ;clc;
+
+//Given data
+r = 1.4; // r = CP/CV
+P1 = 0.5; // pressure at state 1 in MPa
+T1 = 300; // temperature at state 1 in K
+V_21 = 2; // ratio of V2 and V1
+T2 = T1 * V_21; // temperature at state 2 in K
+T3 = T1; // temperature at state 3 in K
+R = 8.314; // gas constant in J/K
+
+//For reversible adiabatic path
+T_23 = T2 / T3 // T_23 ratio of T2 and T3
+V_32 = T_23 ^ (1/(r-1)); // ratio of V3 and V2
+
+/// Q = Q12 = Q23 = Cp*T1
+Q_A = R * r * T1 / (r -1) // heat interactions for adiabatic path
+Q_A = Q_A / 1000; // units conversion J to kJ
+
+// W = W12 + W23 = R*T1 + Cv*T1 = Cp*T1
+W_A = R * r * T1 / (r -1) // work done for adiabatic path
+W_A = W_A / 1000; // units conversion J to kJ
+
+// for reversible isothermal process
+// W_I = integrate('P','V',3,1) = R*T1*log(V1/V3) = R*T1*ln(V1/V2)*(V2/V3)
+W_I = R * T1 * log(1 / (V_21 * V_32) ); // work for reversible isothermal process
+W_I = W_I / 1000; // units conversion J to kJ
+
+// Results
+mprintf('heat interaction for reversible adiabatic path = %4.2f kJ', Q_A)
+mprintf('\n work done for adiabatic path = %4.2f kJ', W_A)
+mprintf('\n work done for reversible isothermal process = %5.3f kJ', W_I)
+
diff --git a/1919/CH2/EX2.3/Ex2_3.sce b/1919/CH2/EX2.3/Ex2_3.sce new file mode 100755 index 000000000..7ae392664 --- /dev/null +++ b/1919/CH2/EX2.3/Ex2_3.sce @@ -0,0 +1,31 @@ +// Theory and Problems of Thermodynamics
+// Chapter 2
+// First Law of Thermodynamics
+// Example 3
+
+clear ;clc;
+
+//Given data
+T1 = 300 // initial temperature in K
+P1 = 100 // initial pressure in kPa
+I = 3 // current in amperes
+V = 200 // voltage in volts
+t = 60 // time period for flow through resistor in s
+r = 1.4; // CP/CV
+R = 8.314 // gas constant in J/K
+
+// determine work done by the gas and temperature
+// U2-U1 = Q-W = Q-(integrate('P','V') - W_e) = W_e-(integrate('P','V'))
+// W = I * V * t - P*(V2-V1) = I * V * t - R*(T2-T1)
+
+W_e = I * V * t // electrical work done on system
+T2 = T1 + W_e * (r-1)/(R * r); // final temperature
+W = R * (T2 - T1); // work done by gas
+W = W/1000; // units conversion J to kJ
+
+// Results
+mprintf('Final temperature = %5.2f K', T2)
+mprintf('\n Work done by the gas = %5.3f kJ', W)
+
+
+
diff --git a/1919/CH2/EX2.4/Ex2_4.sce b/1919/CH2/EX2.4/Ex2_4.sce new file mode 100755 index 000000000..a06fd2009 --- /dev/null +++ b/1919/CH2/EX2.4/Ex2_4.sce @@ -0,0 +1,25 @@ +// Theory and Problems of Thermodynamics
+// Chapter 2
+// First Law of Thermodynamics
+// Example 4
+
+clear ;clc;
+
+//Given data
+T = 303 // initial temperature in K
+P = 100 // initial pressure in kPa
+V_w = 0.001004 // specific volume for water in m3/kg
+V_v = 1.694910 // specific volume for vapor in m3/kg
+H_w = 125.6 // enthalpy of water in kJ/kg
+H_v = 2675.47 // enthalphy of vapor in kJ/kg
+
+// determine heat and work interactions
+W = P * (V_v - V_w); // work interaction
+del_H = H_v - H_w // enthalpy difference
+Q = del_H //heat interaction
+
+// Results
+mprintf('Work interaction = %7.2f kJ', W)
+mprintf('\n Heat interaction = %5.2f kJ', Q)
+
+
diff --git a/1919/CH2/EX2.5/Ex2_5.sce b/1919/CH2/EX2.5/Ex2_5.sce new file mode 100755 index 000000000..bbb28c77d --- /dev/null +++ b/1919/CH2/EX2.5/Ex2_5.sce @@ -0,0 +1,10 @@ +// Theory and Problems of Thermodynamics
+// Chapter 2
+// First Law of Thermodynamics
+// Example 5
+
+clear ;clc;
+
+//Given data
+
+//the given problem is theoritical and does not involve any numerical computation
diff --git a/1919/CH2/EX2.6/Ex2_6.sce b/1919/CH2/EX2.6/Ex2_6.sce new file mode 100755 index 000000000..dc11660db --- /dev/null +++ b/1919/CH2/EX2.6/Ex2_6.sce @@ -0,0 +1,10 @@ +// Theory and Problems of Thermodynamics
+// Chapter 2
+// First Law of Thermodynamics
+// Example 6
+
+clear ;clc;
+
+//Given data
+
+//the given problem is theoritical and does not involve any numerical computation
diff --git a/1919/CH2/EX2.7/Ex2_7.sce b/1919/CH2/EX2.7/Ex2_7.sce new file mode 100755 index 000000000..0f57b2e59 --- /dev/null +++ b/1919/CH2/EX2.7/Ex2_7.sce @@ -0,0 +1,27 @@ +// Theory and Problems of Thermodynamics
+// Chapter 2
+// First Law of Thermodynamics
+// Example 7
+
+clear ;clc;
+
+//Given data
+T1 = 300 // initial temperature in K
+P1 = 100 // initial pressure in kPa
+P2 = 1.5 // initial pressure in MPa
+r = 1.4 // r = CP/CV
+n = 1.2 //P(V^1.2) = constant
+R = 8.314 // gas constant in J/K
+
+// determine work done and energy transferred as heat
+P2 = P2 * 1000 // units conversion MPa to kPa
+V_12 = (P2/P1)^(1/1.2) //ratio of V1 and V2
+T2 = P2 * T1 / (P1 * V_12) // final temperature in K
+
+W = R * (T1 - T2)/(n-1); // work done on gas
+W = W/1000; // units conversion J to kJ
+Q = (R * (T1-T2)/(r-1))/1000 + W // energy transferred as heat
+
+// Results
+mprintf('Work done on gas = %5.4f kJ', W)
+mprintf('\n Energy transfered as heat = %5.3f kJ', Q)
diff --git a/1919/CH2/EX2.8/Ex2_8.sce b/1919/CH2/EX2.8/Ex2_8.sce new file mode 100755 index 000000000..d0205c58d --- /dev/null +++ b/1919/CH2/EX2.8/Ex2_8.sce @@ -0,0 +1,35 @@ +// Theory and Problems of Thermodynamics
+// Chapter 2
+// First Law of Thermodynamics
+// Example 8
+
+clear ;clc;
+
+//Given data
+V1 = 1 // one compartment volume in m^3
+T1 = 300 // first compartment temperature in K
+P1 = 0.1 // first compartment pressure in MPa
+V2 = 2 // second compartment volume in m^3
+T2 = 1000 // second compartment temperature in K
+P2 = 1 // second compartment pressure in MPa
+R = 8.314 // gas constant in J/K
+del_U = 0; // tank is rigid and insulated W = 0 & Q = 0
+
+// determine final temperature and pressure of gas if the partion between
+// the two compartment is ruptured
+P1 = P1 * 1e6 // units conversion MPa to Pa
+P2 = P2 * 1e6 // units conversion MPa to Pa
+
+N1 = P1 * V1 / (R * T1); // quantity of gas in first compartment
+N2 = P2 * V2 / (R * T2); // quantity of gas in second compartment
+
+T_f = (T1 * N1 + T2 * N2)/ (N1 + N2) //Final state Temperature
+
+P_f = (N1+N2)*R*T_f/(V1+V2); //Final stste Pressure
+P_f = P_f/1000000 // Units conversion Pa to MPa
+
+// Results
+mprintf('Final state Temperature = %3.0f K', T_f)
+mprintf('\n Final state pressure = %2.1f MPa', P_f)
+
+
|