summaryrefslogtreecommitdiff
path: root/Thermodynamics_by_C_P_Arora
diff options
context:
space:
mode:
Diffstat (limited to 'Thermodynamics_by_C_P_Arora')
-rw-r--r--Thermodynamics_by_C_P_Arora/10-AVAILABILITY_AND_IRREVERSIBILITY.ipynb484
-rw-r--r--Thermodynamics_by_C_P_Arora/11-THERMODYNAMIC_PROPERTY_RELATIONS.ipynb265
-rw-r--r--Thermodynamics_by_C_P_Arora/12-NON_REACTING_MIXTURES_OF_GASES_AND_LIQUIDS.ipynb325
-rw-r--r--Thermodynamics_by_C_P_Arora/13-PHASE_EQUILIBRIUM_VAPOUR_LIQUID_EQUILIBRIUM_OF_MIXTURES.ipynb319
-rw-r--r--Thermodynamics_by_C_P_Arora/14-CHEMICAL_REACTIONS_AND_COMBUSTION.ipynb423
-rw-r--r--Thermodynamics_by_C_P_Arora/15-CHEMICAL_EQUILIBRIUM.ipynb243
-rw-r--r--Thermodynamics_by_C_P_Arora/2-THERMODYNAMIC_CONCEPTS_AND_THE_ZEROTH_LAW_.ipynb90
-rw-r--r--Thermodynamics_by_C_P_Arora/3-PROPERTIES_OF_A_PURE_SUBSTANCE.ipynb282
-rw-r--r--Thermodynamics_by_C_P_Arora/4-WORK_AND_HEAT.ipynb366
-rw-r--r--Thermodynamics_by_C_P_Arora/5-FIRST_LAW_OF_THERMODYNAMICS_AND_INTERNAL_ENERGY_AND_ENTHALPY.ipynb680
-rw-r--r--Thermodynamics_by_C_P_Arora/6-SECOND_LAW_OF_THERMODYNAMICS_AND_ENTROPY.ipynb676
-rw-r--r--Thermodynamics_by_C_P_Arora/7-COMBINED_FIRST_AND_SECOND_LAWS_APPLICATION_TO_PROCESS.ipynb624
-rw-r--r--Thermodynamics_by_C_P_Arora/8-VAPOUR_CYCLES.ipynb423
-rw-r--r--Thermodynamics_by_C_P_Arora/9-GAS_CYCLES.ipynb395
14 files changed, 5595 insertions, 0 deletions
diff --git a/Thermodynamics_by_C_P_Arora/10-AVAILABILITY_AND_IRREVERSIBILITY.ipynb b/Thermodynamics_by_C_P_Arora/10-AVAILABILITY_AND_IRREVERSIBILITY.ipynb
new file mode 100644
index 0000000..110a136
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/10-AVAILABILITY_AND_IRREVERSIBILITY.ipynb
@@ -0,0 +1,484 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 10: AVAILABILITY AND IRREVERSIBILITY"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.10: FIRST_AND_SECOND_LAW_EFFICIENCY.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// State after reversible adiabatic expansion\n",
+"p2=50; // pressure in kPa\n",
+"s2s=6.4844; s1=6.4844; s2=6.944; // specific entropy in kJ/kg K\n",
+"x2s=0.829; // Quality of steam \n",
+"h2s=2252.6; h1=3256.6; // specific enthalpy in kJ/kg \n",
+"T2=81.33; T0=27; // Temperature in degree celcius\n",
+"ws=h1-h2s; // Reversible adiabatic work\n",
+"wa=831.2; // Actual work output in kJ/kg\n",
+"d_AE=979.1; // Decrease in availability in kJ/LG\n",
+"eff_I=wa/ws; // First law efficiency of turbine\n",
+"eff_II=wa/d_AE; // Second law efficiency of turbine\n",
+"disp ('%',eff_II*100,'Second law efficiency of turbine = ','%',eff_I*100,'First law efficiency of turbine = ');\n",
+"w2srev2=(T2-T0)*(s2-s1); // Negative work\n",
+"w1rev2=ws-w2srev2; // Decrease in availability\n",
+"disp ('kJ/kg',w1rev2,'Dcresase in Availability = ','kJ/kg',w2srev2,'Negative work = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.11: AIR_COMPRESSOR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=100; // Pressure at inlet in kPa\n",
+"T1=30; // Temperature at inlet in degree celcius\n",
+"V1=0; // Velocity at inlet in m/s\n",
+"p2=350; // Pressure at outlet in kPa\n",
+"T2=141; // Temperature at exit in degree celcius\n",
+"V2=90; // Velocity at exit in m/s\n",
+"p0=100; // Pressure of Surroundings in kPa\n",
+"T0=30; // temperature of Surroundings in degree celcius\n",
+"k=1.4; // Index of the Isentropic compression process\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"// (a).Adiabatic or polytropic compression\n",
+"T2s=(T1+273)*(p2/p1)^((k-1)/k); // Temperature after isentropic compression\n",
+"disp ('T2s>T2. Hence there is cooling . Compression is polytropic.','K',T2s,'Temperature after isentropic compression =', '(a).Adiabatic or polytropic compression');\n",
+"// (b).The first law efficiency of the compressor\n",
+"wa=Cpo*(T1-T2)-V2^2/2000; //Actual work of compression\n",
+"wT=(-R*(T1+273)*log (p2/p1))-(V2^2/2000); // Isothermal work\n",
+"eff_Ilaw=wT/wa; // The first law efficiency of the compressor\n",
+"disp ('%',eff_Ilaw,'(b).The first law efficiency of the compressor = ');\n",
+"// (c).Minimum work input & Irreversibility\n",
+"d_AE=(Cpo*(T1-T2))+((T0+273)*((R*log (p2/p1))-(Cpo*log ((T2+273)/(T1+273)))))-V2^2/2000; // decrease in availability\n",
+"wmin=d_AE; // Minimum work input\n",
+"wrev=wmin;\n",
+"I=wrev-wa; // Irreversibility\n",
+"disp ('kJ/kg',I,'Irreversibility =','kJ/kg',wmin,'Minimum work input =','(c).Minimum work input & Irreversibility');\n",
+"// (d).Second law efficiency of the compressor\n",
+"eff_IIlaw=wmin/wa; // Second law efficiency of the compressor\n",
+"disp ('%',eff_IIlaw*100,'(d).Second law efficiency of the compressor =');\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.12: LOST_WORK_AND_SECOND_LAW_EFFICIENCY_OF_VAPOUR_COMPRESSOR_CYCLE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T0=313; // Surroundings temperature in kelvin\n",
+"TL=233; // Refrigerated space temperature in kelvin\n",
+"QL=3.5167; // Refrigeration load in kW\n",
+"// (a).Carnot cycle\n",
+"COPcarnot=TL/(T0-TL); // COP of carnot cycle\n",
+"Wcarnot=QL/COPcarnot; // Work done\n",
+"Q0=QL+Wcarnot; // Heat rejected\n",
+"d_SL=-QL/TL;// Entropy change of refrigerated space\n",
+"d_S0=Q0/T0; //Entropy change of surroundings\n",
+"d_Sgen= d_SL+ d_S0; // Entropy generation\n",
+"disp (COPcarnot,'COP of carnot cycle = ','kW',Wcarnot,'Work done = ','(a).Carnot cycle');\n",
+"printf (' \n Entropy generation = %d \n \n kJ/K s \n',d_Sgen);\n",
+"// (b).Vapour compression cycle\n",
+"// From Freon-12 property table & figure 10.17\n",
+"p1=0.0642; p2=0.9607; // Pressure in MPa\n",
+"h1=169.5; h3=74.5; // specific enthalpy in kJ/kg \n",
+"s1=0.7269; s3=0.2716;// specific entropy in kJ/kg K\n",
+"// By calculations s2=s1 gives the following from property table\n",
+"t2=58.9; // Temperature in degree celcius\n",
+"h2=217.6; // specific enthalpy in kJ/kg \n",
+"// From h4=h3 gives the following from chart\n",
+"h4=h3;\n",
+"x4=0.44; // Quality of vapour\n",
+"s4=0.3195;// specific entropy in kJ/kg K\n",
+"m=QL/(h1-h4); // Mass flow rate of refrigerant\n",
+"W=m*(h2-h1); // Work done of vapour compression cycle\n",
+"COP=QL/W; // COP of vapour compression cycle\n",
+"QH=QL+W; // Heat rejected to surroundings\n",
+"d_SL=-QL/TL;// Entropy change of refrigerated space\n",
+"d_S0=QH/T0; //Entropy change of surroundings\n",
+"d_Sgen= d_SL+ d_S0; // Entropy generation\n",
+"disp (COP,'COP of vapour compression cycle = ','kW',W,'Work done = ','(b).Vapour compression cycle');\n",
+"printf (' \n Entropy generation = %f \n \n kJ/K s \n',d_Sgen);\n",
+"// (c).Difference in work = Lost work of the cycle\n",
+"d_work=W-Wcarnot; // Difference in work\n",
+"LWcycle=QH-T0*QL/TL; // Lost work of the cycle\n",
+"disp ('which is same as Difference in work','kW',LWcycle,'Lost work of the cycle= ','kW',d_work,'Difference in work = ','(c).Difference in work = Lost work of the cycle');\n",
+"// (d).Second Law efficiency of the vapour compression cycle\n",
+"eff_II=COP/COPcarnot; //Second Law efficiency\n",
+"disp ('%',eff_II*100,'(d).Second Law efficiency of the vapour compression cycle = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.1: AVAILABLE_ENERGY.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=100; // Mass of water in kg\n",
+"T0=90; // Initial temperature of water in degree celcius\n",
+"T=30; // temperature of Surroundings in degree celcius\n",
+"C=4.1868; // Specific heat in kJ/kg K\n",
+"AE=m*C*((T0-T)-(T+273)*log ((T0+273)/(T+273))); // Available energy\n",
+"Q=m*C*(T0-T); // Heat supplied\n",
+"UE=Q-AE; // Unavailable energy\n",
+"disp ('kJ',AE,'Available energy =');\n",
+"disp ('kJ',UE,'Unavailable energy = ','kJ',Q,'Heat supplied = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.2: LOSS_OF_AE_DURING_HEAT_TRANSFER_IN_A_BOILER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T=250; // Evaporation teemperature of water in degree celcius\n",
+"Ta=1250; // Initial temperature of combustion gas in degree celcius\n",
+"Tb=350; // Final temperature of combustion gas in degree celcius\n",
+"C=1.08; // Specific heat of gas in kJ/kg K\n",
+"T0=30; // temperature of Surroundings in degree celcius\n",
+"hfg=1716.2; // Enthalpy of evaporation at T temperature\n",
+"del_SH2O=hfg/(T+273); // Entropy change of water\n",
+"mgas=hfg/(C*(Ta-Tb)); // Mass of gas\n",
+"del_Sgas=mgas*C*log ((Tb+273)/(Ta+273)); // Enthalpy change of gas\n",
+"del_Stotal=del_SH2O+del_Sgas; // Total entropy change\n",
+"l_AE=(T0+273)*del_Stotal; // Loss of available energy\n",
+"disp ('kJ',l_AE,'Loss of available energy = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.3: STEAM_POWER_PLANT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"Cp=1.1; // Specific heat of combustion gas in kJ/kg K\n",
+"T3=1600; // Initial temperature of combustion gas in Kelvin\n",
+"T4=1150; // Final temperature of combustion gas in Kelvin\n",
+"p1=0.1; // Pressure at inlet of boiler in MPa\n",
+"p2=8;// Pressure at outlet of boiler in MPa\n",
+"T2=600; // Temperature at outlet of boiler in degree celcius\n",
+"m=1; // Mass of water in kg\n",
+"T0=298; // temperature of Surroundings in kelvin\n",
+"// (b).mass flow rate of gases per kg of water\n",
+"// From steam table \n",
+"h1=2758; h2=3642;// specific enthalpy in kJ/kg \n",
+"s1=5.7432; s2=7.0206; // specific entropy in kJ/kg K\n",
+"mgas=(h2-h1)/(Cp*(T3-T4)); //mass flow rate of gases per kg of water\n",
+"disp ('kg gas / kg water',mgas,'(b).mass flow rate of gases per kg of water =');\n",
+"// (c). Degrease in Available energy\n",
+"S21=s2-s1; // Change in entropy of water\n",
+"S34=mgas*Cp*log (T3/T4); // Change in entropy of gases\n",
+"UEgases=T0*S34; // UnAvailable energy of gas\n",
+"UEsteam=T0*S21; // UnAvailable energy of steam\n",
+"d_AE=UEsteam-UEgases; // Degrease in Available energy\n",
+"disp ('kJ/K',-S34,'Change in entropy of gas = ','kJ/K',S21,'Change in entropy of water = ','(c).');\n",
+"disp ('kJ',UEsteam,'Unavailable energy of steam =','kJ',UEgases,'Unavailable energy of gas = ');\n",
+"disp ('kJ',d_AE,' Degrease in Available energy = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.5: AVAILABLE_ENERGY_IN_EXHAUST_GAS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T=700;// Exhaust gas temperature in degree celcius\n",
+"p=120;// Exhaust gas pressure in kPa\n",
+"Cpo=1.089; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant in kJ/kg K\n",
+"p0=100; // Pressure of Surroundings in kPa\n",
+"T0=30; // temperature of Surroundings in degree celcius\n",
+"Cvo=Cpo-R; // Specific heat at constant volume\n",
+"AE=(Cvo*(T-T0))+(p0*R*((T+273)/p-(T0+273)/p0))-((T0+273)*((Cpo*log((T+273)/(T0+273)))-(R*log (p/p0)))); // Available energy\n",
+"disp ('kJ',AE,'Available energy in Exhaust gas =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.6: IRREVERSIBILITY_OF_THE_PROCESS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=450; // Initial pressure in kPa\n",
+"T=600; // Initial temperature in kelvin\n",
+"V1=0.01; // Initial volume in m^3\n",
+"TR=1200; // Temperature of heat source in Kelvin\n",
+"V2=0.02; // Final volume in m^3\n",
+"p0=100; // Pressure of Surroundings in kPa\n",
+"T0=300; // temperature of Surroundings in kelvin\n",
+"// Useful Work\n",
+"W=p1*V1*log (V2/V1); // Actual work\n",
+"Wsurr=p0*(V2-V1); // Surrounding work\n",
+"Wu=W-Wsurr; // Useful work\n",
+"disp ('kJ',Wu,'Useful Work for the process =');\n",
+"// Reversible work\n",
+"Q=W; // For isothermal process\n",
+"S21=Q/T; // Entropy change of system\n",
+"Wrev=T0*S21-Wsurr+Q*(1-T0/TR); // reversible work\n",
+"disp ('kJ',Wrev,'Reversible work for the provess =');\n",
+"// Irreversibility of the process\n",
+"I=Wrev-Wu; // Irreversibility\n",
+"disp ('kJ',I,'Irreversibility of the process = ');\n",
+"// Entropy generation \n",
+"del_Sgen=S21-Q/TR;//Entropy generation\n",
+"disp ('kJ/kg',del_Sgen,'Entropy generation of the process = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.7: IRREVERSIBILITY_IN_TURBINE_AND_COMPRESSOR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// (i).Irreversibility in Turbine\n",
+"p1=9; // Steam pressure at turbine inlet in MPa\n",
+"T1=450; // Steam temperature at turbine inlet in degree celcius\n",
+"p2=50; // Steam pressure at turbine outlet in MPa\n",
+"x2=0.95; // Quality of steam \n",
+"p0=100; // Pressure of Surroundings in kPa\n",
+"T0=300; // temperature of Surroundings in kelvin\n",
+"q=-10; // Heat loss in kJ/kg\n",
+"// (a).Decrease in availability\n",
+"// from steam table\n",
+"h1=3256.6; h2=2415.4;// specific enthalpy in kJ/kg \n",
+"s1=6.4844; s2=6.944; // specific entropy in kJ/kg K\n",
+"d_AE=(h1-h2)-(T0*(s1-s2)); // Decrease in availability\n",
+"disp ('kJ/kg',d_AE,'(a).Decrease in availability =','(i).Irreversibility in turbine');\n",
+"// (b).Maxximum work output\n",
+"wrev=d_AE; //Maxximum work output\n",
+"disp ('kJ/kg',wrev,'(b).Maxximum work output =');\n",
+"// (c).Actual work output \n",
+"w=(h1-h2)+q; // From SSSF energy equation\n",
+"disp ('kJ/kg',w,'(c).Actual work output = ');\n",
+"// (d).Irreversibility\n",
+"I=wrev-w; //Irreversibility\n",
+"disp ('kJ/kg',I,'(d).Irreversibility = ');\n",
+"// (ii).Ammonia compressor\n",
+"T1=-10; // Temperature at inlet in degree celcius\n",
+"p2=1.554; // Pressure at outlet in MPa\n",
+"T2=140; // Temperature at outlet in degree celcius\n",
+"T0=298; // temperature of Surroundings in kelvin\n",
+"//from ammonia tables \n",
+"h1=1433; h2=1752;// specific enthalpy in kJ/kg \n",
+"s1=5.477; s2=5.655; // specific entropy in kJ/kg K\n",
+"wactual=-(h2-h1); // Actual work\n",
+"wmin=-((h2-h1)-(T0*(s2-s1)));// mimimum work\n",
+"I=wmin-wactual;// Irreversibility\n",
+"disp ('kJ/kg',I,'Irreversibility =','kJ/kg',wmin,'Minimum work =','kJ/kg',wactual,'Actual work = ','(ii).Ammonia compressor');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.8: IRREVERSIBILITY_IN_A_BOILER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"Cp=1.1; // Specific heat of combustion gas in kJ/kg K\n",
+"T3=1600; // Initial temperature of combustion gas in Kelvin\n",
+"T4=1150; // Final temperature of combustion gas in Kelvin\n",
+"p1=0.1; // Pressure at inlet of boiler in MPa\n",
+"p2=8;// Pressure at outlet of boiler in MPa\n",
+"T2=600; // Temperature at outlet of boiler in degree celcius\n",
+"m=1; // Mass of water in kg\n",
+"T0=298; // temperature of Surroundings in kelvin\n",
+"// From steam table \n",
+"h1=2758; h2=3642;// specific enthalpy in kJ/kg \n",
+"s1=5.7432; s2=7.0206; // specific entropy in kJ/kg K\n",
+"mgas=(h2-h1)/(Cp*(T3-T4)); //mass flow rate of gases per kg of water\n",
+"S21=s2-s1; // Change in entropy of water\n",
+"S34=mgas*Cp*log (T3/T4); // Change in entropy of gases\n",
+"// (a).Decrease in availability of gases\n",
+"d_AEgas=mgas*Cp*(T3-T4)-T0*S34//Decrease in availability of gases\n",
+"disp ('kJ',d_AEgas,'(a).Decrease in availability of gases = ');\n",
+"// (b).Decrease in availability of water\n",
+"d_AEwater=(h1-h2)-T0*(s1-s2);// Decrease in availability of water\n",
+"disp ('kJ',d_AEwater,'(b).Decrease in availability of water =');\n",
+"// (c).Reversible work for the process\n",
+"Wrev=d_AEgas+d_AEwater; //Reversible work for the process\n",
+"disp ('kJ',Wrev,'(c).Reversible work for the process=');\n",
+"// (d).Actual work for the process\n",
+"W=0; // Actual work\n",
+"disp ('kJ',W,'(d).Actual work for the process =');\n",
+"// (e).Irreversibility\n",
+"I=Wrev-W; //Irreversibility\n",
+"disp ('kJ',I,'(e).Irreversibility = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.9: LOST_WORK_IN_RANKINE_CYCLE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"TH=600; // Temperature of heat sorce in degree celcius\n",
+"T3=311.06; // Boiler temperature in degree celcius\n",
+"p3=10; // Boiler pressure in MPa\n",
+"T4=32.88; // Condensor temperature in degree celcius\n",
+"p4=5; // Condensor pressure in kPa\n",
+"T0=288;// Temperature of surroundings in kelvin\n",
+"// From steam table and refer figure 10.10 for states\n",
+"h1=137.82; h2=147.82; h3=2724.7; hf4=197.82; hfg4=2423.7; h4=1913.6; // specific enthalpy in kJ/kg \n",
+"s1=0.4764; s2=s1; s3=5.6141; s4=s3; sf4=0.4764; sfg4=7.9187; s4=6.2782; // specific entropy in kJ/kg K\n",
+"wT=h3-h4; // Turbine work\n",
+"wp=h2-h1; // Pump work\n",
+"wnet=wT-wp; // Net work\n",
+"qH=h3-h2; // Heat supplied in boiler\n",
+"qL=h4-h1; // Heat rejected in condensor\n",
+"Wrev_Wpump=T0*(s2-s1); \n",
+"Wrev_Wboiler=T0*(s3-s2)-T0*qH/(TH+273);\n",
+"Wrev_Wturbine=T0*(s4-s3);\n",
+"Wrev_Wcondenser=T0*(s1-s4)+qL;\n",
+"Wrev_Wcycle=Wrev_Wpump+Wrev_Wboiler+Wrev_Wturbine+Wrev_Wcondenser; \n",
+"disp ('kJ/kg',Wrev_Wcycle,'The lost (Wrev-W)for the overall cycle = ','kJ/kg',Wrev_Wcondenser,'The lost (Wrev-W)for the condensor = ','kJ/kg',Wrev_Wturbine,'The lost (Wrev-W)for the Turbine = ','kJ/kg',Wrev_Wboiler,'The lost (Wrev-W)for the Boiler = ','kJ/kg',Wrev_Wpump,'The lost (Wrev-W)for the Pump = ');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/11-THERMODYNAMIC_PROPERTY_RELATIONS.ipynb b/Thermodynamics_by_C_P_Arora/11-THERMODYNAMIC_PROPERTY_RELATIONS.ipynb
new file mode 100644
index 0000000..589b0a3
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/11-THERMODYNAMIC_PROPERTY_RELATIONS.ipynb
@@ -0,0 +1,265 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 11: THERMODYNAMIC PROPERTY RELATIONS"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.1: MERECTS_BOILER_EXPERIMENT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=150; p2=200; p3=250; p4=300; p5=350; p6=400; p7=450; p8=500; p9=550; p10=600; p11=650; p12=700; p13=750; p14=800; p15=850; p16=900; // Pressures of merect's boiler experiment in kPa\n",
+"t1=111.4; t2=120.2; t3=127.4; t4=133.6; t5=138.9; t6=143.6; t7=147.9; t8=151.9; t9=155.5; t10=158.9; t11=162; t12=165; t13=167.8; t14=170.4; t15=173; t16=175.4; // Temperatures of merect's boiler experiment in degree celcius\n",
+"n=16; // Total number of readings taken\n",
+"// Values of constant A & B\n",
+"s_y= log10 (p1*p2*p3*p4*p5*p6*p7*p8*p9*p10*p11*p12*p13*p14*p15*p16);\n",
+"s_x=1/(t1+273)+1/(t2+273)+1/(t3+273)+1/(t4+273)+1/(t5+273)+1/(t6+273)+1/(t7+273)+1/(t8+273)+1/(t9+273)+1/(t10+273)+1/(t11+273)+1/(t12+273)+1/(t13+273)+1/(t14+273)+1/(t15+273)+1/(t16+273);\n",
+"s_xy=((log10 (p1))*1/(t1+273))+ ((log10 (p2))*1/(t2+273))+ ((log10 (p3))*1/(t3+273))+ ((log10 (p4))*1/(t4+273))+ ((log10 (p5))*1/(t5+273))+ ((log10 (p6))*1/(t6+273))+ ((log10 (p7))*1/(t7+273))+ ((log10 (p8))*1/(t8+273))+ ((log10 (p9))*1/(t9+273))+ ((log10 (p10))*1/(t10+273))+ ((log10 (p11))*1/(t11+273)) + ((log10 (p12))*1/(t12+273)) + ((log10 (p13))*1/(t13+273)) + ((log10 (p14))*1/(t14+273)) + ((log10 (p15))*1/(t15+273)) + ((log10 (p16))*1/(t16+273));\n",
+"s_x2=(1/(273+t1))^2+(1/(273+t2))^2+(1/(273+t3))^2+(1/(273+t4))^2+(1/(273+t5))^2+(1/(273+t6))^2+(1/(273+t7))^2+(1/(273+t8))^2+(1/(273+t9))^2+(1/(273+t10))^2+(1/(273+t11))^2+(1/(273+t12))^2+(1/(273+t13))^2+(1/(273+t14))^2+(1/(273+t15))^2+(1/(273+t16))^2;\n",
+"B= ((n*s_xy)-(s_x*s_y))/((n*s_x2)-((s_x)^2)); // Constant B\n",
+"A=((s_y)-(B*s_x))/n; // Constant A\n",
+"disp (B,'B =',A,'A =','Values of constant A & B');\n",
+"// The latent heat of vapourization\n",
+"T=150; // The latent heat of vapourization at this temperature in degree celcius\n",
+"d_T=20; d_p=258.7;// Temperature and pressure difference\n",
+"vg=0.3928; vf=0.0011; // specific volume in m^3/kg\n",
+"hfg=(T+273)*(vg-vf)*d_p/d_T; // Clapeyron equztion\n",
+"disp ('kJ/kg',hfg,'The latent heat of vapourization at 150 oC =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.3: ENTHALPY_CALCULATION_USING_R_K_EQUATION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p5=6000; // Pressure of superheated steam in kPa\n",
+"T5=723.15; // Temperature of superheated steam in kelvin\n",
+"p1=0.6113; // Pressure at reference state in kPa\n",
+"T1=273.16; // Temperature at reference state in kelvin\n",
+"hfg1=2501.3; // Latent heat of vapourization of water at reference state in kJ/kg\n",
+"R_1=8.3143; // Universal gas constant of air in kJ/kmol K\n",
+"// The critical state properties of water\n",
+"pc=2.09; // pressure in MPa\n",
+"Tc=647.3; // Temperature in kelvin\n",
+"h1=0; // Reference state in kJ/kg\n",
+"h2=h1+hfg1; // specific enthalpy in kJ/kg \n",
+"// At point 2\n",
+"p2=p1; T2=T1;\n",
+"z=0.9986;\n",
+"r=18.015;\n",
+"A2=(0.4278/(pc*10^4))*(Tc/T2)^2.5; // Constants\n",
+"B=(0.0867/(pc*10^4))*(Tc/T2); // Constants\n",
+"h2_h3=R_1*(T2/r)*(((-3/2)*(A2/B)*log (1+(B*p2/z)))+z-1); // Enthalpy difference between state 2 & 3\n",
+"// At point 5\n",
+"z1=0.9373;\n",
+"A2=(0.4278/(pc*10^4))*(Tc/T5)^2.5; // Constants\n",
+"B=(0.0867/(pc*10^4))*(Tc/T5); // Constants\n",
+"h5_h4=R_1*(T5/r)*(((-3/2)*(A2/B)*log (1+(B*p5/z1)))+z1-1); // Enthalpy difference between state 5 & 4\n",
+"a=1.6198;b=6.6*10^-4; // Constants\n",
+"h4_h3=a*(T5-T1)+b*(T5^2-T1^2)/2; // Enthalpy difference between state 3 & 4\n",
+"h5=h2-h2_h3+h5_h4+h4_h3; // Specific enthalpy at state 5 \n",
+"disp ('kJ/kg',h5,'Specific enthalpy at state 5 = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.4: ENTHALPY_CALCULATION_FROM_GENERALIZED_CHARTS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T2=373; // Temperature of CO2 gas in kelvin\n",
+"p2=100; // Pressure of CO2 gas in atm\n",
+"T1=0; // Reference state temperature in kelvin\n",
+"// The crictical constants for CO2 are \n",
+"Tc=304.2; // Temperature in kelvin\n",
+"Pc=72.9; // Pressure in atm\n",
+"zc=0.275;\n",
+"// Refer figure 11.7 for state definition\n",
+"h1_0=((-3.74*T2)+((30.53/(100^0.5))*((T2^1.5)/1.5))-((4.1/100)*((T2^2)/2))+((0.024/(100^2))*((T2^3)/3)));\n",
+"Tr=T2/Tc; Pr=p2/Pc; // Reduced properties\n",
+"// From generalized chart figure 11.6\n",
+"hR_Tc=10.09;\n",
+"h1_2=hR_Tc*Tc;\n",
+"M=44; // Molecular weight\n",
+"h10=h1_0/M; h12=h1_2/M;\n",
+"h373=h10-h12; // The required enthalpy of CO2 gas at 373 K and 100 atm\n",
+"disp ('kJ/kg',h373,'The required enthalpy of CO2 gas at 373 K and 100 atm = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.5: CALCULATIONS_FOR_REVERSIBLE_ISOTHERMAL_COMPRESSION_FROM_GENERALIZED_CAHRTS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=11; // Initial pressure in bar\n",
+"T1=40; // Initial temperature in degree celcius\n",
+"p2=60; // Final pressure in bar\n",
+"R_1=8.3143; // Universal gas constant in kJ/kmol K\n",
+"// The crictical properties for natural gas \n",
+"Tc=161; // Temperature in kelvin\n",
+"Pc=46.4; // Pressure in bar\n",
+"// Reduced properties are\n",
+"Pr1=p1/Pc; Pr2=p2/Pc;\n",
+"Tr1=(T1+273)/Tc;\n",
+"// T2=T1, The ideal gas enthalpy h2*=h1*=h1\n",
+"h21=-47.5; // From generalized enthalpy departure chart\n",
+"M=16; // Molecular weight\n",
+"Sp2_1=(R_1/M)*log (p2/p1)// for the difference in ideal gas entropies\n",
+"Sp2_Sp_2=-0.1125; Sp_2_Sp_1=-2.1276; // Entropies in kJ/kg K\n",
+"s2_s1=(Sp2_Sp_2)+(Sp_2_Sp_1);\n",
+"q=(T1+273)*s2_s1; // Heat transfer\n",
+"w=q-h21; // Work of compression\n",
+"disp ('kJ/kg',w,'Work of compression = ','kJ/kg',q,'Heat transfer = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.8: CALCULATIONS_FOR_COOLING_IN_A_THROTTLING_PROCESS_USING_GENERALIZED_CHART.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=10; // Initial pressure in MPa\n",
+"T1=263; // Initial temperature in Kelvin\n",
+"p2=1.5; // Final pressure in MPa\n",
+"R_1=8.3143; // Universal gas constant in kJ/kmol K\n",
+"M=28; // Molecular mass\n",
+"// The crictical properties for nitrogen gas \n",
+"Tc=126.2; // Temperature in kelvin\n",
+"Pc=3.39; // Pressure in MPa\n",
+"// Reduced properties are\n",
+"Pr1=p1/Pc; Pr2=p2/Pc;\n",
+"Tr1=T1/Tc;\n",
+"// From the generalized chart for enthalpy departure at Pr1 & Tr1\n",
+"h_11=8.7*Tc/M;\n",
+"// The solution involves iteration procedure. Assume T2 and check if h2_h1=0\n",
+"// First approximation T2=200 K\n",
+"T2=200; // In K\n",
+"Tr2=T2/Tc;\n",
+"Cpr=1.046;\n",
+"h_21=Cpr*(T2-T1);\n",
+"// From the generalized chart for enthalpy departure at Pr1 & Tr1\n",
+"h_22=1*Tc/M;\n",
+"h2_h1=h_11-T2+T1-h_22;\n",
+"// Second approximation \n",
+"T2=190; // In K\n",
+"Tr2=T2/Tc;\n",
+"Cpr=1.046;\n",
+"h_21=Cpr*(T2-T1);\n",
+"// From the generalized chart for enthalpy departure at Pr1 & Tr1\n",
+"h_22=1.5*Tc/M;\n",
+"h2_h1=h_11-T2+T1-h_22;\n",
+"disp ('Here also h2-h1 != 0. Therefore the temperature is dropping.Thus Joule-Thomson coefficient is positive.There is cooling in this process');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 11.9: CALCULATIONS_OF_LATENT_HEAT_BY_SIMILARITY_METHOD.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"Tcammonia=405.9;\n",
+"Tcwater=647.3;\n",
+"Tr=0.576; // Condition of similarity\n",
+"Twater=Tcwater*Tr; // At reduced temperature Temperature of water\n",
+"Tammonia=Tcammonia*Tr;//At reduced temperature Temperature of ammonia\n",
+"// From steam table at Twater\n",
+"hfgwater=2257;// specific enthalpy in kJ/kg \n",
+"hfgammonia=Tcammonia/Tcwater *hfgwater; // Latent heat of vaporization of ammonia\n",
+"disp ('kJ/kg',hfgammonia,'Latent heat of vaporization of ammonia =');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/12-NON_REACTING_MIXTURES_OF_GASES_AND_LIQUIDS.ipynb b/Thermodynamics_by_C_P_Arora/12-NON_REACTING_MIXTURES_OF_GASES_AND_LIQUIDS.ipynb
new file mode 100644
index 0000000..9ecc9dd
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/12-NON_REACTING_MIXTURES_OF_GASES_AND_LIQUIDS.ipynb
@@ -0,0 +1,325 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 12: NON REACTING MIXTURES OF GASES AND LIQUIDS"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.1: PROPERTIES_OF_DRY_AIR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"M1=28.02; // Molecular mass of N2\n",
+"M2=32; // Molecular mass of O2\n",
+"M3=39.91; // Molecular mass of Ar\n",
+"M4=44; // Molecular mass of CO2\n",
+"M5=2.02; // Molecular mass of H2\n",
+"y1=0.7803; // Part by volume of N2 in dry atmospheric air\n",
+"y2=0.2099; // Part by volume of O2 in dry atmospheric air\n",
+"y3=0.0094; // Part by volume of Ar in dry atmospheric air\n",
+"y4=0.0003; // Part by volume of CO2 in dry atmospheric air\n",
+"y5=0.0001; // Part by volume of H2 in dry atmospheric air\n",
+"R_1=8.3143; // Universal gas constant of air in kJ/kmol K\n",
+"// (a).Average molecular mass and apperent gas constant of dry atmospheric air\n",
+"M=(y1*M1)+(y2*M2)+(y3*M3)+(y4*M4)+(y5*M5); // Average molecular mass\n",
+"R=R_1/M; //Apperent gas constant of dry atmospheric air\n",
+"disp ('kJ/kg K',R,'Apperent gas constant of dry atmospheric air =','kmol',M,'Average molecular mass = ','(a).Average molecular mass and apperent gas constant of dry atmospheric air');\n",
+"// (b).The fraction of each component\n",
+"m1=(M1*y1)/M;//The fraction of N2 component\n",
+"m2=(M2*y2)/M;//The fraction of O2 component\n",
+"m3=(M3*y3)/M;//The fraction of Ar component\n",
+"m4=(M4*y4)/M;//The fraction of CO2 component\n",
+"m5=(M5*y5)/M;//The fraction of H2 component\n",
+"disp (m5,m4,m3,m2,m1,'(b).The fraction of N2,O2,Ar,CO2,H2 components are given below respectively ');\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.2: EXHAUST_GAS_ANALYSIS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"M1=44; // Molecular mass of CO2\n",
+"M2=32; // Molecular mass of O2\n",
+"M3=28; // Molecular mass of CO\n",
+"M4=28; // Molecular mass of N2\n",
+"y1=0.1; // Part by volume of CO2 in exhaust gas\n",
+"y2=0.06; // Part by volume of O2 in exhaust gas\n",
+"y3=0.03; // Part by volume of CO in exhaust gas\n",
+"y4=0.81; // Part by volume of N2 in exhaust gas\n",
+"R_1=8.3143; // Universal gas constant in kJ/kmol K\n",
+"// (a).Average molecular mass and apperent gas constant of exhaust gas\n",
+"M=(y1*M1)+(y2*M2)+(y3*M3)+(y4*M4); // Average molecular mass\n",
+"R=R_1/M; //Apperent gas constant of dry atmospheric air\n",
+"disp ('kJ/kg K',R,'Apperent gas constant of dry atmospheric air =','kmol',M,'Average molecular mass = ','(a).Average molecular mass and apperent gas constant of exhaust gas');\n",
+"// (b).The fraction of each component\n",
+"m1=(M1*y1)/M;//The fraction of CO2 component\n",
+"m2=(M2*y2)/M;//The fraction of O2 component\n",
+"m3=(M3*y3)/M;//The fraction of CO component\n",
+"m4=(M4*y4)/M;//The fraction of N2 component\n",
+"disp (m4,m3,m2,m1,'(b).The fraction of CO2,O2,CO,N2 components are given below respectively ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.3: MINIMUM_WORK_OF_SEPARATION_OF_GASES.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"y1=0.79; // Volume of Nitrogen in 1 kg of air\n",
+"y2=0.21; // Volume of Oxygen in 1 kg of air\n",
+"R_1=8.3143; // Universal gas constant of air in kJ/kmol K\n",
+"T0=298; // temperature of Surroundings in kelvin\n",
+"del_Sgen=-R_1*((y1*log (y1))+(y2*log (y2))); //Entropy generation\n",
+"LW=T0*del_Sgen; // Minimum work\n",
+"disp ('kJ/kmmol K',LW,'The minimum work required for separation of two gases = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.4: MEASUREMENT_OF_HUMIDITY.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"DPT=8; // Dew point temperature in degree celcius\n",
+"p=100; // Pressure of air in kPa\n",
+"T=25; // Temperature of air in degree celcius\n",
+"// (a).partial pressure of water vapour in air\n",
+"pv=1.0584; // Saturation pressure of water at DBT in kPa\n",
+"disp ('kPa',pv,'(a).partial pressure of water vapour in air = ');\n",
+"// (b).Specific humidity\n",
+"sh=0.622*pv/(p-pv);//Specific humidity\n",
+"disp ('kg of water vapour /kg of dry air',sh,'(b).Specific humidity =');\n",
+"// (c).Relative humidity\n",
+"pg=3.169; // Saturation pressure of water at T in kPa\n",
+"RH=pv/pg; //Relative humidity\n",
+"disp ('%',RH*100,'(c).Relative humidity =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.5: CALCLATIONS_OF_PROPERTIES_FOR_THE_AIR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"DBT=35; // Dry bulb temperature in degree celcius\n",
+"WBT=23; // Wet bulb temperature in degree celcius\n",
+"P=100; // Pressure of air in kPa\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"// (a).Humidity ratio\n",
+"hv=2565.3; // specific enthalpy hg at DBT in kJ/kg \n",
+"hfWBT=96.52; hfgWBT=2443; // specific enthalpy at WBT in kJ/kg \n",
+"PsatWBT=2.789;// Saturation pressure at WBT in kPa\n",
+"shWBT=0.622*PsatWBT/(P-PsatWBT);// specific humidity\n",
+"sh=((Cpo*(WBT-DBT))+(shWBT*hfgWBT))/(hv-hfWBT); // Humidity ratio\n",
+"disp ('kg w.v /kg d.a',sh,'(a).Humidity ratio =');\n",
+"// (b).Relative Humidity\n",
+"pv=sh*P/(0.622+sh); // Partial pressure of water vapour\n",
+"pg=5.628; // Saturation pressure at DBT in kPa\n",
+"RH=pv/pg; //Relative Humidity\n",
+"disp ('%',RH*100,'(b).Relative Humidity =');\n",
+"// (d).Dew point temperature\n",
+"DPT=17.5; // Saturation temperature at pg in degree celcius\n",
+"disp ('oC',DPT,'(d).Dew point temperature =');\n",
+"// (e).Specific volume\n",
+"v=(R*(DBT+273))/(P-pv); // Specific volume\n",
+"disp ('m^3/kg',v,'(e).Specific volume = ');\n",
+"// (d).Enthalpy of air\n",
+"h=(Cpo*DBT)+(sh*hv); //Enthalpy of air\n",
+"disp ('kJ/kg d.a',h,'(d).Enthalpy of air =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.6: COOLING_AND_DEHUMIDIFICATION_OF_MOIST_AIR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"DPT1=30; // Dew point temperature at inlet in degree celcius\n",
+"DPT2=15; // Dew point temperature at outlet in degree celcius\n",
+"RH1=0.50; // Relative humidity at inlet\n",
+"RH2=0.80; // Relative humidity at outlet\n",
+"p=101.325; // Atmospheric pressure in kPa\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"pg1=4.246; // saturation pressure of water at DBT1 in kPa\n",
+"pg2=1.7051; // saturation pressure of water at DBT2 in kPa\n",
+"pv1=RH1*pg1; pv2=RH2*pg2; // Partial pressure of water vapour in air at inlet and outlet\n",
+"sh1=0.622*pv1/(p-pv1); sh2=0.622*pv2/(p-pv2); // Specific humidities at inlet and outlet\n",
+"hv1=2556.3;// specific enthalpy hg at DBT1 in kJ/kg\n",
+"hv2=2528.9;// specific enthalpy hg at DBT2 in kJ/kg\n",
+"hv3=63;// specific enthalpy hf at DBT 2in kJ/kg\n",
+"q=(Cpo*(DPT2-DPT1))+(sh2*hv2)-(sh1*hv1)+((sh1-sh2)*hv3); // Heat transfer\n",
+"disp ('kJ/kg of dry air',q,'Heat removed from the air =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.7: MOLAR_VOLUMES_OF_GAS_MIXTURES.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"y1=0.5; // Molecular mass of CH4 in kmol\n",
+"y2=0.5; // Molecular mass of C3H8 in kmol\n",
+"T=363; // Temperature of gas in kelvin\n",
+"p=5.06; // Pressure of gas in MPa\n",
+"v=0.48; // volume of cylinder in m^3\n",
+"R_1=8.3143; // Universal gas constant of air in kJ/kmol K\n",
+"\n",
+"// (a).Using kay’s rule\n",
+"// let component 1 refer to methane and component 2 to propane\n",
+"// the critical properties\n",
+"Tc1=190.7; Tc2=370; // temperature in kelvin\n",
+"Pc1=46.4; Pc2=42.7; // Pressure in bar\n",
+"// using kay’s rule for the mixture\n",
+"Tcmix=y1*Tc1+y2*Tc2;\n",
+"Pcmix=y1*Pc1+y2*Pc2;\n",
+"// reduced properties\n",
+"Tr=T/Tcmix; Pr=p/Pcmix;\n",
+"// From generalized chart\n",
+"z=0.832;\n",
+"v_1=z*R_1*T/(p*10^3); // molar volume of the mixture\n",
+"d=(v-v_1)/v; // Percentage deviation from actual value\n",
+"disp ('%',d*100,'Percentage deviation from actual value = ','(a).Using kay’s rule');\n",
+"// (b).Using Redlich-Kwong equation of state\n",
+"a1=0.42748*R_1*Tc1^2.5/Pc1;\n",
+"a2=0.42748*R_1*Tc2^2.5/Pc2;\n",
+"b1=0.08664*R_1*Tc1/Pc1;\n",
+"b2=0.08664*R_1*Tc2/Pc2;\n",
+"// Substituting these values in the equation 12.16\n",
+"// And solving these equation by iteration method we get\n",
+"v_1=0.47864;// molar volume of the mixture\n",
+"d=(v-v_1)/v; // Percentage deviation from actual value\n",
+"disp ('%',d*100,'Percentage deviation from actual value = ','(b).Using Redlich-Kwong equation of state');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12.8: FUGACITY_FROM_COMPRESSIBILITY_DATA_OF_A_MIXTURE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"ln_piCH4=-0.0323;\n",
+"pi_CH4=0.9683;\n",
+"p=6895; // Pressure in kPa\n",
+"T=104.4; // Temperature in degree celcius\n",
+"a=0.784;\n",
+"f_CH4=pi_CH4*a*p; // Faguacity\n",
+"disp('kPa',f_CH4,'The Required Faguacity = ');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/13-PHASE_EQUILIBRIUM_VAPOUR_LIQUID_EQUILIBRIUM_OF_MIXTURES.ipynb b/Thermodynamics_by_C_P_Arora/13-PHASE_EQUILIBRIUM_VAPOUR_LIQUID_EQUILIBRIUM_OF_MIXTURES.ipynb
new file mode 100644
index 0000000..2f5b0bc
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/13-PHASE_EQUILIBRIUM_VAPOUR_LIQUID_EQUILIBRIUM_OF_MIXTURES.ipynb
@@ -0,0 +1,319 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 13: PHASE EQUILIBRIUM VAPOUR LIQUID EQUILIBRIUM OF MIXTURES"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.1: CALCULATIONS_FOR_FREON_22_AND_FREON_12_SYSTEM_AS_IDEAL_MIXTURE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// Take freon 22 as component 1 and Freon 12 as component 2\n",
+"// (a). y-x diagram at 40 oC\n",
+"P1sat=15.335; // Saturation pressure of Freon 22 at 40oC in bar\n",
+"P2sat=9.607; // Saturation pressure of Freon 12 at 40oC in bar\n",
+"a=P1sat/P2sat;\n",
+"xset('window',1); // For Plotting y-x Diagram\n",
+"function y1=f(x1)\n",
+" y1=(a*x1)/(1+x1*(a-1)); // y Function\n",
+"endfunction\n",
+"x1=linspace(0,1.0,3); \n",
+"plot (x1,f,x1,x1); // plot comment\n",
+"title ('(a).y-x diagram for the mixture at 40 oC','fontsize',4,'color','blue');\n",
+"xlabel(' x1 ','fontsize',4,'color','blue');\n",
+"ylabel(' y1 ','fontsize',4,'color','blue');\n",
+"legend(['y1';'x1'],[2]);\n",
+"disp ('Refer window 1','(a). y-x diagram at 40 oC');\n",
+"// (b). p-x-y diagram at 40 oC\n",
+" // By using the following relation calculate p value for various value of x1,y1\n",
+" // p=(x1*P1sat)+(1-x1)*P2sat\n",
+"x1=[0,0.2,0.5,0.8,1];\n",
+"y1=[0,0.285,0.615,0.865,1];\n",
+"p=[9.607,10.7526,12.471,14.1894,15.335];\n",
+"xset('window',2);\n",
+"plot (x1,p,y1,p);\n",
+"title ('(b).P-y-x diagram for the mixture at 40 oC','fontsize',4,'color','blue');\n",
+"xlabel(' x1 & y1 ','fontsize',4,'color','blue');\n",
+"ylabel(' p in bar ','fontsize',4,'color','blue');\n",
+"legend(['Liquid out';'Vapour'],[2]);\n",
+"disp ('Refer window 2','(b). p-x-y diagram at 40 oC');\n",
+"// (c).t-x-y diagram at 10 bar\n",
+"// for any value of x1 at p=10 bar, the bubble temperature can be found by trial and error from the following relation\n",
+" // p=10 bar =(x1*P1sat)+(1-x1)*P2sat\n",
+"T1sat=23.7; // Saturation temperature of Freon 22 at 10 bar in oC\n",
+"T2sat=41.6; // Saturation temperature of Freon 12 at 10 bar in oC\n",
+"// Thus, for x1=0.5, we find that t=31 oC. \n",
+"x1=0.5; // Let assume\n",
+"P1sat=12.186; // Saturation pressure of Freon 22 at 31oC in bar\n",
+"P2sat=7.654; // Saturation pressure of Freon 12 at 31oC in bar\n",
+"a=P1sat/P2sat;\n",
+"y1=(a*x1)/(1+x1*(a-1)); // y Function\n",
+"// For different value of x1 the values of t,y1 are calculated by above expression and given below\n",
+"x1=[0,0.5,1]; y1=[0,0.614,1]; t=[41.6,31,23.7];\n",
+"xset('window',3);\n",
+"plot (x1,t,y1,t);\n",
+"title ('(c).t-y-x diagram for the mixture at 10 bar','fontsize',4,'color','blue');\n",
+"xlabel(' x1 & y1 ','fontsize',4,'color','blue');\n",
+"ylabel(' t in oC ','fontsize',4,'color','blue');\n",
+"legend(['f';'g']);\n",
+"disp ('Refer window 3','(c).t-x-y diagram at 10 bar');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.2: CALCULATION_OF_THE_STANDARD_STATE_FUGACITY.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T=573.15; // Temperature of the water with another liquid in kelvin\n",
+"R=8.3144/18; // Characteristic gas constant\n",
+"// (a).4 MPa\n",
+"P_1=10; // By Method II, The lowest possible pressure at which date available in steam table for 300 oC temperature in kPa\n",
+"h_i=3076.5; // Specific enthalphy at P_1 in kJ/kg\n",
+"s_i=9.2813; // Specific entropy at P_1 in kJ/kg K\n",
+"// from superheat table at p=4 MPa and t=300 oC\n",
+"hi=2960.7; // Specific enthalphy in kJ/kg\n",
+"si=6.3615; // Specific entropy in kJ/kg K\n",
+"fi=P_1*exp ((((hi-h_i)/T)-(si-s_i))/R); // Standard state fugacity of water\n",
+"disp ('kPa (round off error)',fi,'Standard state fugacity of water = ','(a).4 MPa');\n",
+"// (b).equal to saturation pressure at 300 oC\n",
+"Psat=8.581; // Saturation pressure at 300 oC in MPa\n",
+"// From steam table at Psat=8.581 MPa and t=300 oC\n",
+"hi=2749; // Specific enthalphy in kJ/kg\n",
+"si=5.7045; // Specific entropy in kJ/kg K\n",
+"fi=P_1*exp ((((hi-h_i)/T)-(si-s_i))/R); // Standard state fugacity of water\n",
+"pisat=fi/(Psat*10^3); // fugacity coefficient\n",
+"disp (pisat,'fugacity coefficient =','kPa',fi,'Standard state fugacity of water = ','(b).Equal to saturation pressure at 300 oC');\n",
+"// (c).10 MPa\n",
+"// Applying Method I \n",
+"viL=0.001404; // Specific volume at 300 oC in m^3/kg\n",
+"fi=pisat*Psat*10^3*exp ((viL*(P_1-Psat)*10^3)/(R*T)); // Standard state fugacity of water\n",
+"disp ('kPa',fi,'Standard state fugacity of water = ','(a).10 MPa');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.3: CALCULATIONS_OF_AMMONIA_WATER_SYSTEM.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// Let take NH3 as component 1 and H2O as component 2\n",
+"// (a) & (b)\n",
+"// Calculation of f1sat = pi1sat*p1sat for ammonia\n",
+"P_1=50; // low reference state pressure in kPa\n",
+"P1sat=614.95; // Saturation Pressure of ammonia at 10 oC in kPa\n",
+"h1sat=1453.3; // Specific enthalpy at 10 oC in kJ/kg\n",
+"s1sat=5.2104; // Specific entropy at 10 oC in kJ/kg K\n",
+"R=8.3144/17; // Characteristic gas constant\n",
+"T=283; // Temperature in kelvin\n",
+"// At 10 oC and P_1=50 kPa for ammonia\n",
+"h_1sat=1499.2; // Specific enthalpy in kJ/kg\n",
+"s_1sat=6.5625; // Specific entropy in kJ/kg K\n",
+"f1sat=P_1*exp ((((h1sat-h_1sat)/T)-(s1sat-s_1sat))/R); // Standard state fugacity of Ammonia\n",
+"disp ('kPa',f1sat,'Standard state fugacity of Ammonia = ','(a) & (b)');\n",
+"// Calculation of f2sat = pi2sat*p2sat for water\n",
+"P2sat=1.2276; // Saturation Pressure at 10 oC in kPa for water\n",
+"pi2sat=1; // At low pressure for water\n",
+"f2sat = pi2sat*P2sat; // Standard state fugacity of water\n",
+"disp ('kPa',f2sat,'Standard state fugacity of water = ');\n",
+"// Calulations of ViL/RT\n",
+"// For ammonia and water at 10 oC\n",
+"v1L=0.001601; v2L=0.001; // Specific volume in m^3/kg\n",
+"v1L_RT=v1L/(R*T); v2L_RT=v2L/(R*T);\n",
+"disp (v2L_RT,'v2L/RT = ','(answer mentioned in the textbook is wrong)',v1L_RT,'v1L/RT = ');\n",
+"// Calculations of activity coefficients\n",
+"// Expression for activity coefficients of ammonia and water become in given by respectively\n",
+"// r_1=(y1*p/(x1*569.6))*exp (-4.34*10^-6*(p-p1sat)); for ammonia\n",
+"// r_2=(y2*p/(x2*1.2276))*exp (-7.65*10^-6*(p-p2sat)); for water\n",
+"// The values thus calculated for r_1,r_2,lny_1,lnr_2 are calculated and plotted in window 1\n",
+"// Note that the values of pyonting factors are negligibly small\n",
+"x1=[0,0.2,0.3,0.4,0.5,0.6,0.8,1.0];\n",
+"y1=[0,0.963,0.986,0.9958,0.9985,0.9993,0.9999,1.0];\n",
+"lnr_1=[-3.1,-1.845,-1.295,-0.75,-0.33,-0.065,-0.035,-0];\n",
+"lnr_2=[0,-0.1397,-0.2767,-0.507,-0.709,-0.952,-1.613,-2.2];\n",
+"// similarly the excess function gE/RT and gE/x1x2RT are also calculated using the following expression respectively\n",
+"// gE_RT=x1*lnr_1+x2*lnr_2; // the excess function from 12.51\n",
+" // gE_x1x2RT=(lnr_1/x2)+(lnr_2/x1);\n",
+"// since gE=0 & x1x2=0 both at x1=0 and x1=1. However its values in between x1=0 & x1=1\n",
+"// By substituting these values in the above expression and given below\n",
+"gE_RT=[0,-0.481,-0.582,-0.604,-0.5195,-0.4198,-0.2925,0];\n",
+"gE_x1x2RT=[-3.1,-2.92,-2.83,-2.74,-2.65,-2.56,-2.38,-2.2];\n",
+"xset('window',1); // For Plotting Diagram\n",
+"plot (x1,lnr_1,'b*-',x1,lnr_2,'g*-',x1,gE_RT,'r',x1,gE_x1x2RT,'k*-');\n",
+"title ('(a)&(b).Activity coefficients for NH3/H2O at 10 oC','fontsize',4,'color','blue');\n",
+"xlabel(' x1 → ','fontsize',4,'color','blue');\n",
+"ylabel(' ln γ → ','fontsize',4,'color','blue');\n",
+"legend(['ln γ1';'ln γ2';'gE/RT';'gE/x1x2 RT'],[4]);\n",
+"disp ('Refer window 1 for plots');\n",
+"// As x1→0,x2→1,gE_x1x2RT→A=ln r_1^∞\n",
+"// As x1→1,x2→0,gE_x1x2RT→B=ln r_2^∞\n",
+"A=-3.1; B=-2.2; // THe Margules constants\n",
+"disp (B,'B = ',A,'A = ','The Margules constants ');\n",
+"disp ('From window 1 for ammonia/water mixture which is characteristic of systems with negative deviation from Roault law. Because γi<=1 and ln γi <=0');\n",
+"// (c).\n",
+"// Assuming ideal vapour phase, and at low pressures we have \n",
+"// y1P=γ1*x1*p1sat; y2p=γ2* x2* p2sat;\n",
+"// Now the activity coefficients can be found from Margules equations and given below\n",
+"x1=[0,0.2,0.3,0.4,0.5,0.6,1.0];\n",
+"y1=[0,0.963,0.986,0.9958,0.9985,0.9999,1.0];\n",
+"p=[1.2276,8.6597,30.6598,54.6845,150.6458,278.1549,614.95];\n",
+"// The ideal solution pressure\n",
+" // PRaoult=x1*P1sat+x2*P2sat;\n",
+"PRaoult=[1.2276,614.95]; x_1=[0,1]; // For Ideal solution pressure\n",
+"xset('window',2); // For Plotting Diagram\n",
+"plot (x1,p,'r*-',y1,p,'b*-',x_1,PRaoult,'g');\n",
+"title ('(c).p-x-y diagram of NH3/H2O at 10 oC','fontsize',4,'color','blue');\n",
+"xlabel(' x1 → & y1 → ','fontsize',4,'color','blue');\n",
+"ylabel(' p, kPa → ','fontsize',4,'color','blue');\n",
+"legend(['p-x1';'p-y1';'PRaoult'],[2]);\n",
+"disp ('For p-x-y diagram refer window 2','(c).')\n",
+"disp ('From window 2 The actual pressure p < pRaoult. It is thus seen that the mixture has negative deviation from Raoults law.');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13.4: ENTHALPY_CALCULATIONS_FOR_NH3_H2O_SYSTEM.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"x1=0.9; // mole fraction of NH3\n",
+"x2=0.1; // Mole fraction of H2O\n",
+"p=490.3; // Pressure in kPa\n",
+"T=280.1; // Temperature in kelvin\n",
+"lam12_11=-2131; lam21_22=-2726; // In kJ/kmol\n",
+"R_1=8.3144; // Universal gas constant in kJ/kmol K\n",
+"// (a).Enthalpy of saturated liquid Mixture at L/B at bubble temperature\n",
+"V1L=0.0016; V2L=0.001; //from properties of NH3 and H2O in m^3/kg\n",
+"a=((V2L*18)/(V1L*17)) * exp (-lam12_11/(R_1*T));\n",
+"b=((V1L*17)/(V2L*18)) * exp (-lam21_22/(R_1*T));\n",
+"d_a=a*(lam12_11/(R_1*T^2)); d_b=b*(lam21_22/(R_1*T^2));\n",
+"d_lnr1=(-(a*x2^2*d_a/(x1+(a*x2))^2))-(x2*d_b/(b*x1+x2))+(b*x1*x2*d_b/(b*x1+x2)^2);\n",
+"d_lnr2=(-b*x1^2*d_b/(b*x1+x2)^2)-(x1*d_a/(x1+a*x2))+(a*x1*x2*d_a/(x1+a*x2)^2);x1=0.728; // By substituting these valuses in equation\n",
+"h_E=-R_1*T^2*(x1*d_lnr1+x2*d_lnr2); // Heat of mixing\n",
+"x1=0.9;\n",
+"M=x1*17+x2*18; // Molecular weight\n",
+"hE=h_E/M; \n",
+"h1L=32.5; h2L=29.4; // in kJ/kg\n",
+"hL=(x1*h1L)+(x2*h2L)+hE;// Specific enthalpy of the liquid mixture\n",
+"disp ('kJ/kg',hL,'Specific enthalpy of the liquid mixture = ','(a).Enthalpy of saturated liquid Mixture at L/B at bubble temperature');\n",
+"// (b).Enthalpy of saturated vapour at V in Equilibrium with liquid at L/B\n",
+"// From property table of ammonia and water at 0 oC\n",
+"T1=273.15; // Temperature in kelvin\n",
+"p1sat=429.4; p2sat=0.6108; // Pressure in kPa\n",
+"hfg1=1262.4; hfg2=2501.4;// specific enthalpy in kJ/kg \n",
+"vg1=0.2895; vg2=206.3; // specific volume in m^3/kg\n",
+"// Referring to fig 13.15 , we have\n",
+"hb1=1262.4; hb2=2501.4;// specific enthalpy in kJ/kg\n",
+"M=17; \n",
+"// The crictical properties \n",
+"Tc1=405.3; Tc2=647.3;// Temperature in kelvin\n",
+"pc1=11.28; pc2=22.09; // Pressure in MPa\n",
+"z1=(p1sat*vg1/(R_1*T1/M)); z2=(p2sat*vg2/(R_1*T/M));\n",
+"A2_1=(0.4278/(pc1*10^3))*(Tc1/T1)^2.5; // Constants\n",
+"B_1=(0.0867/(pc1*10^3))*(Tc1/T1); // Constants\n",
+"h1R=R_1*(T1/M)*(((-3/2)*(A2_1/B_1)*log (1+(B_1*p1sat/z1)))+z1-1);\n",
+"A2_2=(0.4278/(pc2*10^3))*(Tc2/T1)^2.5; // Constants\n",
+"B_2=(0.0867/(pc2*10^3))*(Tc2/T1); // Constants\n",
+"h2R=-0.2;\n",
+"hc1=hb1-h1R; hc2=hb2-h2R; // Enthalpies at 0 oC\n",
+"Cpo1=14.86; Cpo2=12.92; // In kJ/kg\n",
+"A2_1=(0.4278/(pc1*10^3))*(Tc1/T)^2.5; // Constants\n",
+"B_1=(0.0867/(pc1*10^3))*(Tc1/T); // Constants\n",
+"A2_2=(0.4278/(pc2*10^3))*(Tc2/T)^2.5; // Constants\n",
+"B_2=(0.0867/(pc2*10^3))*(Tc2/T); // Constants\n",
+"y1=0.9999; y2=0.0001;\n",
+"Tc=y1*Tc1+y2*Tc2;\n",
+"z=0.957;\n",
+"hR=R_1*(T/M)*(((-3/2)*(A2_1/B_1)*log (1+(B_1*p/z)))+z-1);\n",
+"hV=y1*(hc1+Cpo1)+y2*(hc2+Cpo2)+hR;\n",
+"disp ('kJ/kg',hV,'(b).Enthalpy of saturated vapour at V in Equilibrium with liquid at L/B');\n",
+"// (c).Enthalpy of saturated vapour at D after complete vaporization of liquid at B/L\n",
+"T=359.15; // In K\n",
+"Cpo1=192.2; Cpo2=160.9; // In kJ/kg\n",
+"A2_1=(0.4278/(pc1*10^3))*(Tc1/T)^2.5; // Constants\n",
+"B_1=(0.0867/(pc1*10^3))*(Tc1/T); // Constants\n",
+"A2_2=(0.4278/(pc2*10^3))*(Tc2/T)^2.5; // Constants\n",
+"B_2=(0.0867/(pc2*10^3))*(Tc2/T); // Constants\n",
+"y1=0.9; y2=0.1;\n",
+"Tc=y1*Tc1+y2*Tc2;\n",
+"z=0.9768;\n",
+"hR=R_1*(T/M)*(((-3/2)*(A2_1/B_1)*log (1+(B_1*p/z)))+z-1);\n",
+"hD=y1*(hc1+Cpo1)+y2*(hc2+Cpo2)+hR;\n",
+"disp ('kJ/kg',hD,'(c).Enthalpy of saturated vapour at D after complete vaporization of liquid at B/L');\n",
+"// (d).Latent Heat of Vapourization of this Liquid Mixture\n",
+"hB=-0.2; \n",
+"hD_hB=hD-hB; //Latent Heat of Vapourization of this Liquid Mixture\n",
+"disp ('kJ/kg mixture',hD_hB,'(d). Latent Heat of Vapourization of this Liquid Mixture = ');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/14-CHEMICAL_REACTIONS_AND_COMBUSTION.ipynb b/Thermodynamics_by_C_P_Arora/14-CHEMICAL_REACTIONS_AND_COMBUSTION.ipynb
new file mode 100644
index 0000000..6988453
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/14-CHEMICAL_REACTIONS_AND_COMBUSTION.ipynb
@@ -0,0 +1,423 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 14: CHEMICAL REACTIONS AND COMBUSTION"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.10: ENTROPY_GENERATION_IN_A_CO_COMBUSTION_REACTION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// (a).The product CO2 is also at 298K\n",
+"Pco=2/3; // Paratial pressure of CO in atm \n",
+"Po2=1/3; // Paratial pressure of O2 in atm\n",
+"Pco2=1; // Paratial pressure of CO2 in atm\n",
+"T0=298; // Temperature of surroundings in kelvin\n",
+"R_1=8.3143; // Universal gas constant of air in kJ/kmol K\n",
+"// From table 14.1 at 298 K and 1 atm\n",
+"s_co2=213.795-R_1*log (Pco2); // entropies in kJ/kmol K\n",
+"s_co=197.653-R_1*log (Pco); // entropies in kJ/kmol K\n",
+"s_o2=205.03-R_1*log (Po2); // entropies in kJ/kmol K\n",
+"del_Scv=s_co2-s_co-1/2*s_o2; // Entropy change of comtrol volume \n",
+"// From table 14.1\n",
+"del_hfco2=-393509; del_hfco=-110525; // Enthalpy of Heat in kJ/kmol\n",
+"Q= del_hfco2- del_hfco; // Heat transfer (to surroundings)\n",
+"del_Ssurr=abs(Q)/T0; // Entropy change of surroundings\n",
+"del_Sgen=del_Scv+del_Ssurr; //Entropy change of universe\n",
+"disp ('kJ/K',del_Sgen,'Entropy change of universe = ','kJ/K',del_Ssurr,'Entropy change of surroundings = ','kJ/K',del_Scv,'Entropy change of comtrol volume = ','(a).The product CO2 is also at 298K');\n",
+"// (b).The reaction is adiabatic\n",
+"// Let the adiabatic flame temperature be T. Then since\n",
+"Q=0;\n",
+"C_p=44*0.8414;\n",
+"// From table A.16\n",
+"T=5057.5; //adiabatic flame temperature in kelvin\n",
+"s_CO2=213.795+C_p*log (T/T0); // entropies in kJ/kmol K\n",
+"del_Scv=s_CO2-s_co-1/2*s_o2; // Entropy change of comtrol volume \n",
+"del_Ssurr=abs(Q)/T0; // Entropy change of surroundings\n",
+"del_Sgen=del_Scv+del_Ssurr; //Entropy change of universe\n",
+"disp ('kJ/K',del_Sgen,'Entropy change of universe = ','kJ/K',del_Ssurr,'Entropy change of surroundings = ','kJ/K',del_Scv,'Entropy change of comtrol volume = ','(b).The reaction is adiabatic');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.11: GIBBS_FNCTION_OF_FORMATION_OF_LIQID_H2O.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// The Combustion of H2 with Q2 from H2O\n",
+"//H2(g)+1/2 O2 (g)→H2O(l)+285830 kJ/kmol H2\n",
+"T0=298; // Temperature of surroundings in kelvin\n",
+"// From table 14.1 at 298 K\n",
+"del_hfH2O=-285830; // Enthalpy of Heat in kJ/kmol\n",
+"s_298H2O=69.94; s_298H2=130.684; s_298O2=205.142; // entropies in kJ/kmol K\n",
+"GP_GR=del_hfH2O-T0*(s_298H2O-s_298H2-1/2*s_298O2); // Formation of Gibbs function\n",
+"GR=0;\n",
+"GP=GP_GR-GR; // Standard Gibbs function of formation of liquid H2O\n",
+"disp ('kJ/kmol',GP,'Standard Gibbs function of formation of liquid H2O = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.12: MAXIMUM_POSSIBLE_WORK_OTPUT_OF_A_COMBUSTION_PROCESS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// the combustion equation\n",
+"// n1C3H8+n2O2+n3 N2 → n4 CO2+ n5 H2O+n6 O2+n7 N2\n",
+"T0=298; // Temperature of surroundings in kelvin\n",
+"// (a).Product species at 25 oC and 1 atm\n",
+"d_gfC3H8=-24290; d_gfCO2=-394359; d_gfH2O=-228570; // in kJ/kmol\n",
+"GR=d_gfC3H8;\n",
+"GP=3*d_gfCO2+4*d_gfH2O;\n",
+"Wmax=GR-GP; // Maximum possible work output\n",
+"M=44;//Molecular weight\n",
+"Wmax=Wmax/M;\n",
+"disp ('kJ/kg fuel (answer mentioned in the textbook is wrong)',Wmax,'Maximum possible work output = ','(a).');\n",
+"// (b).The actual partial pressures of products\n",
+"n1=1; n2=20; n3=75.2;\n",
+"n4=3; n5=4; n6=15; n7=75.2; // refer equation\n",
+"SR=19233; SP=19147; // in kJ/K from table\n",
+"HR=-104680; // in kJ/kmol fuel\n",
+"d_h0fCO2=-393509; d_h0fH2O=-241818; // in kJ/kmol\n",
+"HP=3*d_h0fCO2+4*d_h0fH2O;\n",
+"Wmax=HR-HP-T0*(SR-SP); // Maximum possible work output\n",
+"Wmax=Wmax/M;\n",
+"disp ('kJ/kg (round off error)',Wmax,'Maximum possible work output = ','(b).');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.1: THE_STANDARD_HEAT_OF_REACTION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// From the Table 14.1 \n",
+"del_hfHCL=92307; // Enthalpy of Heat in kJ/kmol\n",
+"del_hfH2O=-241818; // Enthalpy of Heat kJ/kmol\n",
+"del_Ho=4*del_hfHCL-2*del_hfH2O; // The standard heat of reaction from enthalpy equation\n",
+"disp ('kJ (answer mentioned in the textbook is wrong)',del_Ho,'The standard heat of reaction for the process = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.2: ENTHALPY_OF_FORMATION_OF_SUCROSE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"del_Ho=5640000; // Heat released during the process\n",
+"// From the Table 14.1 \n",
+"del_hfO2=-393509; del_hfH2O=-285830; // Enthalpy of Heat in kJ/kmol\n",
+"del_hfsucrose=12*del_hfO2+11*del_hfH2O+del_Ho; // The enthalpy formation of sucrose\n",
+"disp ('kJ/kmol (answer mentioned in the textbook is wrong)',del_hfsucrose,'The enthalpy formation of sucrose = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.3: BALANCING_A_COMBUSTION_EQUATION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// (a).Balancing of chemical equation\n",
+"// The unbalanced equation for the process is C8H18 + O2 + N2 → CO2 + H2O + N2\n",
+"x=8; // Carbon balance\n",
+"y=9; // Hydrogen balance\n",
+"z=12.5; // Oxygen balance in reverse order\n",
+"n=z*3.76; // Nitrogen Balance\n",
+"disp ('(a).Balancing of chemical equation');\n",
+"printf ('\n C8H18 + %0.1f O2 + %d N2 → %d CO2 + %d H2O + %d N2 \n ',z,n,x,y,n);\n",
+"// (b).The theoretical air-fuel ratio\n",
+"a=1; // Mole of C8H18\n",
+"AF1=(z+n)/a; //The theoretical air-fuel ratio on mole basis\n",
+"ma=28.84; // Molecular mass of air \n",
+"mc=114; // Molecular mass of C8H18\n",
+"AF2=(AF1*ma)/(a*mc); // The theoretical air-fuel ratio on mass basis\n",
+"disp ('kg air / kmol C8H18',AF2,'The theoretical air-fuel ratio on mass basis = ','kmol air / kmol C8H18',AF1,'The theoretical air-fuel ratio on mole basis = ','(b).The theoretical air-fuel ratio');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.4: CHEMICAL_EQUATION_FOR_INCOMPLETE_COMBUSTION_WITH_DEFICIENT_AIR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// The combustion equation for C4H10 with 80% theoretical air is C4H10 +5.2(O2 + 3.76 N2) → a(1)CO + a(2)CO2 + 5H2O + 19.55N2\n",
+"// The following matrix shows the balance of C and O\n",
+"A=[1 1 ; 1 2];\n",
+"B=[4 ;5.4];\n",
+"a=A\B;\n",
+"disp ('The equation for the combustion of butane with 80% theoretical air is ')\n",
+"printf ('\n C4H10 +5.2(O2 + 3.76 N2) → %0.1f CO + %0.1f CO2 + 5H2O + 19.55N2',a(1),a(2));"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.5: EX14_5.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p=101.325; // Atmospheric pressure in kPa\n",
+"// The complete combustion equation for actane\n",
+" // yC8H18+ x (O2+3.76N2) → n1 CO2+n2 H2O+n3 O2+n3 N2\n",
+"x=12.5*1.5; y=1;\n",
+"n1=8; n2=9; n3=6.28; n4=70.5;\n",
+"n=n1+n2+n3+n4; // Total number of moles of the products\n",
+"AFm=(x+x*3.76)/y ;// Air fuel ratio\n",
+"m=28.84;\n",
+"M=116; // Molecular weight of octane\n",
+"AF=AFm*m/M;\n",
+"yco2=n1/n; yH2O=n2/n; yO2=n3/n; yN2=n4/n;\n",
+"pH2O=p*yH2O; // Partial pressure of water vapour in the products\n",
+"Tsat=45.21; // In oC\n",
+"disp ('kg air/kg octane',AF,'Air fuel ratio = ');\n",
+"disp ('If the products are cooled below 25 oC then, the water vapour will condense. Because the cooled temperature is less than dew point temperature of water vapour i.e., T < Tsat.');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.6: AIR_FEL_RATIO_FOR_COMBUSTION_OF_PRODUCER_GAS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// The complete chemical equation is //[0.14H2+0.03CH4+0.27CO+0.045CO2+0.01O2+0.505N2]+0.255(O2+3.75N2) →0.2H2O+0.345CO2+1.44N2\n",
+"a=0.14; // Composition of H2 in air\n",
+"b=0.03; // Composition of CH4 in air\n",
+"c=0.27; // Composition of CO in air\n",
+"d=0.045; // Composition of CO2 in air\n",
+"e=0.01; // Composition of O2 in air\n",
+"f=0.505; // Composition of N2 in air\n",
+"g=(0.265-0.01); // O2 requirement from atmospheric air with 1% O2 already in fuel\n",
+"h=3.76; // By nitrogen balance \n",
+"i=1; // mole of the air\n",
+"AFvol=(g+(g*h))/i; // Air fuel ratio (theroretical)\n",
+"AFv=1.1*AFvol; // Air fuel ratio on mol (volume) basis\n",
+"disp ('kmol actual air/kmol fuel',AFv,'Air fuel ratio on mol (volume) basis =')\n",
+"M1=2; // Molecular mass of H2\n",
+"M2=16; // Molecular mass of CH4\n",
+"M3=28; // Molecular mass of CO\n",
+"M4=44; // Molecular mass of CO2\n",
+"M5=32; // Molecular mass of O2\n",
+"M=a*M1+b*M2+c*M3+d*M4+e*M5+f*M3; // Molecular mass of Fuel\n",
+"Ma=28.84; // Molecular mass of air\n",
+"AFm=AFv*Ma/(i*M); // Air fuel ratio on mass basis\n",
+"disp ('kg air / kg fuel',AFm,'Air fuel ratio on mass basis = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.7: ACTUAL_COMBUSTION_OF_PROPANE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"//From table 14.2 at 25 oC and 1 atm for C8H8\n",
+"del_Ho=-2039.7; // LHV in MJ/kmol\n",
+"// Combustion equation is C3H8+ 5O2 +18.8N2 → 3CO2 +4H2O +18.8N2\n",
+"// From table 14.3\n",
+"h333_C3H8=2751; // h333_h298 of C3H8 in kJ/kmol\n",
+"h333_O2=147; // h333_h298 of O2 in kJ/kmol\n",
+"h333_N2=145; // h333_h298 of N2 in kJ/kmol\n",
+"h1333_CO2=52075; // h1333_h298 of CO2 in kJ/kmol\n",
+"h1333_H2O=32644; // h1333_h298 of H2O in kJ/kmol\n",
+"h1333_N2=32644; // h1333_h298 of N2 in kJ/kmol\n",
+"M=44; // molecular mass of C3H8\n",
+"Ha_H1=h333_C3H8+5*h333_C3H8+18.8*h333_N2; // The enthalpy differences\n",
+"Hb_H2=3*h1333_CO2+4*h1333_H2O+18.8*h1333_N2; // The enthalpy differences\n",
+"Q=(del_Ho+Hb_H2/1000-Ha_H1/1000)/M; // Heat transfer from combustion chamber\n",
+"disp ('MJ/kg C3H8',abs (Q),'Heat transfer from combustion chamber =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.8: ADIABATIC_FLAME_TEMPERATURE_OF_PROPANE_WITH_THEORETICAL_AIR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"Ha_H1=6220; // From example 14.7 in kJ/kmol\n",
+"del_Ho=-2039.7; // From example 14.7 LHV in MJ/kmol\n",
+"Hb_H2=-del_Ho+Ha_H1; // For adiabatic combustion of C3H8\n",
+"// Hb_H2=3*h1333_CO2+4*h1333_H2O+18.8*h1333_N2 By iteration process and making use of the values from Table A.3, A.13, A.15 we can get the adiabatic flame temperature is\n",
+"Tad=2300;// The adiabatic flame temperature in kelvin\n",
+"disp ('K',Tad,'The adiabatic flame temperature');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14.9: ENTROPY_GENERATION_IN_A_CARBON_COMBUSTION_REACTION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// (a).Entropy change per kmol of C\n",
+"// From table 14.1 at 298 K and 1 atm\n",
+"s_c=5.686; // Absolute entropies of C in kJ/kmol K\n",
+"s_o2=205.142; // Absolute entropies of o2 in kJ/kmol K\n",
+"s_co2=213.795; // Absolute entropies of CO2 in kJ/kmol K\n",
+"del_s=s_co2-(s_c+s_o2); // The entropy change \n",
+"disp ('kJ/K/kmol C',del_s,'(a).The entropy change = ');\n",
+"// (b).Entropy change of universe\n",
+"Tsurr=298; // Temperature of surroundings in kelvin\n",
+"// From table 14.1 \n",
+"del_Ho=-393509; // del_hfco2 in kJ/kmol CO2\n",
+"Q=abs (del_Ho);\n",
+"del_Ssurr=Q/Tsurr; // Entropy change of surroundings\n",
+"del_Suniv=del_s+del_Ssurr; //Entropy change of universe\n",
+"disp ('kJ/K',del_Suniv,'(b).Entropy change of universe = ');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/15-CHEMICAL_EQUILIBRIUM.ipynb b/Thermodynamics_by_C_P_Arora/15-CHEMICAL_EQUILIBRIUM.ipynb
new file mode 100644
index 0000000..d73a83c
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/15-CHEMICAL_EQUILIBRIUM.ipynb
@@ -0,0 +1,243 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 15: CHEMICAL EQUILIBRIUM"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.1: METHANE_WATER_REACTION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// (b).Number of moles of each constituents\n",
+"nCH4=2; // Number of moles of CH4\n",
+"E=3-nCH4; // Amount of reaction from (a) and refer example 15.1 (a)\n",
+"nH2O=1-E;// Number of moles of H2O\n",
+"nCO=1+E;// Number of moles of CO\n",
+"nH2=4+3*E;// Number of moles of H2\n",
+"disp (nH2,'Number of moles of H2 = ',nCO,'Number of moles of CO = ',nH2O,'Number of moles of H2O = ','(b).Number of moles of each constituents');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.2: EQUILIBRIUM_CONSTANTS_FOR_COMBUSTION_OF_CO.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T0=298; // Given temperature in kelvin\n",
+"R_1=8.314; // Universal gas constant in kJ/kg mol K\n",
+"// (a).CO+1/2 O2 = CO2\n",
+"// From table of properties of combustion\n",
+"del_hfco2=-393509;// Enthalpy of heat \n",
+"del_hfco=-110525;// Enthalpy of heat \n",
+"s_co2=213.795;// Entropy of heat \n",
+"s_co=197.652;// Entropy of heat \n",
+"s_o2=205.142;// Entropy of heat \n",
+"del_Ga=(del_hfco2-del_hfco-T0*(s_co2-s_co-(1/2*s_o2)));\n",
+"Ka=exp (abs (del_Ga)/(R_1*1000*T0));\n",
+"disp ('(a).CO+1/2 O2 = CO2');\n",
+"printf ('\n The equilibrium constant at 298 K = %0.3f (Error in textbook) \n',Ka);\n",
+"// (b).2CO + O2 = 2CO2\n",
+"Kb=exp (2*abs (del_Ga)/(R_1*1000*T0));\n",
+"disp ('(b).2CO + O2 = 2CO2');\n",
+"printf ('\nThe equilibrium constant at 298 K = %0.3f (Error in textbook)',Kb);\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.3: EQUILIBRIUM_CONSTANT_AT_GIVEM_TEMPERATURE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T0=298; // Temperature of surroundings in kelvin\n",
+"R_1=8.314; // Universal gas constant in kJ/kg mol K\n",
+"T=2800; // Given Temperature in kelvin\n",
+"// From table of properties of combustion\n",
+"del_hfco2=-393509; // Enthalpy of heat \n",
+"del_hfco=-110525; // Enthalpy of heat \n",
+"del_H=del_hfco2-del_hfco; // Standard enthalpy of reaction\n",
+"Ka=1.229D+45; // The equilibrium constant From the example 15.2\n",
+"K1=log (Ka);\n",
+"K=exp(-(del_H/R_1)*((1/T)-(1/T0))+K1);\n",
+"disp (K,'K =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.5: ACTUAL_COMBUSTION_OF_CO.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T=2800; // Temperature of combustion in kelvin\n",
+"p=1; // Pressure of combustion in atm\n",
+"// For this reverse reaction at 2800K and 1atm, from Table 15.1\n",
+"K=44.168; // K=e^3.788;\n",
+"K=sqrt (K); // For stoichiometric equation CO+1/2 O2 = CO2 which is halved\n",
+"// From equation 15.24a and by the iteration process we get the following\n",
+"a=0.198;\n",
+"b=(1+a)/2;\n",
+"c=1-a;\n",
+"disp (c,b,a,'The balance for the actual reaction equation CO + O2 → aCO + bO2 + cCO2 is given by ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.6: EFFECT_OF_PLEASURE_ON_OBTAINING_COMPLETE_COMBUSTION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// By driving the equation for equilibrium constant as shown in example 15.6 we get 6.646(6)^(1/6)=((1-a)/a)((3+a)/(1+a))^1/2\n",
+"// by simple iteration process we get\n",
+"a=0.095;\n",
+"b=(1+a)/2;\n",
+"c=1-a;\n",
+"disp ('mol',c,'The equilibrium composition of CO2 = ','mol',b,'The equilibrium composition of O2 = ','mol',a,'The equilibrium composition of CO = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.7: EFFECT_OF_INERT_GAS_N2_IN_COMBUSTION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T=2800; // Temperature of combustion in kelvin\n",
+"p=1; // Pressure of combustion in atm\n",
+"// For this reverse reaction at 2800K and 1atm, from Table 15.1\n",
+"K=44.168; // K=e^3.788;\n",
+"K=sqrt (K); // For stoichiometric equation CO+1/2 O2 = CO2 which is halved\n",
+"// From equation 15.24a and by the iteration process we get the following\n",
+"a=0.302;\n",
+"b=(1+a)/2;\n",
+"c=1-a;\n",
+"disp (c,b,a,'The balance for the actual reaction equation CO + 1/2O2 + 1.88N2 ↔ aCO + bO2 + cCO2 +3.76N2 is given by ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15.8: FORMATION_OF_NITROGEN_OXIDES_Nox_IN_IC_ENGINES.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T=3000; // Temperature of combustion in kelvin\n",
+"p=1; // Pressure of combustion in atm\n",
+"T0=298; // Temperature of surroundings in kelvin\n",
+"R_1=8.314; // Universal gas constant in kJ/kg mol K\n",
+"// Gibbs functions at 298K from Table 14.1\n",
+"del_gNO=86550; // In kJ/kmol\n",
+"del_gNO2=51310; // In kJ/kmol\n",
+"// From table of properties of combustion\n",
+"del_hfNO=90250; // Enthalpy of heat \n",
+"del_hfNO2=33180; // Enthalpy of heat \n",
+"K1=exp (-(del_hfNO/R_1)*((1/T)-(1/T0))-((del_gNO)/(R_1*T0)));\n",
+"K2=exp (-(del_hfNO2/R_1)*((1/T)-(1/T0))-((del_gNO2)/(R_1*T0)));\n",
+"// By solving equilibrium equations by iteration method\n",
+"E1=0.228; E2=0.0007;\n",
+"yNO=E1/4.76; // Mole fraction of NO in exhaust gas\n",
+"yNO2=E2/4.76; // Mole fraction of NO2 in exhaust gas\n",
+"disp ('%',yNO2*100,'Mole fraction of NO2 in exhaust gas = ','%',yNO*100,'Mole fraction of NO in exhaust gas = ','Percentage of NOx present in the exhaust gas ');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/2-THERMODYNAMIC_CONCEPTS_AND_THE_ZEROTH_LAW_.ipynb b/Thermodynamics_by_C_P_Arora/2-THERMODYNAMIC_CONCEPTS_AND_THE_ZEROTH_LAW_.ipynb
new file mode 100644
index 0000000..4245699
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/2-THERMODYNAMIC_CONCEPTS_AND_THE_ZEROTH_LAW_.ipynb
@@ -0,0 +1,90 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2: THERMODYNAMIC CONCEPTS AND THE ZEROTH LAW "
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.1: MASS_OF_PISTON.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"patm = 14.5 ; // atmospheric pressure in psia\n",
+"pgauge = 2.5; // gauge pressure in psia\n",
+"A = 10; // Area of the piston in in^2\n",
+"g=9.80665; // Acceleration due to gravity in m/s^2\n",
+"p = patm + pgauge; //total pressure of gas\n",
+"m=(p-patm)*A ; //mass of the piston\n",
+"disp('lbm',m,'Mass of the piston =','In English units');\n",
+"p=(p*0.454*g)/(0.0254^2); // conversion of English unit to SI units\n",
+"patm=(patm*0.454*g)/(0.0254^2); // conversion of English unit to SI units\n",
+"m = ((p-patm)*(A*2.54^2*10^-4))/g; // Mass of the piston\n",
+"disp('kg',m,'Mass of the piston =','In SI units');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2.2: INCLINED_MANOMETER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"d_r = 13600; // Density of manometric fluid (mercury) in kg/m^3\n",
+"g = 8.92; // Gravitational acceleration in m/s^2\n",
+"z1=0.589*sind(60); // vertical height of fluid at section 1\n",
+"z2=2*sind(30); // vertical height of fluid at section 2\n",
+"z=z2-z1; // Difference in vertical heights of fluid\n",
+"patm = 14.7; // Atmospheric pressure in lbf/in^2\n",
+"patm=(patm*4.44822*144/0.3048^2); // conversion of lbf/in^2 unit to N/m^2 unit\n",
+"p=patm + (d_r*g*(z2-z1)); // Balance of force at A\n",
+"disp ('m',z,'Difference in vertical heights of fluid');\n",
+"disp ('kPa',p/1000,'The pressure of fluid in the vessel');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/3-PROPERTIES_OF_A_PURE_SUBSTANCE.ipynb b/Thermodynamics_by_C_P_Arora/3-PROPERTIES_OF_A_PURE_SUBSTANCE.ipynb
new file mode 100644
index 0000000..e34737b
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/3-PROPERTIES_OF_A_PURE_SUBSTANCE.ipynb
@@ -0,0 +1,282 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 3: PROPERTIES OF A PURE SUBSTANCE"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.1: MASS_OF_WATER_AND_VAPOUR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"V=0.01; // Volume of water in a rigid vessel in m^3\n",
+"m=4.5; // Mass of water+ steam in a rigid vessel in kg\n",
+"T=35; // Temperature of water in a rigid vessel in degree celcius\n",
+"// (a) \n",
+"v=V/m; // specific volume of water\n",
+"// From steam table\n",
+"vf=0.001006; vg=25.22; // specific volume in m^3/kg\n",
+"x=(v-vf)/(vg-vf); // Quality of steam\n",
+"x1=1-x; // Quality of water\n",
+"mg=x*m; // Mass of steam\n",
+"mf=x1*m; // Mass of water\n",
+"disp ('kg',mf,'Mass of water in a rigid vessel = ','kg',mg,'Mass of steam in a rigid vessel = ',x1,'Quality of water in a rigid vessel = ',x,'Quality of steam in a rigid vessel = ',' (a) ');\n",
+"// (b) \n",
+"vc=0.003155; // Crictical volume for water in m^3/kg\n",
+"disp ('The level of liquid water will rise in the vessel. Since v < vc and refer figure 3.21',' (b) ');\n",
+"// (c) \n",
+"disp ('The final temperature after heating is 370.04 oC. Because it is constant volume process and refer figure 3.21',' (c) ');\n",
+"// (d) \n",
+"m1=0.45; // Mass of water in kg\n",
+"v1=V/m; // specific volume of water\n",
+"disp ('Level of liquid drops to bottom (v1 > vc). Temperature on reaching saturation state is 298.5 oC and refer figure 3.21', ' (d) ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.2: THE_QUALITY_OF_VAPOUR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+" // (a) Ammonia 26 oC and 0.074 m^3/kg\n",
+"// From saturation table of ammonia at 26 oC\n",
+"v=0.074; // specific volume of ammonia in m^3/kg\n",
+"vf=0.001663; vg=0.1245; // specific volume of ammonia in m^3/kg\n",
+"x=(v-vf)/(vg-vf); // Quality of vapour since v<vg\n",
+"disp (x,'The Quality of ammonia = ','(a) Ammonia 26 oC and 0.074 m^3/kg');\n",
+"// (b).Ammonia 550kPa and 0.31m^3/kg\n",
+"// From saturation table of ammonia at 550 kPa\n",
+"v=0.31; // specific volume of ammonia in m^3/kg\n",
+"vg=0.23; // specific volume of ammonia in m^3/kg\n",
+"// v > vg . Since from superheated table by interpolation for 550kPa and v\n",
+"T=82.1; // Temperature of ammonia in degree celcius\n",
+"disp ('oC',T,'Temperature of ammonia = ','(b).Ammonia 550kPa and 0.31m^3/kg');\n",
+"// (c).Freon 12, 0.35MPa and 0.036 m^3/kg\n",
+"// From saturation table of Freon 12 at 0.35MPa\n",
+"v=0.036; // specific volume of Freon 12 in m^3/kg\n",
+"vf=0.000722; vg=0.049329; // specific volume of Freon 12 in m^3/kg\n",
+"x=(v-vf)/(vg-vf); // Quality of vapour since v<vg\n",
+"disp (x,'The Quality of Freon 12 = ','(c).Freon 12, 0.35MPa and 0.036 m^3/kg');\n",
+"// (d).Methane 0.5MPa and 1.0 m^3/kmol\n",
+"v=1; // specific volume of Methane in m^3/kmol\n",
+"// From table at 0.5 MPa molar values are\n",
+"vf=0.04153; vg=2.007; // specific volume of Methane in m^3/kmol\n",
+"x=(v-vf)/(vg-vf); // Quality of vapour since v<vg\n",
+"disp (x,'The Quality of Methane = ','(d).Methane 0.5MPa and 1.0 m^3/kmol');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.3: MASS_OF_AIR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"V=300; // Volume of air in the room in m^3\n",
+"p=1; // Atmospheric pressure in bar\n",
+"T=25; // Temperature of air in Degree Celcius\n",
+"R=287; // Characteristic constant of Air in J/kg k\n",
+"m=(p*10^5*V)/(R*(T+273)); // Ideal gas equation\n",
+"disp ('kg',m,'Mass of air in room');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.4: MOLECULAR_WEIGHT_OF_THE_GAS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"D=20; // Diameter of the sphere in cm\n",
+"m=2.54; // Mass of gas filled in sphere in gram\n",
+"p=10; // Pressure of gas in bar\n",
+"T=25; // Temperature of gas in Degree Celcius\n",
+"R=8.3144*10^3; // Universal gas constant in J/kmol K\n",
+"V=(3.14*(D*10^-2)^3)/16; // Volume of das in sphere in m^3\n",
+"M=(m*10^-3*R*(T+273))/(p*10^5*V); // Molecular weight of the gas\n",
+"disp (M,'Molecular weight of the gas');\n",
+"disp ('Therefore gas in sphere is Helium (unless mixture of two or more gases)');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.5: PRESSURE_AND_TEMPERATURE_OF_AIR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p2=2.5; // Pressure of air in the cylinder in bar\n",
+"T1=430; // Temperature of air in cylinder in Degree Celcius\n",
+"V1=1.2; // Volume of cylinder in m^3\n",
+"V2=0.6; // Volume of cylinder upto end stops in m^3\n",
+"// (a) Temperature of air when the piston reaches the stops\n",
+"T2=(T1+273)*(V2/V1); // constant pressure process\n",
+"disp ('K',T2,'Temperature of air when the piston reaches the stops');\n",
+"// (b) The pressure of air when its temperature equals to 25 oC\n",
+"T3=25; //Room temperature in Degree Celcius\n",
+"p3=p2*((T3+273)/T2); // constant volume process\n",
+"disp ('bar',p3,'The pressure of air when its temperature equals to 25 oC');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.7: DETERMINATION_OF_SPECIFIC_VOLUME.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p=6000; // Pressure of nitrogen gas in kPa\n",
+"T=150; // Temperature of nitrogen gas in kelvin\n",
+"V=250; // Volume of tank in litres\n",
+"R_1=8.3143; // Universal gas constant in kJ/kmol K\n",
+"M=28.1013; // Molecular mass\n",
+"// (a).Beattie - Bridgeman equation of state\n",
+"// Constants for nitrogen gas\n",
+"c=4.2*10^4; Ao=136.2315; a=0.02617; Bo=0.05046; b=-0.00691;\n",
+"// By substituting these values in the following equation \n",
+"// p=(R_1*T/v^2)*(1-(c/(vT^3)))*(v+Bo*(1-(b/v)))-(Ao/v^2*(1-(a/v)))\n",
+"// By trial and error we get\n",
+"v=0.1222; // specific volume in m^3/kmol\n",
+"m=(M*V/1000)/v; // Mass of nitrogen gas\n",
+"disp ('m^3/kmol',v,'specific volume of nitrogen gas = ','kg',m,'Mass of nitrogen gas = ','(a).Beattie - Bridgeman equation of state');\n",
+"// (b).Nitrogen tables\n",
+"// From property table of nitrogen fas\n",
+"v=0.004413; // specific volume in m^3/kg\n",
+"m=(V/1000)/v; // Mass of nitrogen gas\n",
+"disp ('m^3/kg',v,'specific volume of nitrogen gas = ','kg',m,'Mass of nitrogen gas = ','(b).Nitrogen tables');\n",
+"// (c).Ideal gas equation of state\n",
+"m=(p*V/1000)/(R_1*T/M); //Mass of nitrogen gas\n",
+"disp ('kg',m,'Mass of nitrogen gas = ','(c).Ideal gas equation of state');\n",
+"// (d).Generalized compressibility chart\n",
+"// The crictical properties for nitrogen gas \n",
+"Tc=126.2; // Temperature in kelvin\n",
+"Pc=3.349; // Pressure in MPa\n",
+"// Reduced properties are\n",
+"Pr=p/Pc; Tr=T/Tc;\n",
+"z=0.6; // From chart\n",
+"m=(p*V/1000)/(z*R_1*T/M); //Mass of nitrogen gas\n",
+"disp ('kg',m,'Mass of nitrogen gas = ','(d).Generalized compressibility chart');\n",
+"disp ('Ideal gas equation of state','Generalized compressibility chart','Beattie - Bridgeman equation of state','Nitrogen tables',' (e).Arrangement the methods in order of percentage error : ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3.8: CALCULATION_OF_SPECIFIC_VOLUME_USING_REDLICH_KWONG_EQUATION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T=-58.7; //Normal boling point of CF3Br in Degree Celcius\n",
+"Tc=340.9; // Crictical temperature of CF3Br in K\n",
+"pc=4.05; // Crictical pressure of CF3Br in MPa\n",
+"M=148.9; // Moleclar mass of CF3Br\n",
+"p=1.01325*10^5; // Atmospheric pressure in N/m^2\n",
+"R1=8314.4; // Universal gas constant in J/kmol K\n",
+"R=R1/M; // Gas constant of CF3Br\n",
+"a=(0.42748*R^2*Tc^2.5)/(pc*10^6); // Constant of Redlich-Kwong equation of state\n",
+"b=(0.08664*R*Tc)/(pc*10^6); // Constant of Redlich-Kwong equation of state\n",
+"vi=(R*(T+273))/p; // Ideal gas volume for assigning initial value\n",
+"// By substituting these values in the Redlich-Kwong equation of state \n",
+" // vi_1=(R*(T+273)/p)+b-((a/(p*(273+T)^0.5*vi))) and and solving it by trial and error method we get\n",
+"vi_1=0.11443; // in m^3/kg\n",
+"disp ('m^3/kg',vi_1,'Saturated vapour volume');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/4-WORK_AND_HEAT.ipynb b/Thermodynamics_by_C_P_Arora/4-WORK_AND_HEAT.ipynb
new file mode 100644
index 0000000..6760c84
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/4-WORK_AND_HEAT.ipynb
@@ -0,0 +1,366 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4: WORK AND HEAT"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.10: ECONOMISER_SURFACE_AREA.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"Tc1=10; // Feed water inlet temperature in degree celcius\n",
+"Tc2=77; // Feed water outlet temperature in degree celcius\n",
+"th1=166; // Initial temperature of flue gas in degree celcius\n",
+"r=4; // Ratio of mass flow rates of flue gases and water\n",
+"Ch=1.05; // The specific heat of flue gas in kJ/kg K\n",
+"Cc=4.187; // The specific heat of feed water in kJ/kg K\n",
+"U=114; // Overall heat transfer coefficient in W/m^2\n",
+"mc=1; // massflowrate of feed water in kg/s\n",
+"th2=th1-((Cc*(Tc2-Tc1))/(r*Ch)); // Outlet temperature of flue gas in degree celcius\n",
+"Q=mc/3600*Cc*(Tc2-Tc1); // Heat transfer rate per kg/h of water flow\n",
+"// Parallel flow \n",
+"del_Tm=((th1-Tc1)-(th2-Tc2))/log ((th1-Tc1)/(th2-Tc2)); // Logarthamic Mean Temperature Difference in degree celcius\n",
+"A=Q*10^3/(U*del_Tm); // Economiser surface area\n",
+"disp ('degree celcius',del_Tm,'Logarthamic Mean Temperature Difference=',' (a)Parallel flow');\n",
+"disp ('m^2',A,'Economiser surface area =');\n",
+"// Counter flow\n",
+"del_Tm=((th1-Tc2)-(th2-Tc1))/log ((th1-Tc2)/(th2-Tc1)); // Logarthamic Mean Temperature Difference in degree celcius\n",
+"A=Q*10^3/(U*del_Tm); // Economiser surface area\n",
+"disp ('degree celcius',del_Tm,'Logarthamic Mean Temperature Difference=',' (b) Counter flow');\n",
+"disp ('m^2',A,'Economiser surface area =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.1: CALCULATION_OF_WORKDONE_DURING_POLYTROPIC_PROCESS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=5; // Pressure of Helium gas at initial state in bar\n",
+"T1=222; // Temperature of Helium gas at initial state in K\n",
+"V1=0.055; // Volume of Helium gas at initial state in m^3\n",
+"n=1.5; // Index of expansion process\n",
+"R=2.078;// Characteristic gas constant of Helium gas in kJ/kg K\n",
+"p2=2; // Pressure of Helium gas at final state (after expansion) in bar\n",
+"disp ('Method I');\n",
+"V2=V1*(p1/p2)^(1/n);// From Polytropic process relation for final volume\n",
+"W=((p2*10^2*V2)-(p1*10^2*V1))/(n-1); // Work done from Polytropic process relation\n",
+"disp ('kJ',W,'Work done =');\n",
+"disp ('Method II');\n",
+"m=(p1*10^2*V1)/(R*T1); // ideal gas equation\n",
+"T2=T1*(p2/p1)^((n-1)/n); // From Polytropic process relation of final temperature\n",
+"W=(m*R*(T1-T2))/(1-n); // Work done from Polytropic process relation\n",
+"disp ('kJ',W,'Work done =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.3: CALCULATION_OF_WORKDONE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=1.3; // Initial pressure of gas in bar\n",
+"V1=0.03; // Initial volume of gas in m^3\n",
+"V2=0.1; // Final volume of gas in m^3\n",
+"disp ('(a).Constant pressure process');\n",
+"W=p1*10^2*(V2-V1); // work done by gas\n",
+"disp('kJ',W,'work done by gas =');\n",
+"disp ('(b).Constant Temperature process');\n",
+"W=p1*10^2*V1*log(V2/V1);// Work done by gas\n",
+"disp('kJ',W,'work done by gas =');\n",
+"disp ('(c).polytropic process of index 1.3');\n",
+"n=1.3; //index of polytropic process \n",
+"p2=p1*(V1/V2)^n; // From Polytropic process relation for final pressure\n",
+"W=((p2*10^2*V2)-(p1*10^2*V1))/(1-n); // Work done by gas\n",
+"disp('kJ',W,'work done by gas =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4: FREE_EXPANSION_OF_FREON_12.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"patm=1; // Atmospheric pressure in bar\n",
+"V1=0.0135; // Volume of Freon 12 at initial state in m^3\n",
+"D=9; // Diameter of the cylinder in cm\n",
+"m=90; // Mass of the piston in kg\n",
+"g=9.80665; // acceleration due to gravity in m/s^2\n",
+"// (a). Determination of the final pressure and volume of the system\n",
+"A=%pi/4 * (D*10^-2)^2; // Area of the cylinder\n",
+"p1=0.7449; // Initial pressure of saturated vapour at 30 degree celcius in MPa\n",
+"v1=0.023508; // Initial specific volume of saturated vapour at 30 degree celcius in m^3/kg\n",
+"p2=(patm*10^5)+(m*g)/A; // Final pressure of Freon 12\n",
+"v2=0.084022; // Final specific volume from superheated table at p2 and 30 degree celcius in m^3/kg\n",
+"mf=V1/v1; // Mass of Freon 12\n",
+"V2=mf*v2; // Final volume of Freon 12\n",
+"disp ('Pa',p2,'Final pressure = ','(a)');\n",
+"disp ('m^3 (round off error)',V2,'Final volume = ');\n",
+"// (b). Calculation of workdone by Freon 12 during this process\n",
+"Wirrev=p2*(V2-V1); // P dv Work done \n",
+"disp ('kJ (round off error)',Wirrev/1000,'Work done = ','(b)');\n",
+"// (c). Calculation of workdone by Freon 12 during reversible process\n",
+"Wrev=p1*10^6*V1*log (V2/V1);//From reversible process relation for work done\n",
+"disp ('kJ (round off error)',Wrev/1000,'Work done in reveersible process = ','(c)');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.5: CALCULATION_OF_POWER_AND_CLEARENCE_VOLUMETRIC_EFFICIENCY.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=0.1; // Initial pressure (before compression) of air in MPa\n",
+"T1=30; // Initial temperature (before compression) of air in degree celcius\n",
+"p2=0.9; // Final pressure (after compression) of air in MPa\n",
+"R=0.287; // Characteristic constant of air in kJ/kg k\n",
+"// (i) Actual work in the flow process\n",
+"// (a).Isothermal Process\n",
+"w=-R*(T1+273)*log (p2/p1); // work done for isothermal process\n",
+"disp ('kJ/kg',w,'work done = ','(a).Isothermal Process','(i) Actual work in the flow process');\n",
+"// (b).Polytropic process\n",
+"n=1.4; // Index of polytropic process\n",
+"T2=(T1+273)*(p2/p1)^((n-1)/n); // From Polytropic process relation for final temperature\n",
+"w=(n/(1-n))*R*(T2-(T1+273)); // work done for polytropic process\n",
+"disp ('kJ/kg',w,'compression work = ','(b).Polytropic process');\n",
+"// (ii).Nonflow work\n",
+"// (a).Isothermal Process\n",
+"w=-R*(T1+273)*log (p2/p1); // work done for isothermal process\n",
+"disp ('kJ/kg',w,'work done = ','(a).Isothermal Process','(ii).Nonflow work');\n",
+"// (b).Polytropic process\n",
+"w=(1/(1-n))*R*(T2-(T1+273));// work done for polytropic process\n",
+"disp ('kJ/kg',w,'compression work = ','(b).Polytropic process');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.6: WORK_OF_COMPRESSION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=1; // Initial pressure (before compression) of air in bar\n",
+"p2=8; // Final pressure (after compression) of air in bar\n",
+"Vp=15; // Displacement volume of reciprocating air compressor in litres\n",
+"Vc=0.05*Vp; // Clearance volume of reciprocating air compressor in litres\n",
+"N=600; // Speed of compressor in rpm\n",
+"V1=Vc+Vp; // Total volume of reciprocating air compressor in litres\n",
+"p3=p2; // constant pressure process\n",
+"p4=p1; // constant pressure process\n",
+"V3=Vc;// Clearance volume of reciprocating air compressor in litres\n",
+"n=1.3; // Index of reversible adiabatic compression process\n",
+"m=1.4; // Index of reversible adiabatic expansion process\n",
+"V4=V3*(p3/p4)^(1/m);\n",
+"// (a).Work per machine cycle\n",
+"Wcycle = ((n/(n-1))*p1*10^2*V1*10^-3*(1-(p2/p1)^((n-1)/n)))-((m/(m-1))*p4*10^2*V4*10^-3*(1-(p3/p4)^((m-1)/m))); // Work per machine cycle\n",
+"disp ('kJ',Wcycle,'Work per machine cycle (Error in textbook)','(a)');\n",
+"Wpower=abs (Wcycle)*(N/60); // Power consumption of the compressor\n",
+"disp ('kW',Wpower,'Power consumption of the compressor');\n",
+"// (b).Work of the cycle if m=n\n",
+"m=n;\n",
+"W_cycle=(n/(n-1))*p1*10^2*(V1-V4)*10^-3*(1-(p2/p1)^((n-1)/n)); // Work per machine cycle\n",
+"disp ('kJ',W_cycle,'Work per machine cycle','(b)');\n",
+"er=((W_cycle-Wcycle)/Wcycle) * 100 // Error involved in calculating work if m=n\n",
+"disp ('%',er,'Error (Error in textbook)= ');\n",
+"// (c).Clearance volumetric efficiency\n",
+"C=Vc/Vp;\n",
+"eff = 1+C+-C*(p2/p1)^(1/n); // Clearance volumetric efficiency\n",
+"disp ('%',eff*100,'Clearance volumetric efficiency = ','(c).Clearance volumetric efficiency');\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.7: WORK_OF_STEAM_ENGINE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"D=150; // Cylinder Diameter in mm\n",
+"L=200; // Piston stroke in mm\n",
+"C=0.05; // Clearance factor\n",
+"p1=15; // Steam inlet conditions (saturated) in bar\n",
+"p4=1; // Exhaust or back pressure in bar\n",
+"p2=p1; // Constant pressure process\n",
+"p5=p4; // Constant pressure process\n",
+"Vp=(%pi*(D*10^-3)^2*L*10^-3)/4; // Swept volme of cylinder\n",
+"Vc=C*Vp; // Clearance volume of cylinder\n",
+"V3=Vc+Vp; // Total volume of cylinder\n",
+"V1=Vc; // Clearance volume\n",
+"V6=V1; // constant volume process\n",
+"V4=V3; // constant volume process\n",
+"V5=Vc+0.3*Vp; // Compression begins at 30% of stroke\n",
+"V2=Vc+0.4*Vp; // Cut-off occurs at 40% of stroke\n",
+"p6=p5*(V5/V6); // Pressure after compression\n",
+"Wcycle=(p1*10^2*(V2-V1))+(p2*10^2*V2*log (V3/V2))-(p4*10^2*(V4-V5))-(p5*10^2*V5* log(V5/V6)); // Work per Cycle\n",
+"disp('kJ',Wcycle,'Work per cycle =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.8: INDICATOR_WORK.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"D=10; //Bore in cm\n",
+"L=12.5; //Stroke length in cm\n",
+"a=9.68; // Area of indicator card in cm^2\n",
+"l=5.33; // Card length in cm\n",
+"Ks=21.7; // Indicator spring constant per meter of card length\n",
+"A=(%pi*(D*10^-2)^2)/4; // Area of pisaton\n",
+"Pm=(a/l)*10^-2*Ks*10^6; // Mean effective pressure\n",
+"W=Pm*A*L*10^-2; // Work done by cycle\n",
+"disp('kJ',W,'Work done by cycle = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.9: DOUBLE_ACTING_STEAM_ENGINE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"D=152; // Bore of steam engine in mm\n",
+"l=89; // Stroke length of steam engine in mm\n",
+"a1=8;a2=10; // area of indicatior diagram on two sides\n",
+"Ks=50; // Indicator spring constant in lbf/in^2/in\n",
+"N=310; // Engine speed in rpm\n",
+"d=0.664; // Diameter of flywheel in m\n",
+"// (a)\n",
+"a=(a1+a2)/2; // Average area of indicator diagram\n",
+"Ks=50*4.44822/(0.0254)^3; // Unit conversion from lbf/in^2/in to N/m^2\n",
+"pm=(a/(l/10))*10^-2*Ks; // Mean effective pressure \n",
+"A=(%pi*(D*10^-3)^2)/4; // Area of the piston\n",
+"IP=2*pm*l*10^-3*A*N/60; // Indicated power\n",
+"disp ('kW',IP/1000,'Indicated power of Engine =','(a)');\n",
+"// (b)\n",
+"F=12-1.5; // Tangential force on the brake drum in kgf\n",
+"BP=F*9.81*d/2*2*%pi*N/60; // Brake power of Engine\n",
+"eff=BP/IP *100 ; // Mechanical efficiency \n",
+"disp ('kW',BP/1000,'Brake power of Engine = ','(b)');\n",
+"disp ('%',eff,'Mechanical efficiency of Engine =');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/5-FIRST_LAW_OF_THERMODYNAMICS_AND_INTERNAL_ENERGY_AND_ENTHALPY.ipynb b/Thermodynamics_by_C_P_Arora/5-FIRST_LAW_OF_THERMODYNAMICS_AND_INTERNAL_ENERGY_AND_ENTHALPY.ipynb
new file mode 100644
index 0000000..a468783
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/5-FIRST_LAW_OF_THERMODYNAMICS_AND_INTERNAL_ENERGY_AND_ENTHALPY.ipynb
@@ -0,0 +1,680 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 5: FIRST LAW OF THERMODYNAMICS AND INTERNAL ENERGY AND ENTHALPY"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.10: CALCULATION_OF_WORKDONE_AND_HEAT_TRANSFER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=1; // initial pressure of air in piston cylinder arrangement in bar\n",
+"T=300; // Temperature of air in piston cylinder arrangement in kelvin\n",
+"p2=10; // Final pressure of air in piston cylinder arrangement in bar\n",
+"R=0.287; // Characteristic gas constant of air in kJ/kg K\n",
+"disp('The change in internal energy during the isothermal process is zero');\n",
+"w=R*T*log (p1/p2); // Work done\n",
+"disp ('kJ/kg',w,'Work done = ');\n",
+"q=w; // From first law of thermodynamics\n",
+"disp ('kJ/kg',q,'Heat transfer = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.12: EXPANSION_OF_AIR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=65;// (Error in textbook) // Pressure of air at state 1 in bar\n",
+"v1=0.0135; // Volume of air at state 1 in m^3\n",
+"v2=0.1; // Volume of air at state 2 in m^3\n",
+"R=0.287; // Characteristic gas constant of air in kJ/kg K\n",
+"Cvo=0.7165; // Specific heat at constant volume in kJ/kg K\n",
+"// (a).Adiabatic process\n",
+"k=1.4; // Index of adiabatic process\n",
+"p2=p1*(v1/v2)^k; // Pressure of air at state 2 \n",
+"T1=p1*10^2*v1/R;// Tempewrature of air at state 1\n",
+"T2=p2*10^2*v2/R;// Tempewrature of air at state 2\n",
+"w=R*(T2-T1)/(1-k); // work done\n",
+"q=0; // Adiabatic expansion process\n",
+"delta_u=Cvo*(T2-T1); // Change in internal energy of air\n",
+"disp ('kJ',q,'Heat Ineraction = ','kJ',delta_u,'Change in internal energy of air = ','kJ',w,'Work done = ','K',T2,'Final Temperature = ','(a).Adiabatic Process');\n",
+"// (b).Polytropic process\n",
+"n=1.3; // Index of adiabatic process\n",
+"p2=p1*(v1/v2)^n; // Pressure of air at state 2 \n",
+"T1=p1*10^2*v1/R;// Tempewrature of air at state 1\n",
+"T2=p2*10^2*v2/R;// Tempewrature of air at state 2\n",
+"w=R*(T2-T1)/(1-n); // work done\n",
+"delta_u=Cvo*(T2-T1); // Change in internal energy of air\n",
+"q=delta_u+w; // Adiabatic expansion process\n",
+"disp ('kJ',q,'Heat Ineraction = ','kJ',delta_u,'Change in internal energy of air = ','kJ',w,'Work done = ','K',T2,'Final Temperature = ','(b).Polytropic Process');\n",
+"// (c).Isothermal process\n",
+"T1=p1*10^2*v1/R;// Tempewrature of air at state 1\n",
+"T2=T1; // Tempewrature of air at state 2\n",
+"p2=p1*(v1/v2); // Pressure of air at state 2\n",
+"w=R*T1*log (v2/v1); // work done\n",
+"delta_u=Cvo*(T2-T1); // Change in internal energy of air\n",
+"q=delta_u+w; // Adiabatic expansion process\n",
+"disp ('kJ',q,'Heat Ineraction = ','kJ',delta_u,'Change in internal energy of air = ','kJ',w,'Work done = ','K',T2,'Final Temperature = ','(c).Isothermal Process');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.13: ANALYSIS_OF_CONTROL_VOLUME.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=10; // mass flow rate of chilled water in kg/s\n",
+"V1=50; //velocity of chilled water at section 1 in m/s\n",
+"z1=30; // Elevation of section 1 in m\n",
+"V2=10; //velocity of chilled water at section 2 in m/s\n",
+"z2=60; // Elevation of section 2 in m\n",
+"h1=21; // Enthalpy of chilled water at section 1 in kJ/kg\n",
+"h2=43; // Enthalpy of chilled water at section 2 in kJ/kg\n",
+"W=35; // Rate of work done by pump in kW\n",
+"g=9.80665; // Acceleration due to gravity in m/s^2\n",
+"Q=m*(h2-h1)+(m*(V2^2-V1^2)/2000)+(m*g*(z2-z1)/1000)-W; // Steady flow energy equation\n",
+"disp ('kW',Q,'The rate of Heat Transfer From Building (Error in textbook)= ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.14: A_RECIPROCATING_COMPRESSOR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=1; // Suction pressure of air in bar\n",
+"p2=5; // Delivery pressure of air in bar\n",
+"T1=310; // Suction Temperature of air in kelvin\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"// (a) Polytropic compression\n",
+"T2=475; // Delivery Temperature of air in kelvin\n",
+"Q=-0.15; // Heat loss to the cooling water in kW\n",
+"Wpoly=-5.3; // Power consumption of compressor in kW\n",
+"m=(-Wpoly+Q)/(Cpo*(T2-T1)); // mass flow rate of air from SSSF energy equation\n",
+"n=1/((1-((log (T2/T1))/(log (p2/p1))))); // Index of polytropic process\n",
+"disp (n,'Index of polytropic process = ','kg/s',m,'mass flow rate of air = ','(a).Polytropic compression');\n",
+"// (b) Adiabatic compression\n",
+"k=1.4; // Index of adiabatic process\n",
+"Wad=-m*Cpo*T1*((p2/p1)^((k-1)/k)-1); // power consumption of compressor\n",
+"disp ('kW',Wad,'Power consumption of compressor = ','(b).Adiabatic compression');\n",
+"// (c).Difference between specific work\n",
+"wdiff=(abs(Wad)-abs(Wpoly))/m; // Difference between specific work\n",
+"disp ('kJ/kg',wdiff,'Difference between specific work = ','(c).Difference between specific work');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.15: APPLICATION_OF_SSSF_ENERGY_EQUATION_TO_A_STEAM_TURBINE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"W=500; // Power output from steam turbine in MW\n",
+"Q=10; // Heat loss to surroundings in MW\n",
+"p1=12.5; // Pressure of staem at steam turbine inlet in MPa\n",
+"p2=10; // Pressure of staem at steam turbine outlet in kPa\n",
+"V1=50; // Velocity of steam at steam turbine inlet in m/s\n",
+"V2=100; // Velocity of steam at steam turbine outlet in m/s\n",
+"x2=0.85; // Quality of steam at steam turbine outlet\n",
+"h1=3341.8; // Specific enthalpy of staem at inlet from steam table in kJ/kg\n",
+"hf2=191.83; hg2=2584.7;// Specific enthalpies of fluid and steam at outlet from steam table in kJ/kg\n",
+"h2=(1-x2)*hf2+x2*hg2;// Specific enthalpy of staem at outlet in kJ/kg\n",
+"m=(W-Q)*10^3/((h1-h2)+(V1^2-V2^2)/2000); // Mass flow rate of steam\n",
+"disp ('kg/s',m,'Mass flow rate of steam = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.16: COMBINATION_OF_COMBUSTION_CHAMBER_AIR_TURBINE_AND_NOZZLE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=3; // Pressre of air at state 1 in bar\n",
+"p2=p1; // constant pressure process\n",
+"T1=450; // Temperature of air at state 1 in kelvin\n",
+"T2=1250; // Temperature of air at state 2 in kelvin\n",
+"T3=1000; // Temperature of air at state 3 in kelvin\n",
+"V3=50; // Velocity of air at state 3 in m/s\n",
+"T4=800; // Temperature of air at state 4 in kelvin\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"// (a).Combustion chamber\n",
+"q=Cpo*(T2-T1); // Heat added to air\n",
+"disp ('kJ/kg (round off error)',q,'Heat added to air = ','(a).Combustion chamber');\n",
+"// (b).Turbine \n",
+"k=1.4; // Index of adiabatic process\n",
+"w=Cpo*(T2-T3)-V3^2/2000; // Work done \n",
+"disp ('kJ/kg (round off error)',w,'Work done = ',('(b).Turbine)'));\n",
+"// (c).Nozzle\n",
+"V4=sqrt (2*Cpo*10^3*(T3-T4)+V3^2); // Velocity of air leaving the nozzle\n",
+"disp ('m/s (round off error)',V4,'Velocity of air leaving the nozzle = ','(c).Nozzle');\n",
+"// (d).Pressure drop\n",
+"p3=p2*(T3/T2)^(k/(k-1)); // Pressure of air leaving turbine\n",
+"p4=p3*(T4/T3)^(k/(k-1)); // Pressure of air leaving nozzle\n",
+"disp ('bar ',p4,'Pressure of air leaving nozzle = ','bar',p3,'Pressure of air leaving turbine = ','(d).Pressure drop');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.17: DIFFUSER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"V=1000; // Speed of aircraft in kmph\n",
+"p1=0.35; // Ambient pressure in bar\n",
+"T1=258; // Ambient temperature in kelvin\n",
+"V1=V*1000/3600; // unit conversion kmph into m/s\n",
+"p=1.01325; // Atmospheric pressure in bar\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"k=1.4; // Index of compression process\n",
+"T2=T1+(V1^2)/(2*Cpo*10^3); // The temperature after leaving inlet diffuser\n",
+"p2=p1*(T2/T1)^(k/(k-1)); // Pressure after leaving inlet diffuser\n",
+"r=p/p2; // Pressre ratio of compressor required for pressurization\n",
+"disp ('K',T2,'The temperature after leaving inlet diffuser = ');\n",
+"disp (r,'Pressre ratio of compressor required for pressurization = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.18: AREA_OF_DIFFUSER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=50; // Pressre of steam at diffuser inlet in kPa\n",
+"T1=150; // Temperature of steam at diffuser inlet in degree celcius\n",
+"V1=180; // Velocity of steam at diffuser inlet in m/s\n",
+"A1=1000; // area of diffuser inlet in cm^2\n",
+"V2=90; // Velocity of steam at diffuser outlet in m/s\n",
+"p2=1; // Pressre of steam at diffuser outlet in bar\n",
+"Q=120; // Heat loss to the surroundings in kW\n",
+"v1=3.24; // Specific volume of steam from superheated steam table in m^3/kg at inlet\n",
+"h1=2645.9; // // Specific enthalpy of steam from superheated steam table in m^3/kg at inlet\n",
+"m=V1*A1*10^-4/v1; // Mass flow rate of steam\n",
+"q=Q/m; // Heat transfer per unit mass of steam\n",
+"h2=q+h1+(V1^2-V2^2)/2000; // Specific enthalpy of steam from SSSF energy equationat outlet\n",
+"v2=1.704; // Specific volume of steam from superheated steam table in m^3/kg at outlet\n",
+"A2=m*v2/V2; // Area of diffuser exit \n",
+"disp ('cm^2',A2*10^4,'Area of diffuser exit (Error in textbook)= ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.19: FLASH_CHAMBER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p=0.15; // Pressure of Freon-12 gas in MPa\n",
+"T1=10; // Temperature of Freon-12 gas in degree celcius\n",
+"T2=35; // Temperature of Freon-12 gas in degree celcius\n",
+"h1=196.762; // Specific enthalpy of Freon-12 from table at 1 in kJ/kg \n",
+"h2=69.49; // Specific enthalpy of Freon-12 from table at 2 in kJ/kg \n",
+"h3=178.54; // Specific enthalpy of Freon-12 from table at 3 in kJ/kg \n",
+"// For solving Conservation of mass and SSSF energy equations\n",
+"A=[1 -1; h3 -h2];\n",
+"B=[1 ; h1];\n",
+"M=A\B;\n",
+"disp ('kg/s',M(1),'Mass of saturated vapour at 0.15 MPa = ','kg/s',M(2),'Mass of saturated liquid at 35 oC = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.1: CHARGING_AND_DISCHARGING_OF_BATTERY.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"Q12=-250; // Heat transfer during Discharging of battery in kcal\n",
+"W21=-0.53; // Consumption of electricity dring Charging process in kWh\n",
+"Q21=(W21*3600)-(Q12*4.1868); // First law of thermodynamics\n",
+"disp ('kJ',Q21,'Heat loss from battery during charging process');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.20: EXHAUXT_STEAM_CONDENSER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=15;// Inlet pressure of condenser in kPa\n",
+"x=0.92; // Quality of steam\n",
+"ms=25; // mass flow rate of steam in kg/s\n",
+"d_t=12; // temperature rise of water \n",
+"Cpw=4.1868; // Specific heat of water in kJ/kg K\n",
+"hfg=225.94; h4_3=2599.1; // specific enthalpy in kJ/kg\n",
+"h1=(1-x)*hfg+x*h4_3; // specific enthalpy \n",
+"h2=225.94; // specific enthalpy in kJ/kg\n",
+"Q=ms*(h1-h2); // Heat transfer rate in condenser\n",
+"mw=Q/(Cpw*d_t); // Mass flow rate of water \n",
+"disp ('kg/s',mw,'Mass flow rate of water = ','kW',Q,'Heat transfer rate in condenser = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.2: BOMB_CALORIMETER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=5; // Mass of water in a tank in kg\n",
+"T1=30; // Temperature of water at initial state (1) in degree celcius\n",
+"T2=95; // Temperature of water at final state (2) in degree celcius\n",
+"Qout=70; // Heat transfer from the water tank to the surrounding air in kJ\n",
+"W=75; //Electric energy input to a stirrer inside water in kJ\n",
+"mf=32.3; // Mass of fel in bomb in grams\n",
+"u1=125.78; // Internal energy of water from steam table (uf at T1) in kJ/kg\n",
+"u2=397.88; // Internal energy of water from steam table (uf at T2) in kJ/kg\n",
+"Qf=m*(u2-u1)-W+Qout; // From First law of thermodynamics\n",
+"qf=Qf/(mf*10^-3); // Heat consumption per unit mass of fuel \n",
+"disp ('kJ/kg',qf,'Heat consumption per unit mass of fuel =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.3: CALCULATION_OF_HEAT_TRANSFER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"V=50; // Volume of water in a tank in litres\n",
+"T1=120; // Temperature of water at initial state (1) in degree celcius\n",
+"x1=0.6; // Dryness fraction at initial state (1)\n",
+"T2=-10; // Temperature of water at final state (2) in degree celcius\n",
+"vf1=0.00106; // specific volume of water from steam tables at T1 in m^3/kg\n",
+"vg1=0.8919; // specific volume of water from steam tables at T1 in m^3/kg\n",
+"v1=(1-x1)*vf1+x1*vg1; // Specific volume of misture of liquid and water at state (1)\n",
+"m=(V*10^-3)/v1; // Mass of water in the tank\n",
+"vs2=0.0010891; // Specific volume of saturated ice at T2 in m^3/kg\n",
+"vg2=466.7; // Specific volume of water vapour at T2 in m^3/kg\n",
+"v2=v1; // constant specific volume during cooling process\n",
+"x2=(v2-vs2)/(vg2-vs2); // Dryness fraction at state (2)\n",
+"uf1=503.5; // Specific internal energy at state (1) in kJ/kg\n",
+"ug1=2529.3; // Specific internal energy at state (1) in kJ/kg\n",
+"us2=-354.09; // Specific internal energy at state (2) in kJ/kg\n",
+"ug2=2361.4; // Specific internal energy at state (2) in kJ/kg\n",
+"u1=(1-x1)*uf1+x1*ug1; // Total Specific internal energy at state (1) in kJ/kg\n",
+"u2=(1-x2)*us2+x2*ug2; // Total Specific internal energy at state (2) in kJ/kg\n",
+"Q12=m*(u2-u1); // Heat transfer during cooling pocess\n",
+"disp ('kJ',Q12,'Heat transfer during cooling pocess = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.4: CALCULATION_OF_OVERALL_HEAT_TRANSFER_AND_WORKDONE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"V1=0.3; // Initial volume of water upto stop 1 in m^3\n",
+"p1=1; // Initial pressure of water in bar\n",
+"x1=0.2; // Dryness fraction at initial state (1)\n",
+"p2=3; // Pressur required to lift the piston in bar\n",
+"V4=0.45; // Volume of water upto stop 2 in m^3\n",
+"vf1=0.001043; // Specific volume at state (1) from steam table in m^3/kg\n",
+"vg1=1.694; // Specific volume at state (1) from steam table in m^3/kg\n",
+"v1=vf1+x1*(vg1-vf1); // Total Specific volume at state (1) from steam table in m^3/kg\n",
+"m=V1/v1; // Mass of water\n",
+"v3=V4/m; // Specific volume at stop 2\n",
+"v2=v1; p3=p2; v4=v3; V3=V4; V2=V1; // From process diagram\n",
+"// (a)\n",
+"p4=0.361; // Final Pressure at v4 from steam table in Mpa\n",
+"disp ('MPa',p4,'Fianl pressure = ','(a)');\n",
+"// (b)\n",
+"W14=p2*10^2*(V3-V2); // Work done in process \n",
+"uf1=417.36; // Specific internal energ at initial state in kJ/kg\n",
+"ufg1=2088.7; // Specific internal energ at initial state in kJ/kg\n",
+"u1=uf1+x1*ufg1; // Total Specific internal energr at initial state in kJ.kg\n",
+"u4=2550.2; // Specific internal energ at final state in kJ/kg\n",
+"Q14=m*(u4-u1)+W14; // From first law of thermodynamics\n",
+"disp ('kJ',W14,'Work done during the process = ','(b)');\n",
+"disp ('kJ',Q14,'Heat transfer during the process = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.5: WORKDONE_IN_A_POLYTROPIC_COMPRESSION_PROCESS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"V1=0.01; // Initial Volume of Freon 12 vapour in cylinder in m^3\n",
+"T1=15; // Initial Temperature of Freon 12 vapour in degree celcius\n",
+"p1=4.914; // Initial pressure (Psat at T1) in bar\n",
+"p2=9; // Final pressure of Freon 12 vapour after compression in bar\n",
+"T2=65; // Final temperature of Freon 12 vapour after compression in degree celcius\n",
+"Q=-0.5; // Heat lost to surroundings during compresson process in kJ\n",
+"v1=0.035413; // Initial specific volume of Freon 12 vapour from table in m^3/kg\n",
+"m=V1/v1; // Mass of vapour\n",
+"hg1=193.644; // specific enthalpy of Freon 12 vopour at state 1 in kJ/kg\n",
+"u1=hg1-(p1*10^2*v1); // Total Specific internal energy at state 1\n",
+"h2=222.9; // specific enthalpy of Freon 12 vapour at state 2 in kJ/kg\n",
+"v2=0.022537; // specific volume of Freon 12 vapour at state 2 in m^3/kg\n",
+"u2=h2-(p2*10^2*v2); // Total Specific internal energy at state 2\n",
+"W=-m*(u2-u1)+Q; // From first law of thermodynamics\n",
+"disp ('kJ',W,'Work of compression = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.6: COOLING_OF_ICE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"tS=-10; // initial temperature of ice in degree celcius\n",
+"ts=0; // Melting temperature of ice in degree celcius\n",
+"Cs=1.94; // Specific heat of ice in kJ/kg k\n",
+"m=1000; // Mass of ice in kg\n",
+"tF=10; // Temperature of water after 24 hours in degree celcius\n",
+"tf=0; // Freezing temperature of water in degree celcius\n",
+"Cf=4.1868; // Specific heat of water in kJ/kg K\n",
+"hsg=335; // Latent heat of fusion of ice in kJ/kg\n",
+"Q=m*(Cs*(ts-tS)+hsg+Cf*(tF-tf)); // Heat gain of water\n",
+"Q_dot=Q/(24*3600); // Rate of cooling\n",
+"disp ('kW',Q_dot,'Rate of cooling = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.7: CHANGE_IN_ENTHALPY_OF_AIR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T1=300; // Temperature of air at state 1 in Kelvin\n",
+"T2=500; // Temperature of air at state 2 in Kelvin\n",
+"m_=28.966; // Molecular weight oh air in kg\n",
+"Cpoav=1.017; // Average value of specific heat of air in kJ/kg K\n",
+"// (a). change in enthalpy\n",
+"h_=27.43*(T2-T1)+3.09*10^-3*(T2^2-T1^2)-0.2296*10^-6*(T2^3-T1^3); //change in enthalpy during process in kJ/kmol\n",
+"h=h_/m_; // change in enthalpy during process in kJ/kg\n",
+"disp ('kJ/kg',h,'(a).change in enthalpy during process = ');\n",
+"// (b).change in enthalpy\n",
+"h=Cpoav*(T2-T1); // change in enthalpy in kJ/kg\n",
+"disp ('kJ/kg',h,'(b).change in enthalpy during process with average specfic heat = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.8: DIRECTION_AND_MAGNITUDE_OF_WORKDONE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=0.1; // mass of nitrogen gas in kg\n",
+"V1=0.1; // Initial volme of nitrogen gas in m^3\n",
+"p1=1.2; // Initial pressure of nitrogen gas in bar\n",
+"V2=0.075; // Final volume of nitrogen gas in m^3\n",
+"Cpo=1.041; // Specific heat at constant pressure of nitrogen in kJ/kg K\n",
+"R=0.2969393; // Characteristic gas constant of nitrogen in Kj/kg K\n",
+"T1=(p1*10^2*V1)/(m*R); // Initial temperature of nitrogen gas \n",
+"T2=T1*(V2/V1); // Final temperature of nitrogen gas (constant pressure process)\n",
+"Q=m*Cpo*(T2-T1); // Heat transfer to surroundings\n",
+"W=p1*10^2*(V2-V1); // Work done\n",
+"disp ('K',T2,'Final Temperature of nitrogen gas = ');\n",
+"disp ('kJ',Q,'Heat transfer to surroundings = ');\n",
+"disp ('The Work is done on the gas','kJ',W,'Work done = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5.9: QUASI_EQUILIBRIUM_PROCESS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p=1; // pressure inside piston cylinder arrangement in MPa\n",
+"// stae 1 = saturated liquid\n",
+"// state 2 = saturated vapour\n",
+"// state 3 = superheated vapour\n",
+"v1=0.001127; // specific volume at state 1 in m^3/kg\n",
+"v2=0.19444; // specific volume at state 2 in m^3/kg\n",
+"v3=0.4011; // specific volume at state 3 in m^3/kg\n",
+"u1=761.68; // specific internal energy at state 1 in kK/kg\n",
+"u2=2583.6; // specific internal energy at state 2 in kK/kg\n",
+"u3=3296.8; // specific internal energy at state 3 in kK/kg\n",
+"h1=762.81; // specific enthalpy at state 1 in kJ/kg\n",
+"h2=2778.1; // specific enthalpy at state 2 in kJ/kg\n",
+"h3=3697.9; // specific enthalpy at state 3 in kJ/kg\n",
+"w12=p*10^3*(v2-v1); // Work done during process 1-2\n",
+"w23=p*10^3*(v3-v2); // Work done during process 2-3\n",
+"wtotal=w12+w23; // Total work done\n",
+"disp ('kJ/kg',wtotal,'Work done = ');\n",
+"// Calculation of heat transfer\n",
+"// Method I\n",
+"q12=(u2-u1)+w12; // Heat transfer during process 1-2\n",
+"q23=(u3-u2)+w23; // Heat transfer during process 2-3\n",
+"qtotal=q12+q23; // Total Heat transfer\n",
+"disp ('kJ/kg',qtotal,'Heat Transfer = ','Method I','Calculation of Heat Transfer');\n",
+"// Method II\n",
+"q12=h2-h1; // Heat transfer during process 1-2\n",
+"q23=h3-h2; // Heat transfer during process 2-3\n",
+"qtotal=q12+q23; // Total Heat transfer\n",
+"disp ('kJ/kg',qtotal,'Heat Transfer = ','Method II');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/6-SECOND_LAW_OF_THERMODYNAMICS_AND_ENTROPY.ipynb b/Thermodynamics_by_C_P_Arora/6-SECOND_LAW_OF_THERMODYNAMICS_AND_ENTROPY.ipynb
new file mode 100644
index 0000000..d45ba47
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/6-SECOND_LAW_OF_THERMODYNAMICS_AND_ENTROPY.ipynb
@@ -0,0 +1,676 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6: SECOND LAW OF THERMODYNAMICS AND ENTROPY"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.10: ENTROPY_CHANGE_OF_AIR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=3; // initial pressure of air in bar\n",
+"T1=200; // initial temperature of air in degree celcius\n",
+"p2=1.5; // final pressure of air in bar\n",
+"T2=105; // final temperature of air in degree celcius\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"delta_s= Cpo*log (T2/T1)- R*log (p2/p1); // change in entropy during irreversible process\n",
+"disp ('kJ/kg K',delta_s,'change in entropy during irreversible process = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.11: ENTROPY_CHANGE_OF_ARGON_GAS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=5; // Initial pressure of argon gas in bar\n",
+"T1=30; // Initial temperature of argon gas in degree celcius\n",
+"v1=1; // Initial volume of argon gas in m^3 by assumption\n",
+"v2=2*v1; // Final volume of argon gas in m^3\n",
+"R=8.3144/40; // Characteristic gas constant of argon gas in kJ/kg K\n",
+"p2=p1*(v1/v2); // Final pressure of argon gas\n",
+"delta_s= R*log (v2/v1); // change in entropy (choosing the reversible isothermal path)\n",
+"disp ('kJ/kg K',delta_s,'change in entropy (choosing the reversible isothermal path) = ','bar',p2,'Final pressure of argon gas =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.12: INTERNAL_COMBUSTION_ENGINE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=1; // Atmospheric pressure in bar\n",
+"T1=348; // Atmospheric temperature in kelvin\n",
+"V1=800; // Volume of air sucked into the cylinder in cm^3\n",
+"p2=15; // pressure of air after compression in bar\n",
+"V2=V1/8; // volume of air after compression in cm^3\n",
+"p3=50; // pressure of air after heat addition in bar\n",
+"Cvo=0.7165; // Specific heat at constant volme in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"// (a).Index of compression process\n",
+"n=log (p2/p1)/log (V1/V2); // Index of compression process\n",
+"disp ('which is less than 1.4. The compression process is polytropic.',n,'Index of compression process = ','(a).Index of compression process');\n",
+"// (b).Change in entropy of air during each process\n",
+"m=(p1*10^2*V1*10^-6)/(R*T1); // Mass of air in cylinder\n",
+"T2=T1*(p2/p1)*(V2/V1); // Temperature after compression\n",
+"T3=T2*(p3/p2); // Temperature after heat addition\n",
+"delta_s21=m*(Cvo*log (T2/T1)+R*log (V2/V1)); // change in entropy during compression\n",
+"delta_s32=m*Cvo*log (T3/T2); //change in entropy during heat addition\n",
+"disp ('kJ/K',delta_s32,'change in entropy during heat addition = (Error in textbook)','kJ/K',delta_s21,'change in entropy during compression = (Error in textbook)','(b).Change in entropy of air during each process');\n",
+"// (c).Heat transfer during polytropic compression process\n",
+"k=1.4;// Index of isentropic preocess\n",
+"Q=m*Cvo*((k-n)/(1-n))*(T2-T1); // Heat transfer during polytropic compression process\n",
+"disp ('kJ',Q,'Heat transfer during polytropic compression process = (Error in textbook)','(c).Heat transfer during polytropic compression process');\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.13: FREE_EXPANSION_OF_STEAM.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=0.3; // initial pressure of ateam in MPa\n",
+"T1=350; // Initial temperature of steam in degree celcius\n",
+"// following are the values taken from steam table for initial state \n",
+"v1=0.9535; // specific volume in m^3/kg\n",
+"u1=2886.2; // specific internal energy in kJ/kg\n",
+"s1=7.868; // specific entropy in kJ/kg K\n",
+"v2=2*v1; // final specific volume of steam\n",
+"u2=u1;\n",
+"// following are the values taken from steam table final state\n",
+"T2=349; // Final temperature of steam in degree celcius\n",
+"p2=0.167; // Final pressure of ateam in MPa\n",
+"s2=8.164; // specific entropy in kJ/kg K\n",
+"delta_s=s2-s1; // Entropy generation\n",
+"LW=(T1+T2)/2 * delta_s; // Lost work\n",
+"disp ('kJ',LW,'Lost work = ','kJ/kg K',delta_s,'Entropy Generation =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.15: ENTROPY_CHANGE_OF_UNIVERSE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=1; // Mass of water in kg\n",
+"T1=300; // Temperature of water in kelvin\n",
+"C=4.1868; // Specific heat in kJ/kg K\n",
+"// (a). Heat Transfer\n",
+"T2=500; // Temperature of heat reservoir in kelvin\n",
+"Q=m*C*(T2-T1); // Heat transfer\n",
+"del_Swater=m*C*log (T2/T1); // Entropy change of water\n",
+"del_Sreservoir=-Q/T2; // Entropy change of reservoir\n",
+"del_Suniverse=del_Swater+del_Sreservoir; // Entropy change of universe\n",
+"disp ('kJ/K',del_Suniverse,'Entropy change of universe =','(a).Heat Transfer');\n",
+"// (b).Heat Transfer in each reservoir\n",
+"T2=400; // Temperature of intermediate reservoir in kelvin\n",
+"T3=500; // Temperature of heat reservoir in kelvin\n",
+"Q=m*C*(T3-T2); // Heat transfer\n",
+"del_Swater=m*C*(log (T2/T1)+log (T3/T2)); // Entropy change of water\n",
+"del_SreservoirI=-Q/T2; // Entropy change of reservoir I\n",
+"del_SreservoirII=-Q/T3; // Entropy change of reservoir II\n",
+"del_Suniverse=del_Swater+del_SreservoirI+del_SreservoirII; // Entropy change of universe\n",
+"disp ('kJ/K',del_Suniverse,'Entropy change of universe =','(b).Heat Transfer in each reservoir');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.16: AFFECTING_REVERSIBLE_HEAT_TRANSFER_THROUGH_A_FINITE_TEMPERATURE_DIFFERENCE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=1; // Mass of saturated steam in kg\n",
+"T=100; // Teamperature of steam in degree celcius\n",
+"T0=303; // temperature of Surroundings in kelvin\n",
+"hfg=2257; // Latent heat of evaporation in kJ/kg\n",
+"sfg=6.048; // specific entropy in kJ/kg K\n",
+"// (a).Entropy change\n",
+"Q=m*hfg; // Heat transfer\n",
+"del_Ssystem=-m*sfg; // Change of entropy of system\n",
+"del_Ssurr=Q/T0; // Change of entropy of surroundings\n",
+"del_Suniverse=del_Ssystem+del_Ssurr; // Change of entropy of universe\n",
+"disp ('kJ/K',del_Suniverse,'Change of entropy of universe =','kJ/K',del_Ssurr,'Change of entropy of surroundings =','kJ/K',del_Ssystem,'Change of entropy of system =','(a).Entropy change');\n",
+"// (b).Effect of heat transfer\n",
+"del_Suniverse=0; // process is reversible\n",
+"del_Ssurr=del_Suniverse-del_Ssystem; //Change of entropy of surroundings\n",
+"QH=hfg; // Heat transfer from the condensing steam to reversible heat engine\n",
+"QL=T0*del_Ssurr; // Heat receiveded by the surroundins reversible heat engine\n",
+"W=QH-QL; //work output of reversible heat engine\n",
+"disp ('Difference between QH & QL is converted into work output in a reversible cyclic process','kJ',W,'work output of reversible heat engine =','kJ',QL,'Heat receiveded by the surroundins reversible heat engine =','kJ',QH,'Heat transfer from the condensing steam to reversible heat engine =','(b).Effect of heat transfer');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.17: ENTROPY_CHANGE_OF_ICE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=1; // Mass of ice in kg\n",
+"T1=258;// Temperature of ice in kelvin\n",
+"Tm=273; // Melting point of ice in kelvin\n",
+"T2=303; // temperature of Surroundings in kelvin\n",
+"Cpice=2.095; // Specific heat of ice in kJ/kg K\n",
+"hsg=333.5; // Latent heat of fusion in kJ/kg\n",
+"Cpw=4.1868; // Specific heat of water in kJ/kg K\n",
+"// (a).Change of entropy\n",
+"Q=m*(Cpice*(Tm-T1)+hsg+Cpw*(T2-Tm));// Heat transfer\n",
+"del_Ssystem=m*((Cpice*log (Tm/T1))+(hsg/Tm)+(Cpw*log (T2/Tm)));// Change of entropy of system\n",
+"del_Ssurr=-Q/T2; // Change of entropy of surroundings\n",
+"del_Suniverse=del_Ssystem+del_Ssurr; // Change of entropy of universe\n",
+"disp ('kJ/K',del_Suniverse,'Change of entropy of universe =','kJ/K',del_Ssurr,'Change of entropy of surroundings =','kJ/K',del_Ssystem,'Change of entropy of system =','(a).Entropy change');\n",
+"// (b).The minimum work of restoring water back to ice\n",
+"QL=Q; // Refrigerating effect\n",
+"W=T2*del_Ssystem-QL; // The minimum work of restoring water back to ice\n",
+"disp ('kJ',W,'(b).The minimum work of restoring water back to ice = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.18: DIRECTION_OF_AIR_FLOW.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"TA=323;// Temperature at section A in kelvin\n",
+"PA=125; // Pressure at section A in kPa\n",
+"TB=287;// Temperature at section B in kelvin\n",
+"PB=100; // Pressure at section B in kPa\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"SBA=(Cpo*log (TB/TA))-(R*log (PB/PA)); // Change in entropy\n",
+"disp('Hence SA>SB. Therefore B to A','kJ/kg',SBA,'Change in entropy from B to A =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.19: ADIABATIC_TURBINE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=12.5; // Pressure of steam at inlet in MPa\n",
+"T1=500; // Temperature of steam at inlet in degree celcius\n",
+"V1=50; // Velocity of steam at inlet in m/s\n",
+"p2=10; // Pressure of steam at outlet in kPa\n",
+"V2=100; // Velocity of steam at outlet in m/s\n",
+"// (a).Actual expansion\n",
+"x2=0.85; // Quality of steam\n",
+"// From steam table\n",
+"h1=3341.8; hf2=191.83; hg2=2584.7; // specific enthalpy in kJ/kg \n",
+"s1=6.4618; sf2=0.6493; sfg2=7.5009; // specific entropy in kJ/kg K\n",
+"h2a=(1-x2)*hf2+x2*hg2; // specific enthalpy in kJ/kg \n",
+"wa=(h1-h2a)+((V1^2-V2^2)/2000); // Actual work output\n",
+"disp ('kJ',wa,'(a).Actual work output of turbine = ');\n",
+"// (b).Reversible adiabatic expansion\n",
+"x2s=(s1-sf2)/sfg2; // Quality of steam after reversible adiabatic expansion\n",
+"h2s=(1-x2s)*hf2+x2s*hg2; // specific enthalpy in kJ/kg \n",
+"ws=(h1-h2s)+((V1^2-V2^2)/2000); // Reversible adiabatic work output\n",
+"L=ws-wa; // Lost of work\n",
+"disp ('kJ/kg',L,'Lost of work due to irreversibity of expansion process =','kJ/kg',ws,'Reversible adiabatic work output = ','(b).Reversible adiabatic expansion');\n",
+"// (c).Entropy Generation\n",
+"s2a=sf2+x2*sfg2; // actual specific entropy in kJ/kg K\n",
+"Sgen=s2a-s1; // Entropy generation\n",
+"disp ('kJ/kg K',Sgen,'(c).Entropy Generation =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.1: CLAIM_OF_THE_MANUFACTURE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"QH=500; // Heat supplied in kJ\n",
+"QL=200; // Heat rejected in kJ\n",
+"TH=720; // Resorvior Temperature in kelvin\n",
+"TL=360; // Resorvior Temperature in kelvin\n",
+"W=260; // Work developed in kJ\n",
+"e_max=1-TL/TH; // maximum efficiency\n",
+"e_clamied=W/QH; // Efficiency clamied\n",
+"if (e_clamied<e_max) then\n",
+" disp ('It obeys the second law of thermodynamics.The claim is true');\n",
+"else \n",
+" disp ('It violates the second law of thermodynamics.The claim is False');\n",
+"end"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.20: COMPARSION_OF_PUMP_WORK_AND_COMPRESSOR_WORK.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=0.1; // pressure at state 1 in MPa\n",
+"p2=6; // Pressure at state 2 in MPa\n",
+"// (a).Pump work for water\n",
+"vf1=0.001043; // specific volume in m^3/kg\n",
+"wp=-vf1*(p2-p1)*10^3; // Pump work for water\n",
+"disp ('kJ',wp,'(a).Pump work for water =');\n",
+"// (b).For steam\n",
+"h1=2675.5;// specific enthalpy in kJ/kg \n",
+"s1=7.3595;// specific entropy in kJ/kg K\n",
+"// From superheated steam table\n",
+"t2=675; // Temperature at state 2 in degree celcius\n",
+"h2=3835.3;// specific enthalpy in kJ/kg \n",
+"wc=-(h2-h1); // Compressor work for steam\n",
+"disp ('kJ/kg',wc,'(b).Compressor work for steam =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.21: THROTTLING_PROCESS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// (a).Restoring to initial state by throttling process\n",
+"T1=303; //Temperature of air at state 1 in kelvin\n",
+"p1=1; //Pressure of air at state 1 in bar\n",
+"p2=5; //Pressure of air at state 2 in bar\n",
+"p3=1;//Pressure of air at state 3 in bar\n",
+"T3=303; //Temperature of air at state 3 in kelvin\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"k=1.4; // Index of reversible adiabatic compression\n",
+"T2=T1*(p2/p1)^((k-1)/k); // Temperature after reversible adiabatic compression\n",
+"w12=Cpo*(T2-T1); // Work of reversible adiabatic compression\n",
+"s21=0; // Entropy change of air\n",
+"s32=-R*log (p3/p2); // Entropy change \n",
+"s31=s32; // Net entropy change of air\n",
+"d_Ssurr=0; // Entropy change of surroundings because There is no heat transfer\n",
+"d_Suniv=s31+d_Ssurr; // Net Entropy change of universe\n",
+"disp ('kJ/kg K',d_Suniv,'Net Entropy change of universe = ','kJ/kg',w12,'Work of reversible adiabatic compression = ','(a).Restoring to initial state by throttling process');\n",
+"// (b).Restoring to initial state by by completing cycle\n",
+"T0=298; // Temperature of surroundings in kelvin\n",
+"d_Ssystem=0; // Entropy change of systrem is zero because it is cyclic process\n",
+"q31=Cpo*(T2-T3); // Heat rejected to the surroundings\n",
+"d_Ssurr=q31/T0; // Entropy change of surroundings\n",
+"d_Suniv=d_Ssystem+d_Ssurr; // Increase in entropy of the universe\n",
+"disp ('kJ/kg K',d_Suniv,'Net Entropy change of universe = ','(b).Restoring to initial state by by completing cycle');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.2: CHECKING_OF_REVERSIBLE_IRREVERSIBLE_OR_IMPOSSIBLE_MACHINE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"QH=325; // Heat supplied in kJ\n",
+"QL=125; // Heat rejected in kJ\n",
+"TH=1000; // Resorvior Temperature in kelvin\n",
+"TL=400; // Resorvior Temperature in kelvin\n",
+"W=200; // Work developed in kJ\n",
+"e_carnot=1-TL/TH; // maximum efficiency\n",
+"e_clamied=W/QH; // Efficiency clamied\n",
+"disp (e_carnot,'e_carnot =');\n",
+"disp (e_clamied,'e_clamied =');\n",
+"if (e_carnot==e_clamied) then\n",
+" disp ('The machine is reversible');\n",
+"elseif (e_carnot>e_clamied)\n",
+" disp ('The machine is irreversible');\n",
+"else\n",
+" disp ('Here e_clamied > e_carnot so the cyclic machine is impossible.')\n",
+"end\n",
+"disp ('It would be reversible if its thermal efficiency is equal to Carnot efficiency, and irreversible if it is less than Carnot efficiency.')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.3: A_CARNOT_REFRIGERATION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// Air conditioning unit\n",
+"TL=278; // Operating temperature in kelvin\n",
+"TH=318; // Operating temperature in kelvin\n",
+"COP1=TL/(TH-TL); // COP of Air conditioning unit\n",
+"QL=1; // For some calculation purpose\n",
+"W1=QL/COP1; // Work input of Air conditioning unit\n",
+"// Food refrigeration unit\n",
+"TL=258; // Operating temperature in kelvin\n",
+"TH=318; // Operating temperature in kelvin\n",
+"COP2=TL/(TH-TL); // COP of Food refrigeration unit\n",
+"W2=QL/COP2; // Work input of Food refrigeration unit\n",
+"Wper=(W2-W1)/W1; // Increase in work input\n",
+"disp ('%',Wper*100,'Increase in work input = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.4: YEAR_ROUND_AIR_CONDITIONING_UNIT.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"//(a).Summer air conditioning (cooling)\n",
+"TL=298; // Operating temperature in kelvin\n",
+"TH=318; // Operating temperature in kelvin\n",
+"q=0.75; // Heat Transfer from fabric of room per degree of temperature difference in kW\n",
+"QL=q*(TH-TL); // Heat Transfer from fabric of room\n",
+"COPc=TL/(TH-TL); // COP of Air conditioning unit\n",
+"W=QL/COPc; // Work input of Air conditioning unit\n",
+"disp ('kW',W,'Work input of Air conditioning unit = ','(a).Summer air conditioning (cooling)');\n",
+"// (b).Winter air conditioning (recerse cycle heating)\n",
+"TH=293; // Operating temperature in kelvin\n",
+"TL=(-(-2*q*TH)-sqrt ((-2*q*TH)^2-(4*q*(q*TH^2-TH))))/(2*q);// Lowest outdoor Temperature by root\n",
+"disp ('K',TL,'Lowest outdoor Temperature = ','(b).Winter air conditioning (recerse cycle heating)');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.5: DECREASE_IN_COP_WITH_LOWERING_OF_REFRIGERATION_TEMPERATURE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"// (a).For the refrigerator \n",
+"TL=258; // Operating temperature in kelvin\n",
+"TH=313; // Operating temperature in kelvin\n",
+"QL=3.5167; // Ton of refrigeration in kW\n",
+"COP=TL/(TH-TL); // COP of Refrigeration unit\n",
+"W=QL/COP; // Power comsumption of refrigerator\n",
+"disp ('kW',W,'Power comsumption of refrigerator = ','(a).For the refrigerator');\n",
+"// (b). For the freezer\n",
+"TL=248; // Operating temperature in kelvin\n",
+"TH=313; // Operating temperature in kelvin\n",
+"COP=TL/(TH-TL); // COP of Freezer unit\n",
+"QL=W*COP; // Refrigeration produced\n",
+"disp ('kW',QL,'Refrigeration produced = ','(b). For the freezer')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.6: CALCULATION_OF_ENTROPY_OF_VAPORIZATION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"Psat=200;//Pressure of water in kPa\n",
+"Tsat=393.38; // Saturation temperaure at Psat in kelvin\n",
+"// (i).From the equation Tds=du+pdv \n",
+"// Following are from steam table at Psat\n",
+"ufg=2025; // specific internal energy of vapourization in kJ/kg\n",
+"vg=0.8857; // specific volume in m^3/kg\n",
+"vf=0.001061; // specific volume in m^3/kg\n",
+"sfg=(ufg/Tsat)+(Psat*(vg-vf)/Tsat); // specific entropy of vapourization\n",
+"disp ('kJ/kg K',sfg,'specific entropy of vapourization = ','(i).From the equation Tds=du+pdv ');\n",
+"// (ii).From the equation Tds=dh-vdp\n",
+"hfg=2201.9; // Specific enthalpy of vapourization in kJ/kg\n",
+"sfg=hfg/Tsat; // specific entropy of vapourization\n",
+"disp ('kJ/kg K',sfg,'specific entropy of vapourization = ','(ii).From the equation Tds=dh-vdp ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.7: REVERSIBLE_ISOTHERMAL_PROCESS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=1; // Pressure of steam at state 1 in bar\n",
+"T=473; // Temperature of steam at state 1 in kelvin\n",
+"// (i).Pressure after compression\n",
+"p2=1.5538; // Pressure after compression at (Psat)T from steam table in MPa\n",
+"disp ('MPa',p2,'Pressure after compression = ','(i).Pressure after compression');\n",
+"// (ii).Heat Transfer and work done during the process\n",
+"// Following are from steam table \n",
+"s2=6.4323; // specific entropy of steam at state 2 in kJ/kg K\n",
+"s1=7.8343; // specific entropy of steam at state 1 in kJ/kg K\n",
+"u2=2595.3; // specific internal energy of steam at state 2 in kJ/kg \n",
+"u1=2658.1; // specific internal energy of steam at state 1 in kJ/kg \n",
+"q=T*(s2-s1); // Heat transfer during the process\n",
+"w=q-(u2-u1); // Work done during the process\n",
+"disp ('kJ',w,'Work done during the process = ','kJ',q,'Heat transfer during the process = ','(ii).Heat Transfer and work done during the process');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 6.8: ENTROPY_CHANGE_OF_STEAM.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=6; // Initial pressure of steam in MPa\n",
+"T1=500; // Initial temperature of steam in degree celcius\n",
+"p2=10; // Final pressure of steam in bar\n",
+"// From steam tables\n",
+"s1=6.8803; sf2=1.3026; sfg2=6.0568; // specific entropy in kJ/kg K\n",
+"u1=3082.2; uf2=761.68; ufg2=1822; // specific internal energy in kJ/kg\n",
+"v1=0.05665; vf2=0.001043; vg2=1.694; // specific volume in m^3/kg\n",
+"x2=(v1-vf2)/(vg2-vf2);// Quality of steam\n",
+"u2=uf2+x2*ufg2; // specific internal energy in kJ/kg \n",
+"s2=sf2+x2*sfg2; // specific entropy in kJ/kg K\n",
+"s21=s2-s1; // Entropy change\n",
+"q=u2-u1; // Heat transfer\n",
+"disp ('kJ',q,'Heat transfer for the process =','kJ/kg',s21,'Entropy change of the process = ');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/7-COMBINED_FIRST_AND_SECOND_LAWS_APPLICATION_TO_PROCESS.ipynb b/Thermodynamics_by_C_P_Arora/7-COMBINED_FIRST_AND_SECOND_LAWS_APPLICATION_TO_PROCESS.ipynb
new file mode 100644
index 0000000..d5ff7e8
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/7-COMBINED_FIRST_AND_SECOND_LAWS_APPLICATION_TO_PROCESS.ipynb
@@ -0,0 +1,624 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7: COMBINED FIRST AND SECOND LAWS APPLICATION TO PROCESS"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.10: NOZZLE_VELOCITY.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=3; // Pressure of fluid at inlet in bar\n",
+"T1=150; // Temperature of fluid at inlet in degree celcius\n",
+"V1=90; // Velocity of fluid at inlet in m/s \n",
+"eff_nozzle=0.85; // Nozzle efficiency\n",
+"k=1.4; // Index of reversible adiabatic process\n",
+"p2=1/3*p1;\n",
+"// (a).Steam\n",
+"// Following are taken from steam table\n",
+"h1=2761; // specific enthalpy in kJ/kg \n",
+"s1=7.0778;// specific entropy in kJ/kg K\n",
+"s2s=s1; // Isentropic process\n",
+"sf2s=1.3026; sfg2s=6.0568;// specific entropy in kJ/kg K\n",
+"hf2=417.46; hfg2=2258; // specific enthalpy in kJ/kg \n",
+"x2s=(s2s-sf2s)/sfg2s; // Quality of steam\n",
+"h2s=hf2+x2s*hfg2;\n",
+"V2s=sqrt (2000*(h1-h2s)+V1^2); // Isentropic Velocity \n",
+"V2=sqrt (eff_nozzle) *V2s; // Actual nozzle exit velocity\n",
+"disp ('m/s (round off error)',V2,' Actual nozzle exit velocity = ','(a).Steam');\n",
+"// (b).Air\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"T2s=(T1+273)*(p2/p1)^((k-1)/k); // Isentropic temperature\n",
+"V2s=sqrt ((2000*Cpo*((T1+273)-T2s))+V1^2); // Isentropic Velocity and (answer mentioned in the textbook is wrong)\n",
+"V2=sqrt (eff_nozzle) *V2s; // Actual nozzle exit velocity\n",
+"disp ('m/s (answer mentioned in the textbook is wrong)',V2,' Actual nozzle exit velocity = ','(b).Air');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.11: DIFFUSION_PROCESS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=200; // Pressure of fluid at inlet in kPa\n",
+"T1=200; // Temperature of fluid at inlet in degree celcius\n",
+"V1=700; // Velocity of fluid at inlet in m/s \n",
+"V2=70; // Velocity of fluid at outlet in m/s \n",
+"// (a).Reversible Adiabatic process\n",
+"// state of steam entering diffuser (superheated)\n",
+"h1=2870.5;// specific enthalpy in kJ/kg \n",
+"s1=7.5066; // specific entropy in kJ/kg K\n",
+"h2=h1+(V1^2-V2^2)/2000; // From first and second laws\n",
+"s2=s1; // Isentropic peocess\n",
+"// From superheated table\n",
+"p2s=550; // Pressure of fluid at outlet in kPa\n",
+"T2=324; // Temperature of fluid at outlet in degree celcius\n",
+"disp ('oC',T2,'Temperature of fluid at outlet =','kPa',p2s,'Pressure of fluid at outlet = ','(a).Reversible adiabatic process');\n",
+"// (b).Actual diffusion\n",
+"// for the same change in K.E, from first law\n",
+"h2=3113.1;// specific enthalpy in kJ/kg\n",
+"p2=400; // Actual exit pressure in kPa\n",
+"t2=322.4; // from superheated table in degree celcius\n",
+"eff_d=(p2-p1)/(p2s-p1); // Diffuser efficiency\n",
+"disp ('%',eff_d*100,'Diffuser efficiency = ','oC',t2,'The exit temperature =','(b).Actual diffusion');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.12: REVERSIBLE_ADIABATIC_EFFICIENCY_OF_DIFFUSER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=1; // Pressure of fluid at inlet in bar\n",
+"T1=60; // Temperature of fluid at inlet in degree celcius\n",
+"p2=2.8; // Pressure of fluid at outlet in bar\n",
+"eff_d=0.80; // Diffuser efficiency\n",
+"k=1.4; // Index of reversible adiabatic process\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"// (a).Actual Diffuser\n",
+"p2s=((p2-p1)/eff_d)+p1; // Isentropic pressure\n",
+"T2=(T1+273)*(p2s/p1)^((k-1)/k); // Exit temperature\n",
+"V1=sqrt (2000*Cpo*(T2-(T1+273))); // Initial Velocity\n",
+"disp ('m/s',V1,'Initial Velocity =','K',T2,'Temperature of air leaving diffuser =','(a).Actual Diffuser');\n",
+"// (b).Reversible Adiabatic diffuser\n",
+"T2s=(T1+273)*(p2/p1)^((k-1)/k); // Isentropic exit temperature\n",
+"V1=sqrt (2000*Cpo*(T2s-(T1+273))); // Initial Velocity\n",
+"disp ('m/s',V1,'Initial Velocity =','K',T2s,'Temperature of air leaving diffuser =','(b).Reversible Adiabatic diffuser');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.13: USE_OF_EXHAUST_GAS_DIFFUSER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=18; // mass flow rate of air in kg/s\n",
+"p1=3.6; // Pressure of fluid at inlet of turbine in MPa\n",
+"T1=800; // Temperature of fluid at inlet of turbine in Kelvin\n",
+"V1=100; // Velocity of fluid at inlet of turbine in m/s \n",
+"V2=150; // Velocity of fluid at outlet of turbine in m/s\n",
+"W=3.6; // Power output of turbine in MW\n",
+"p3=1.01; // pressure at diffuser outlet in bar\n",
+"k=1.4; // Index of reversible adiabatic process\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"// (a) Pressure at diffuser inlet\n",
+"T2=((Cpo*T1)-((W*10^3)/m+(V2^2-V1^2)/2000))/Cpo; // Temperature at outlet of turbine\n",
+"T3=(T2+273)+((V2^2)/(2*Cpo*10^3)); // Temperature of fluid at diffuser inlet\n",
+"p2=p3*((T2+273)/T3)^(k/(k-1)); //pressure at diffuser inlet\n",
+"disp ('bar',p2,'(a).pressure at diffuser inlet =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.14: FLASHING_DURING_THROTTLING.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T1=35; // Temperature of freon 12 before throttling in degree celcius\n",
+"T2=5; // Temperature of freon 12 after throttling in degree celcius\n",
+"// from property table of freon 12\n",
+"h1=69.49;// specific enthalpy in kJ/kg \n",
+"hf2=40.66; hfg2=148.86; // specific enthalpy in kJ/kg \n",
+"h2=h1; // throttling process\n",
+"x2=(h2-hf2)/hfg2; // Quality of Freon 12 vapour\n",
+"disp (x2,'Quality of Freon 12 vapour = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.15: SEPARATING_AND_THROTTLING_CALORIMETER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p2=276; // Pressure at inlet in kPa\n",
+"p=6.5; // gauge pressure at outlet in cm Hg\n",
+"T3=110; // Temperature at outlet in degree celcius\n",
+"pa=756; // Barometric pressure in mm Hg\n",
+"mc=760;// Mass of condensed steam in g\n",
+"ms=25; // Mass of separated water in g\n",
+"den=13600; // Density of mercury in kg/m^3\n",
+"g=9.81; // Acceleration due to gravity in m/s^2\n",
+"z=(pa*10^-3)+(p*10^-2);// absolute pressure in m Hg\n",
+"p3=den*g*z; // Pressure after throttling\n",
+"h3=2697.4;// specific enthalpy in kJ/kg \n",
+"hf2=545.31; hfg2=2175.2; // specific enthalpy in kJ/kg \n",
+"x2=(h3-hf2)/hfg2; // Quality of steam\n",
+"x1=(mc/(mc+ms))*x2; // Quality of steam in the main line\n",
+"disp (x1,'Quality of steam in the main line =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.1: CHANGE_IN_ENTROPY_OF_THE_FLUID.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=1; // Initial pressure of fluid in MPa\n",
+"T1=250; // Initial temperture of fluid in degree celcius\n",
+"V=0.28; // Volume of container in m^3\n",
+"p2=0.35; // Initial pressure of the fluid in MPa\n",
+"// (a).Water\n",
+"v1=0.2327; // specific volume of vapour from steam table at state 1 in m^3/kg\n",
+"v2=v1; // constant volume process\n",
+"vf2=0.001079; vfg2=0.5232; // specific volume of vapour from steam table at state 2 in m^3/kg\n",
+"m=V/v1; // mass of steam\n",
+"x2=(v2-vf2)/vfg2; // quality of steam at state 2\n",
+"t2=138.88; // Final temperature of fluid in degree celcius (saturation temperature at p2)\n",
+"// following are the values taken from steam tables\n",
+"u1=2709.9; // specific internal energy at state 1 in kJ/kg\n",
+"s1=6.9247; // Specific entropy at state 1 in kJ/kg K\n",
+"uf2=582.95; ug2=2548.9; // specific internal energy at state 2 in kJ/kg\n",
+"sf2=1.7245; sg2=6.9405; // Specific entropy at state 2 in kJ/kg K\n",
+"u2=(1-x2)*uf2+x2*ug2; // specific internal energy at state 2 \n",
+"s2=(1-x2)*sf2+x2*sg2; // specific enropy at state 2 \n",
+"Q=m*(u2-u1); // Heat transferred\n",
+"S21=m*(s2-s1); // Entropy change\n",
+"disp ('kJ/kg K (round off error)',S21,'Entropy change = ','kJ (answer mentioned in the textbook is wrong)',Q,'Heat transferred = ','oC',t2,'Final Temperature = ','(a).Water');\n",
+"// (b).Air\n",
+"Cvo=0.7165; // Specific heat at constant volume in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"m=(p1*10^3*V)/(R*(T1+273)); // Mass of air\n",
+"T2=(p2/p1)*(273+T1); // Final temperature of air\n",
+"Q=m*Cvo*(T2-(T1+273)); // Heat transferred\n",
+"S21=m*Cvo*log (T2/(273+T1)); // Change in entropy\n",
+"disp ('kJ/kg K (round off error)',S21,'Entropy change = ','kJ (round off error)',Q,'Heat transferred = ','K ',T2,'Final Temperature = ','(b).Air');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.2: EXPANSION_OF_FLUID.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=1.0021; // Initial pressure of the fluid in MPa\n",
+"T1=180; // Initial temperature of the fluid in degree celcius\n",
+"m=0.5; // Mass of the fluid in kg\n",
+"p2=p1; // Constant pressure process\n",
+"// (a).Steam\n",
+"x1=0.8; // Quality of the steam at state 1\n",
+"// Following are the values taken from steam table \n",
+"vf1=0.001127; vfg1=0.1929; // specific volume of the steam in m^3/kg\n",
+"hf1=763.2; hfg1=2015; // specific enthalpy in kJ/kg \n",
+"sf1=2.1396; sfg1=4.4460; // specific entropy in kJ/kg K\n",
+"v1=vf1+x1*vfg1; // specific volume in m^3/kg\n",
+"h1=hf1+x1*hfg1; // specific enthalpy in kJ/kg \n",
+"s1=sf1+x1*sfg1; // specific entropy in kJ/kg K\n",
+"v2=2*v1; // Final volume of the fluid\n",
+"t2=410.5; // Final temperature of steam in degree celcius (from superheated steam table)\n",
+"h2=3286.4; // specific enthalpy in kJ/kg \n",
+"s2=7.525; // specific entropy in kJ/kg K\n",
+"S21=m*(s2-s1); // Change in entropy\n",
+"W=m*p1*10^3*(v2-v1); // Work done\n",
+"Q=m*(h2-h1); // Heat transferred\n",
+"disp ('kJ',Q,'Heat transferred = ','kJ',W,'Work done = ','kJ/K',S21,'Change in entropy = ','K',t2+273,'Final Temperature = ','(a).Steam');\n",
+"// (b).Air\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"V1=m*R*(T1+273)/(p1*10^3); // Initil volume\n",
+"V2=2*V1; // Final volume\n",
+"T2=(T1+273)*V2/V1; // Final temperature\n",
+"S21=m*Cpo*log (V2/V1); // Change in entropy\n",
+"W=p1*10^3*(V2-V1); // Work done\n",
+"Q=m*Cpo*(T2-(T1+273));// Heat transferred\n",
+"disp ('kJ',Q,'Heat transferred = ','kJ',W,'Work done = ','kJ/K',S21,'Change in entropy = ','K',T2,'Final Temperature = ','(b).Air');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.3: CHANGE_IN_INTERNAL_ENERGY_AND_ENTROPY_OF_FLUID.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=1.5; // Mass of the fluid in kg\n",
+"p1=1; // Initial pressure of fluid in bar\n",
+"T1=150; // Initial temperture of fluid in degree celcius\n",
+"v2=0.3; // Final specific volume in m^3/kg\n",
+"// (a).Steam\n",
+"// Following are the values taken from steam table \n",
+"u1=2582.8; // specific internal energy in kJ/kg\n",
+"s1=7.6134; // specific entropy in kJ/kg K\n",
+"vf2=0.001091; vfg2=0.3917; // specific volume of the steam in m^3/kg\n",
+"sf2=1.8418; sfg2=4.9961; // specific entropy in kJ/kg K\n",
+"uf2=631.7; ufg2=1927.8; // specific internal energy in kJ/kg\n",
+"x2=(v2-vf2)/vfg2; // Quality of steam at state 2\n",
+"s2=sf2+x2*sfg2; // specific entropy in kJ/kg K\n",
+"u2=uf2+x2*ufg2; // specific internal energy in kJ/kg\n",
+"S21=m*(s2-s1); // Change in entropy\n",
+"U21=m*(u2-u1); // Change in internal energy\n",
+"Q=(T1+273)*(S21); // Heat transferred\n",
+"W=Q-U21; // Work done\n",
+"disp ('kJ',Q,'Heat transferred = ','kJ',W,'Work done = ','kJ/K',S21,'Change in entropy = ','kJ',U21,'Change in internal energy = ','(a).Steam');\n",
+"// (b).Air\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"v1=(R*(T1+273))/(p1*10^2); // initial specific volume\n",
+"S21=m*R*log (v2/v1); // Change in entropy\n",
+"Q=(T1+273)*(S21); // Heat transferred\n",
+"W=Q; // Work done\n",
+"disp ('kJ',Q,'Heat transferred = ','kJ',W,'Work done = ','kJ/K',S21,'Change in entropy = ','kJ',U21,'Change in internal energy = ','(b).Air');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.4: WORKDONE_OF_FLUID.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=1.5; // Mass of the fluid in kg\n",
+"p1=1.6; // Initial pressure of fluid in MPa\n",
+"T1=250; // Initial temperture of fluid in degree celcius\n",
+"p2=150; // Initial pressure of the fluid in kPa\n",
+"// (a).Steam\n",
+"// Following are the values taken from steam table \n",
+"// state 1 is superheated\n",
+"u1=2692.3; // specific internal energy in kJ/kg\n",
+"s1=6.6732; // specific entropy in kJ/kg K\n",
+"v1=0.14184; // specific volume of the steam in m^3/kg\n",
+"// State 2 is wet (s1=s2<sg2)\n",
+"T2=111.37; // Final temperature of steam in degree celcius\n",
+"sf2=1.4336; sfg2=5.7897; // specific entropy in kJ/kg K\n",
+"uf2=466.94; ufg2=2052.7; // specific internal energy in kJ/kg\n",
+"x2=(s1-sf2)/sfg2; // Quality of steam at state 2\n",
+"u2=uf2+x2*ufg2; // specific internal energy in kJ/kg\n",
+"W=-m*(u2-u1);// Work done\n",
+"disp ('kJ',W,'Work done = ','K',T2+273,'Final temperature of steam =','(a).Steam');\n",
+"// (b).Air\n",
+"Cvo=0.7165; // Specific heat at constant volume in kJ/kg K\n",
+"k=1.4; // index of reversible adiabatic process\n",
+"T2=(T1+273)*((p2*10^-3)/p1)^((k-1)/k); // Final temperature of air\n",
+"W=-m*Cvo*(T2-(T1+273)); // Work done\n",
+"disp ('kJ',W,'Work done = ','K',T2,'Final temperature of =','(b).Air');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.5: REVERSIBLE_AND_POLYTROPIC_PROCESS.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=1.5; // Mass of the fluid in kg\n",
+"p1=1.6; // Initial pressure of fluid in MPa\n",
+"T1=250; // Initial temperture of fluid in degree celcius\n",
+"p2=150; // Initial pressure of the fluid in kPa\n",
+"n=1.25; // Index of polytropic process\n",
+"// (a).Steam\n",
+"// Following are the values taken from steam table \n",
+"// state 1 is superheated\n",
+"u1=2692.3; // specific internal energy in kJ/kg\n",
+"s1=6.6732; // specific entropy in kJ/kg K\n",
+"v1=0.14184; // specific volume of the steam in m^3/kg\n",
+"v2=v1*(p1/(p2*10^-3))^(1/n); // specific volume of the steam at state 2\n",
+"// State 2 is wet \n",
+"T2=111.37; // Final temperature of steam in degree celcius\n",
+"vf2=0.0010531; vfg2=1.1582; // specific volume of the steam in m^3/kg\n",
+"x2=(v2-vf2)/vfg2; // Quality of steam at state 2\n",
+"sf2=1.4336; sfg2=5.7897; // specific entropy in kJ/kg K\n",
+"uf2=466.94; ufg2=2052.7; // specific internal energy in kJ/kg\n",
+"s2=sf2+x2*sfg2; // specific entropy in kJ/kg K\n",
+"u2=uf2+x2*ufg2; // specific internal energy in kJ/kg\n",
+"W=m*((p2*v2)-(p1*10^3*v1))/(1-n); // Work done\n",
+"Q=m*(u2-u1)+W; // Heat ttransferred\n",
+"S21=m*(s2-s1); // Change in entropy\n",
+"disp ('kJ',Q,'Heat transferred = ','kJ',W,'Work done = ','kJ/K',S21,'Change in entropy = ','K',T2+273,'Final Temperature = ','(a).Steam');\n",
+"// (b).Air\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"Cvo=0.7165; // Specific heat at constant volume in kJ/kg K\n",
+"T2=(T1+273)*((p2*10^-3)/p1)^((n-1)/n); // Final temperature of air\n",
+"W=m*R*(T2-(T1+273))/(1-n); // Work done\n",
+"Q=m*Cvo*(T2-(T1+273))+W; // Heat transferred\n",
+"S21=m*(Cvo+R/(1-n))*log (T2/(T1+273)); // Change in entropy\n",
+"disp ('kJ',Q,'Heat transferred = ','kJ',W,'Work done = ','kJ/K',S21,'Change in entropy = ','K',T2,'Final Temperature = ','(b).Air');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.6: ISENTROPIC_EFFICIENCY_OF_TURBINE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=1; // Massflow rate of the steam in kg/s\n",
+"p1=3.5; // Pressure at inlet in MPa\n",
+"T1=400; // Temperature at inlet in degree celcius\n",
+"V1=250; // Velocity of stesm at inlet in m/s\n",
+"p2=50; // Pressure at outlet in kPa\n",
+"T2=100; // Temperature at outlet in degree celcius\n",
+"V2=30; // Velocity of stesm at outlet in m/s\n",
+"// For actual expansion in the turbine\n",
+"h1=3222.3; h2=2682.5; // specific enthalpy in kJ/kg at inlet and exit\n",
+"wa=h1-h2+(V1^2-V2^2)/2000; // Work done\n",
+"W=m*wa; // Power output\n",
+"disp ('kW',W,'Power output of the turbine = (Error in textbook)');\n",
+"// For reversible adiabatic expansion\n",
+"// Following are the values taken from steam table \n",
+"s1=6.8405; // specific entropy in kJ/kg K\n",
+"s2s=s1; // Isentropic expansion\n",
+"sf2=1.091; sfg2=6.5029; // specific entropy in kJ/kg K\n",
+"hf2=340.49; hfg2=2305.4; // specific enthalpy in kJ/kg\n",
+"x2s=(s1-sf2)/sfg2; // Quality of steam at state 2\n",
+"h2s=hf2+x2s*hfg2; // specific enthalpy in kJ/kg\n",
+"ws=h1-h2s+(V1^2-V2^2)/2000; // Isentropic Work done\n",
+"eff_isen=wa/ws; // Isentropic efficiency of the turbine\n",
+"disp('%',eff_isen*100,'Isentropic efficiency of the turbine = (Error in textbook)')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.7: POWER_OF_AIRTRBINE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=1; // Massflow rate of the steam in kg/s\n",
+"p1=3.5; // Pressure at inlet in bar\n",
+"T1=160; // Temperature at inlet in degree celcius\n",
+"p2=1; // Pressure at outlet in bar\n",
+"Cpo=1.005; // Specific heat at constant pressure in kJ/kg K\n",
+"eff_isen=0.85; // Isentropic efficiency of the turbine\n",
+"k=1.4; // index of isentropic process\n",
+"T2s=(T1+273)*(p2/p1)^((k-1)/k); // Final temperature after isentropic expansion\n",
+"Ws=m*Cpo*((T1+273)-T2s); // Isentropic power developed\n",
+"Wa=eff_isen*Ws; // Actual power developed\n",
+"T2=(T1+273)-(Wa/(m*Cpo)); // Final temperature after expansion\n",
+"disp ('K',T2,'Final temperature after expansion = ','kW',Wa,'Actual power developed (Error in textbook)=');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.8: ADIABATIC_EFFICIENCY_OF_COMPRESSOR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"m=0.05; // mass flowrate of Freon 12 in kg/s\n",
+"p1=300; // Pressure of Freon 12 at inlet in kpa\n",
+"t1=5; // Temperature of Freon 12 at inlet in degree celcius\n",
+"p2=1.2; // Pressure of Freon 12 at outlet in MPa\n",
+"t2=80; // Temperature of Freon 12 at outlet in degree celcius\n",
+"W=-2.3; // Power consumption of compressor in kW\n",
+"// (a).Heat transfer from the body of compressor to environment\n",
+"// From the table of properties of Freon 12\n",
+"h1= 190.8; h2=230.4; // specific enthalpy in kJ/kg \n",
+"s1=0.71; s2=0.7514 // specific entropy in kJ/kg K\n",
+"Q=m*(h2-h1)+W; // Heat transfer \n",
+"disp ('kW',Q,'(a).Heat transfer from the body of compressor to environment =');\n",
+"// (b).Adiabatic efficiency of the compressor\n",
+"// For adiabatic compression p2=1.2Mpa,s2s=s1\n",
+"t2s=61.7;// Temperature of Freon 12 at outlet in degree celcius\n",
+"h2s=216.14; // specific enthalpy in kJ/kg \n",
+"ws=(h2s-h1); // Reversible adiabatic work\n",
+"wa=W/m; // Actual work\n",
+"eff_com=abs (ws/wa); // Adiabatic efficiency\n",
+"disp ('%',eff_com*100,'(b).Adiabatic efficiency of the compressor = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.9: COMPRESSOR_OF_GAS_TURBINE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=1; // Pressure of air at inlet of compressor in bar\n",
+"T1=30; // Temperature of air at inlet of compressor in degree celcius\n",
+"p2=12; // Delivery pressure of air in bar\n",
+"T2=400; // Temperature of air at inlet of compressor in degree celcius\n",
+"V2=90; // Velocity of air at exit in m/s\n",
+"w=3740; // Power input to compressor in kW\n",
+"k=1.4; // Index of reversible adiabatic process\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"wa=Cpo*(T2-T1)+V2^2/2000; // Actual specific work input\n",
+"m=w/wa; // Mass flow rate of air\n",
+"T2s=(T1+273)*(p2/p1)^((k-1)/k);// Isentropic discharge temperature\n",
+"ws=Cpo*(T2s-(T1+273))+V2^2/2000; // Isentropic work\n",
+"eff_com=ws/wa; // Isentrpic efficiency\n",
+"disp ('%',eff_com*100,'Isentrpic efficiency of compressor =','K',T2s,'Isentropic discharge temperature = ');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/8-VAPOUR_CYCLES.ipynb b/Thermodynamics_by_C_P_Arora/8-VAPOUR_CYCLES.ipynb
new file mode 100644
index 0000000..be22c11
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/8-VAPOUR_CYCLES.ipynb
@@ -0,0 +1,423 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8: VAPOUR CYCLES"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.1: A_CARNOT_STEAM_CYCLE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"TH=311.06; // Source temperature in degree celcius\n",
+"pb=10; // Boiler pressure in MPa\n",
+"TL=32.88; // Sink temperature in degree celcius \n",
+"pc=5; // Condenser pressure in kPa\n",
+"// From steam tables at pb\n",
+"h2=1407.56; // specific enthalpy in kJ/kg \n",
+"h3=2724.7; // specific enthalpy in kJ/kg \n",
+"s2=3.3596; // specific entropy in kJ/kg K\n",
+"s3=5.6141; // specific entropy in kJ/kg K\n",
+"// From steam tables at pc\n",
+"hf=137.82; hfg=2423.7; // specific enthalpy in kJ/kg \n",
+"sf=0.4764; sfg=7.9187; // specific entropy in kJ/kg K\n",
+"x1=(s2-sf)/sfg; // quality of steam at state 1\n",
+"x4=(s3-sf)/sfg; // quality of steam at state 4\n",
+"h1=hf+x1*hfg; // specific enthalpy at state 1\n",
+"h4=hf+x4*hfg; // specific enthalpy at state 4\n",
+"wT=h3-h4; // Turbine work\n",
+"wC=h2-h1; // Compressor work\n",
+"wnet=wT-wC; // Net work output\n",
+"qH=h3-h2; // Heat added\n",
+"rw=wnet/wT; // Ratio of net work to trbine work\n",
+"eff_th=wnet/qH; // Thermal efficiency\n",
+"SSC=3600/wnet; // specific steam consumption\n",
+"disp ('kg/kWh',SSC,'specific steam consumption =','%',eff_th*100,'Thermal efficiency =',rw,'Ratio of net work to trbine work =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.2: SIMPLE_RANKINE_CYCLE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"TH=311.06; // Source temperature in degree celcius\n",
+"p2=10; // Boiler pressure in MPa\n",
+"TL=32.88; // Sink temperature in degree celcius \n",
+"p1=5; // Condenser pressure in kPa\n",
+"// From steam tables at p2\n",
+"h3=2724.7; // specific enthalpy in kJ/kg \n",
+"s3=5.6141; // specific entropy in kJ/kg K\n",
+"// From steam tables at p1\n",
+"hf=137.82; hfg=2423.7; // specific enthalpy in kJ/kg \n",
+"sf=0.4764; sfg=7.9187; // specific entropy in kJ/kg K\n",
+"x4=(s3-sf)/sfg; // quality of steam at state 4\n",
+"h4=hf+x4*hfg; // specific enthalpy at state 4\n",
+"h1=137.82; // specific enthalpy at state 1 in kJ/kg \n",
+"s1=0.4764; // specific entropy at state in kJ/kgK\n",
+"v1=0.001005; // specific volume in m^3/kg\n",
+"wp=abs (v1*(p2*10^3-p1)); // Pump work (absolute value)\n",
+"h2=h1+wp; // specific enthalpy at state 2\n",
+"wT=h3-h4; // Turbine work\n",
+"wnet=wT-wp; // Net work output\n",
+"qH=h3-h2; // Heat added\n",
+"rw=wnet/wT; // Ratio of net work to trbine work\n",
+"eff_th=wnet/qH; // Thermal efficiency\n",
+"SSC=3600/wnet; // specific steam consumption\n",
+"disp ('kg/kWh',SSC,'specific steam consumption =','%',eff_th*100,'Thermal efficiency =',rw,'Ratio of net work to trbine work =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.3: COMPARSION_OF_CARNOT_AND_RANKINE_CYCLE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"TH=311.06; // Source temperature in degree celcius\n",
+"p2=10; // Boiler pressure in MPa\n",
+"TL=32.88; // Sink temperature in degree celcius \n",
+"p1=5; // Condenser pressure in kPa\n",
+"// (a).Actual carnot cycle\n",
+"eff_Tur=0.8; // Efficiency of turbine\n",
+"eff_com=0.6; // Efficiency of compressure\n",
+"// From steam tables at p2\n",
+"h3=2724.7; // specific enthalpy in kJ/kg \n",
+"s3=5.6141; // specific entropy in kJ/kg K\n",
+"s2=3.3596; // specific entropy in kJ/kg K\n",
+"h2=1407.56; // specific enthalpy in kJ/kg \n",
+"// From steam tables at p1\n",
+"hf=137.82; hfg=2423.7; // specific enthalpy in kJ/kg \n",
+"sf=0.4764; sfg=7.9187; // specific entropy in kJ/kg K\n",
+"x1=(s2-sf)/sfg; // quality of steam at state 1\n",
+"x4=(s3-sf)/sfg; // quality of steam at state 4\n",
+"h1=hf+x1*hfg; // specific enthalpy at state 1\n",
+"h4=hf+x4*hfg; // specific enthalpy at state 4\n",
+"wTs=h3-h4; // Turbine work\n",
+"wT=eff_Tur*wTs; // Actual turbine work\n",
+"wCs=h2-h1; // Compressor work\n",
+"wC=wCs/eff_com; // Actual compressor work\n",
+"wnet=wT-wC; // Net work output\n",
+"h2a=h1+wC; // specific enthalpy\n",
+"qH=h3-h2a; // Heat added\n",
+"rw=wnet/wT; // Ratio of net work to trbine work\n",
+"eff_th=wnet/qH; // Thermal efficiency\n",
+"SSC=3600/wnet; // specific steam consumption\n",
+"disp ('kg/kWh',SSC,'specific steam consumption =','%',eff_th*100,'Thermal efficiency =',rw,'Ratio of net work to trbine work =','(a).Actual carnot cycle');\n",
+"// (b).Actual Rankine cycle\n",
+"eff_Tur=0.8; // Efficiency of turbine\n",
+"eff_pump=0.9; // Efficiency of Pump\n",
+"// From steam tables at p1\n",
+"h1=137.82; // specific enthalpy at state 1 in kJ/kg \n",
+"s1=0.4764; // specific entropy at state in kJ/kgK\n",
+"v1=0.001005; // specific volume in m^3/kg\n",
+"wps=abs (v1*(p2*10^3-p1)); // Pump work (absolute value)\n",
+"wp=wps/eff_pump; // Actual pmp work\n",
+"h2a=h1+wp; // // specific enthalpy at state 2\n",
+"wnet=wT-wp; // Net work output\n",
+"qH=h3-h2a; // Heat added\n",
+"rw=wnet/wT; // Ratio of net work to trbine work\n",
+"eff_th=wnet/qH; // Thermal efficiency\n",
+"SSC=3600/wnet; // specific steam consumption\n",
+"disp ('kg/kWh',SSC,'specific steam consumption =','%',eff_th*100,'Thermal efficiency =',rw,'Ratio of net work to trbine work =','(b).Actual Rankine cycle');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.4: DETERMINATION_OF_QUALITY_OF_EXHAST_STEAM_AND_SSC.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T3=450; // temperature of steam at state 3 in degree celcius\n",
+"p3=10; // Boiler pressure in MPa \n",
+"p6=5; // Condenser pressure in kPa\n",
+"// From steam tables at state 1\n",
+"hf=137.82; hfg=2423.7; // specific enthalpy in kJ/kg \n",
+"sf=0.4764; sfg=7.9187; // specific entropy in kJ/kg K\n",
+"h1=137.82; // specific enthalpy at state 1 in kJ/kg \n",
+"s1=0.4764; // specific entropy at state in kJ/kgK\n",
+"v1=0.001005; // specific volume in m^3/kg\n",
+"wp=abs (v1*(p3*10^3-p6)); // Pump work (absolute value)\n",
+"h2=h1+wp; // specific enthalpy at state 2\n",
+"// (a).Rankine cycle with superheat\n",
+"// From steam tables at state 3\n",
+"h3=3240.9;// specific enthalpy in kJ/kg\n",
+"s3=6.419; // specific entropy in kJ/kg K\n",
+"// State 4_1\n",
+"x4_1=(s3-sf)/sfg; // Quality of steam at state 4_1\n",
+"h4_1=hf+x4_1*hfg; // specific enthalpy at state 4_1\n",
+"wT=h3-h4_1; // Turbine work\n",
+"wnet=wT-wp; // Net work output\n",
+"qH=h3-h2; // Heat added\n",
+"eff_th=wnet/qH; // Thermal efficiency\n",
+"SSC=3600/wnet; // specific steam consumption\n",
+"disp ('kg/kWh',SSC,'specific steam consumption =','%',eff_th*100,'Thermal efficiency =',x4_1,'Quality of steam at exhaust = ','(a).Rankine cycle with superheat');\n",
+"// (b).Reheat cycle\n",
+"s4=s3; // isentropic expansion\n",
+"x4=0.975; // Quality of steam at state 4\n",
+"// from steam table intermediate pressure is selected for s4 & x4 by interpolation and assumed by round value\n",
+"p4=1.2; // Intermediate pressure in MPa\n",
+"// From steam tables at state 4\n",
+"hf4=798.6; hfg4=1986.2; // specific enthalpy in kJ/kg \n",
+"h4=hf4+x4*hfg4; // specific enthalpy in kJ/kg \n",
+"// From steam tables at state 5\n",
+"h5=3368.5;// specific enthalpy in kJ/kg\n",
+"s5=7.5266; // specific entropy in kJ/kg K\n",
+"x6=(s5-sf)/sfg; // Quality of steam at state 6\n",
+"h6=hf+x6*hfg; // specific enthalpy in kJ/kg \n",
+"wT=(h3-h4)+(h5-h6); // Turbine work\n",
+"wnet=wT-wp; // Net work output\n",
+"qH=(h3-h2)+(h5-h4); // Heat added\n",
+"eff_th=wnet/qH; // Thermal efficiency\n",
+"SSC=3600/wnet; // specific steam consumption\n",
+"disp ('kg/kWh',SSC,'specific steam consumption =','%',eff_th*100,'Thermal efficiency =',x6,'Quality of steam at exhaust = ','(b).Reheat cycle');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.5: BLEEDING_OF_STEAM.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"T5=311.06; // temperature of steam at state 5 in degree celcius\n",
+"p5=10; // Boiler pressure in MPa\n",
+"p4=p5;\n",
+"T7=32.88; // temperature of steam at state 7 in degree celcius \n",
+"p7=5; // Condenser pressure in kPa\n",
+"p1=p7;\n",
+"// From steam tables at p7\n",
+"h1=137.82; // specific enthalpy at state 1 in kJ/kg \n",
+"s1=0.4764; // specific entropy at state 1 in kJ/kgK\n",
+"v1=0.001005; // specific volume in m^3/kg\n",
+"wp=abs (v1*(p5*10^3-p7)); // Pump work (absolute value)\n",
+"h2=h1+wp; // specific enthalpy at state 2\n",
+"T6=(T5+T7)/2; // Temperature of bleed system\n",
+"h5=2724.7; // specific enthalpy at state 5 in kJ/kg \n",
+"s5=5.6141; // specific entropy at state 5 in kJ/kgK\n",
+"// From steam tables at state 6\n",
+"p6=791.5; // bleed steam pressure in kPa\n",
+"p2=p6; p3=p6;\n",
+"vf6=0.00114; // specific volume in m^3/kg\n",
+"v3=vf6;\n",
+"hf6=719.21; hfg6=2049.5; // specific enthalpy in kJ/kg \n",
+"sf6=2.0419; sfg6=4.6244; // specific entropy in kJ/kg K\n",
+"x6=(s5-sf6)/sfg6; // quality of steam at state 6\n",
+"h6=hf6+x6*hfg6; // specific enthalpy at state 6\n",
+"h3=hf6; // specific enthalpy at state 3\n",
+"m1=(h3-h2)/(h6-h2); // Fraction of bleed steam\n",
+"wLP=abs (v1*(p2-p1)); // LP work\n",
+"wHP=abs (v3*(p4*10^3-p3)); // HP work\n",
+"wp=(1-m1)*wLP+wHP; // Total pump work\n",
+"h2=h1+wp; h4=h3+wp; // Specific Enthalpies of water\n",
+"// From steam tables at pc\n",
+"hf7=137.82; hfg7=2423.7; // specific enthalpy in kJ/kg \n",
+"sf7=0.4764; sfg7=7.9187; // specific entropy in kJ/kg K\n",
+"x7=(s5-sf7)/sfg7; // quality of steam at state 7\n",
+"h7=hf7+x7*hfg7; // specific enthalpy at state 4\n",
+"wT=(h5-h6)+(1-m1)*(h6-h7); // Turbine work\n",
+"wnet=wT-wp; // Net work output\n",
+"qH=h5-h4; // Heat added\n",
+"eff_th=wnet/qH; // Thermal efficiency\n",
+"SSC=3600/wnet; // specific steam consumption\n",
+"disp ('kg/kWh',SSC,'specific steam consumption =','%',eff_th*100,'Thermal efficiency =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.6: BOILER_EFFICIENCY.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"ps=6.89+1; // Pressure of steam produced in bar (Absolute)\n",
+"x=0.96; // Quality of steam produced\n",
+"f=75; // Steady flow of water in litres\n",
+"t=9.5; // Time consumption of water in minutes\n",
+"tf=685; //Time consumption of 10 litre fuel in seconds\n",
+"Vf=10; // consumption of fuel in litres\n",
+"Sf=0.85; // specific gravity of water\n",
+"CV=43125; // Calorific value of fuel in kJ/kg\n",
+"ms=f/(t*60);// Steam generation\n",
+"mf=Vf*Sf/tf; // consumption of fuel\n",
+"// From steam tables at ps\n",
+"hf=718.5; hfg=2050; // specific enthalpy in kJ/kg \n",
+"hs=hf+x*hfg; // specific enthalpy of steam produced\n",
+"hFW=146.7; // Enthalpy of feed water at 35 degree celcius\n",
+"eff_boiler=(ms*(hs-hFW))/(mf*CV); // Boiler Efficiency\n",
+"disp ('%',eff_boiler*100,'Boiler Efficiency = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.7: A_CARNOT_REFRIGERATOR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"TL=-15; // Source temperature in degree celcius\n",
+"TH=40; // Sink temperature in degree celcius\n",
+"// From the table of properties of Freon - 12\n",
+"h2=203.05; h3=74.53; hf4=22.31; hg4=180.85; // specific enthalpy in kJ/kg \n",
+"s1=0.682; s3=0.2716; sf4=0.0906; sg4=0.7046; sfg4=sg4-sf4;// specific entropy in kJ/kg K\n",
+"sf1=sf4; sfg1=sfg4; s2=s1; s4=s3; hf1=hf4; hg1=hg4; hfg4=hg4-hf4; hfg1=hfg4;// refer figure 8.20 \n",
+"x1=(s1-sf1)/sfg1; // Dryness fraction at state 1\n",
+"x4=(s4-sf4)/sfg4; // dryness fraction at state 4\n",
+"h1=hf1+x1*hfg1; h4=hf4+x4*hfg4; // specific enthalpy in kJ/kg \n",
+"wc=h2-h1; // work of compression\n",
+"wE=h3-h4; // Work of expansion\n",
+"qL=h1-h4; // Refrigerating effect\n",
+"qH=h2-h3; // Heat rejected\n",
+"wnet=wc-wE; // Net work\n",
+"COPc=qL/wnet; // COP of the cycle\n",
+"disp (COPc,'COP of the cycle =','kJ/kg',qH,'Heat rejected =','kJ/kg',qL,'Refrigerating effect = ','kJ/kg',wE,'Work of expansion =','kJ/kg',wc,'Work of compression = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.8: VAPOUR_COMPRESSION_CYCLE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"TL=-15; // Source temperature in degree celcius\n",
+"TH=40; // Sink temperature in degree celcius\n",
+"// From the table of properties of Freon - 12\n",
+"h3=74.53; h1=180.85; h4=h3; // specific enthalpy in kJ/kg \n",
+"s1=0.7046; s2=0.682; // specific entropy in kJ/kg K\n",
+"// (a) \n",
+"// (i).Condensor and Evaporator pressure\n",
+"pc=0.9607; // Saturation pressure at TH in MPa\n",
+"pE=0.1826; // Saturation pressure at TL in MPa\n",
+"disp ('MPa',pE,'Evaporator pressure = ','MPa',pc,'Condensor pressure = ','(i).Condensor and Evaporator pressure','(a)');\n",
+"// (ii).Compressor discharge temperature & Enthalpy\n",
+"p2=pc; // Condensor pressure\n",
+"s2=s1; // refer figure 8.25\n",
+"// From the table of properties of Freon - 12 at pc\n",
+"t2=46.8; // Compressor discharge temperature in degree celcius\n",
+"h2=208.3; // specific enthalpy in kJ/kg \n",
+"disp ('kJ/kg',h2,'Enthalpy = ','oC',t2,'Compressor discharge temperature = ','(ii).Compressor discharge temperature & Enthalpy');\n",
+"// (iii).Ratio of COP of the cycle to Carnot COP\n",
+"w=h2-h1; // Compressor work\n",
+"qL=h1-h4; // Refrigeration effect\n",
+"COP=qL/w; // COP of the cycle\n",
+"COPc=4.68; // COP of carnot cycle from example 8.7\n",
+"r=COP/COPc; // Ratio of COP of the cycle to Carnot COP\n",
+"disp (r,'(iii).Ratio of COP of the cycle to Carnot COP = ');\n",
+"// (b) \n",
+"QL=0.440; // Capacity of refrigerator in kW (1/8 ton of refrigeration)\n",
+"m=QL/qL; // Mass flow rate of refrigerant\n",
+"W=m*w; // Power consumption of compressor\n",
+"QH=QL+W; // Heat rejected\n",
+"disp ('kW',QH,'Heat rejected to surroundings = ','kW',W,'Power consumption of compressor = ','kg/s',m,'Mass flow rate of refrigerant = ','(b)');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Thermodynamics_by_C_P_Arora/9-GAS_CYCLES.ipynb b/Thermodynamics_by_C_P_Arora/9-GAS_CYCLES.ipynb
new file mode 100644
index 0000000..b354c96
--- /dev/null
+++ b/Thermodynamics_by_C_P_Arora/9-GAS_CYCLES.ipynb
@@ -0,0 +1,395 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 9: GAS CYCLES"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.1: OTTO_CYCLE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"r=8; // Compression ratio of an engine\n",
+"p1=100; // Pressure of air before compression in lPa\n",
+"T1=300; // Temperature air before compression in kelvin\n",
+"qH=1800; // Heat added to the air in kJ/kg\n",
+"k=1.4; // Index of reversible adiabatic process\n",
+"Cvo=0.7165; // Specific heat at constant volume in kJ/kg K\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"// Otto cycle\n",
+"// (1) state 2\n",
+"p2=p1*(r)^k; // Pressure at the end of compression\n",
+"T2=T1*(p2/p1)^((k-1)/k);// Temperature at the end of compression\n",
+"disp ('K',T1,'Temperature air before compression =','kPa',p1,'Pressure of air before compression = ','(1).state 1');\n",
+"disp ('K',T2,'Temperature at the end of compression =','kPa',p2,'Pressure of air at the end of compression = ','state 2');\n",
+"// state 3\n",
+"T3=(qH/Cvo)+T2; // Temperatue after heat addition\n",
+"p3=p2*(T3/T2); // Pressure after heat addition\n",
+"disp ('K (round off error)',T3,'Temperature after heat addition =','kPa (round off error)',p3,'Pressure after heat addition = ','state 3');\n",
+"// state 4\n",
+"p4=p3*(1/r)^k; // Pressure after expansion\n",
+"T4=T3*(p4/p3)^((k-1)/k);// Temperature after expansion\n",
+"disp ('K (round off error)',T4,'Temperature after expansion =','kPa (round off error)',p4,'Pressure after expansion = ','state 4');\n",
+"// (2).Thermal efficiency\n",
+"qL=Cvo*(T4-T1); // Heat rejected\n",
+"eff_th=1-qL/qH; // thermal efficiency\n",
+"// (3). Mean effective pressure\n",
+"wnet=qH-qL; // net work\n",
+"v1=R*T1/p1; // Specific volume at state 1\n",
+"v2=v1/r; // Specific volume at state 2\n",
+"pm=wnet/(v1-v2); // Mean effective pressure\n",
+"disp ('kPa',pm,'(3).Mean effective pressure = ','% (round off error)',eff_th*100,'(2).Thermal efficienvy = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.2: DIESEL_CYCLE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"r=18; // Compression ratio of an engine\n",
+"p1=100; // Pressure of air before compression in lPa\n",
+"T1=300; // Temperature air before compression in kelvin\n",
+"qH=1800; // Heat added to the air in kJ/kg\n",
+"k=1.4; // Index of reversible adiabatic process\n",
+"Cvo=0.7165; // Specific heat at constant volume in kJ/kg K\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"// Diesel cycle\n",
+"// state 2\n",
+"T2=T1*(r)^(k-1); // Temperature at the end of compression\n",
+"p2=p1*(r)^k; // Pressure at the end of compression\n",
+"// state 3\n",
+"T3=(qH/Cpo)+T2; // Temperatue after heat addition\n",
+"p3=p2; //constant pressure\n",
+"Tmax=T3; // maximum temperature\n",
+"Pmax=p3; // Maximum pressure\n",
+"// state 4\n",
+"v3=R*T3/p3; // Specific volume at state 3\n",
+"v4=R*T1/p1; // Specific volume at state 4\n",
+"T4=T3*(v3/v4)^(k-1); // Temperature after expansion\n",
+"p4=p3*(v3/v4)^k; // Pressure after expansion\n",
+"qL=Cvo*(T4-T1); // Heat rejected\n",
+"wnet=qH-qL; // net work\n",
+"eff_th=wnet/qH; // thermal efficiency\n",
+"v1=R*T1/p1; // Specific volume at state 1\n",
+"v2=v1/r; // Specific volume at state 2\n",
+"pm=wnet/(v1-v2); // Mean effective pressure\n",
+"disp ('kPa',pm,'Mean effective pressure = (Error in textbook) ','%',eff_th*100,'Thermal efficienvy = ','K',Tmax,'Maximum Temperature = ','kPa',Pmax,'Maximum pressure = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.3: STANDARD_BRAYTON_CYCLE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=0.1; // Pressure of air at inlet in MPa\n",
+"T1=300; // Temperature of air at inlet in kelvin\n",
+"p2=0.6; // Pressure of air at exit in MPa\n",
+"T3=1200; // Maximun temperature of air in kelvin\n",
+"k=1.4; // Index of reversible adiabatic process\n",
+"Cvo=0.7165; // Specific heat at constant volume in kJ/kg K\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"// Brayton cycle\n",
+"rp=p2/p1; // pressure ratio\n",
+"T2=T1*(p2/p1)^((k-1)/k);// Temperature at the end of compression\n",
+"wc=Cpo*(T2-T1); // compressor work\n",
+"T4=T3*(p1/p2)^((k-1)/k);// Temperature at the end of expansion\n",
+"wT=Cpo*(T3-T4); // Turbine work\n",
+"qH=Cpo*(T3-T2); // heat addition\n",
+"wnet=wT-wc; // net work\n",
+"eff_th=wnet/qH; // thermal efficiency\n",
+"rw=wnet/wT; // worh ratio\n",
+"disp (rw,'Work Ratio = ','%',eff_th*100,'Thermal Efficiency = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.4: ACTUAL_GAS_TURBINE_CYCLE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=0.1; // Pressure of air at inlet in MPa\n",
+"T1=300; // Temperature of air at inlet in kelvin\n",
+"p2=0.6; // Pressure of air at exit in MPa\n",
+"T3=1200; // Maximun temperature of air in kelvin\n",
+"k=1.4; // Index of reversible adiabatic process\n",
+"Cvo=0.7165; // Specific heat at constant volume in kJ/kg K\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"eff_t=0.85; // Turbine efficiency\n",
+"eff_c=0.8; // Compressor efficienct\n",
+"// Brayton cycle\n",
+"rp=p2/p1; // pressure ratio\n",
+"T2s=T1*(p2/p1)^((k-1)/k);// Isentropic Temperature at the end of compression\n",
+"T2=((T2s-T1)/eff_c)+T1; // Actual Temperature at the end of compression\n",
+"p3=0.585; // as per given in MPa\n",
+"p4s=0.11; // As per given in MPa\n",
+"T4s=T3*(p4s/p3)^((k-1)/k); // Isentropic temperature after reversible adiabatic expansion\n",
+"T4=T3-(eff_t*(T3-T4s));// Actual temperature at state 4\n",
+"wc=Cpo*(T2-T1); // compressor work\n",
+"wT=Cpo*(T3-T4); // Turbine work\n",
+"qH=Cpo*(T3-T2); // heat addition\n",
+"wnet=wT-wc; // net work\n",
+"eff_th=wnet/qH; // thermal efficiency\n",
+"rw=wnet/wT; // worh ratio\n",
+"disp (rw,'Work Ratio = ','%',eff_th*100,'Thermal Efficiency = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.5: AN_IDEAL_REGENERATOR.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=0.1; // Pressure of air at inlet in MPa\n",
+"T1=300; // Temperature of air at inlet in kelvin\n",
+"p2=0.6; // Pressure of air at exit in MPa\n",
+"T3=1200; // Maximun temperature of air in kelvin\n",
+"k=1.4; // Index of reversible adiabatic process\n",
+"Cvo=0.7165; // Specific heat at constant volume in kJ/kg K\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"// Brayton cycle\n",
+"rp=p2/p1; // pressure ratio\n",
+"T2=T1*(p2/p1)^((k-1)/k);// Temperature at the end of compression\n",
+"T4=T3*(p1/p2)^((k-1)/k);// Temperature at state 4\n",
+"Tx=T4; Ty=T2; // regenerator temperatures\n",
+"qH=Cpo*(T3-Tx); // Heat added in the cycle with regenerator\n",
+"qL=Cpo*(Ty-T1);// Heat rejected in the cycle with regenerator\n",
+"eff_th=1-qL/qH; // Thermal efficiency\n",
+"disp('%',eff_th*100,'Thermal efficiency with regenerator = ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.6: AIR_STANDARD_CYCLE_FOR_JET_PROPULSION.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"V1=250; // Velocoty of jet aircraft in m/s\n",
+"p1=60; // Atmospheric pressure in kPa\n",
+"T1=260; // Atmospheric temperature in kelvin\n",
+"rp=8; // Pressure ratio of compressor\n",
+"T4=1350; // Temperature of gas at turbine inlet in kelvin\n",
+"k=1.4; // Index of reversible adiabatic process\n",
+"Cvo=0.7165; // Specific heat at constant volume in kJ/kg K\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"// (a).The pressure and temperature at each point of the cycle\n",
+"// process 1-2 isentropic diffusion\n",
+"T2=T1+(V1^2)/(2*Cpo*10^3); // Temperature at state 2\n",
+"p2=p1*(T2/T1)^(k/(k-1)); // Pressure at state 2\n",
+"// process 2-3 isentropic compression\n",
+"p3=rp*p2; // perssure at state 3\n",
+"T3=T2*(p3/p2)^((k-1)/k); // Temperature at state 3\n",
+"wc=Cpo*(T3-T2); // compressor work\n",
+"// process 3-4 Constant pressur heat addition\n",
+"qH=Cpo*(T4-T3); // heat addition\n",
+"p4=p3; // constant pressure\n",
+"// process 4-5 isentropic expansion in turbine\n",
+"wT=wc;\n",
+"T5=T4-(wT/Cpo); // Temperature at state 5\n",
+"p5=p4*(T5/T4)^(k/(k-1)); // Pressure at state 5\n",
+"// process 5-6 Isentropic expansion in nozzle\n",
+"p6=p1;\n",
+"T6=T5*(p6/p5)^((k-1)/k); // Temperature at state 6\n",
+"disp ('K',T6,'T6 = ','kPa',p6,'p6 = ','state 6','K',T5,'T5 = ','kPa',p5,'p5 = ','State 5','K',T4,'T4 = ','kPa',p4,'p4 =','State 4','K',T3,'T3 = ','kPa',p3,'p3 =','State 3','K',T2,'T2 =','kPa',p2,'p2 =','State 2','K',T1,'T1 =','kPa',p1,'p1 = ','State 1','(a).The pressure and temperature at each point of the cycle');\n",
+"// (b).Exit velocity of jet\n",
+"V6=sqrt (2*Cpo*10^3*(T5-T6)); // Exit velocity of jet\n",
+"disp ('m/s',V6,'(b).Exit velocity of jet =');\n",
+"// (c).Specific thrust and work output\n",
+"F_mair=(V6-V1); // Specific thrust \n",
+"w=F_mair*V1/1000; // Work output\n",
+"disp ('kJ/kg',w,'Work output = ','N',F_mair,'Specific thrust =','(c).Specific thrust and work output');\n",
+"// (d).Propulsion efficiency\n",
+"eff_p=w/(w+(V6^2-V1^2)/2000);// Propulsion efficiency\n",
+"disp ('%',eff_p*100,'(d).Propulsion efficiency =');\n",
+"// (e).Overall thermal efficiency\n",
+"eff_th=w/qH; // Overall thermal efficiency\n",
+"disp ('%',eff_th*100,'(e).Overall thermal efficiency =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.7: REVERSED_BRAYTON_CYCLE.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=100; // Pressure of air at inlet in kPa\n",
+"T1=288; // Temperature of air at inlet in kelvin\n",
+"rp=12; // Pressure ratio of the compressor\n",
+"k=1.4; // Index of reversible adiabatic process\n",
+"Cvo=0.7165; // Specific heat at constant volume in kJ/kg K\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"T3=T1; // From figure\n",
+"// process 1-2\n",
+"p2=12*p1; // Pressure at state 2\n",
+"T2=T1*(p2/p1)^((k-1)/k); // Temperature at state 2\n",
+"wc=Cpo*(T2-T1); // Compressor work\n",
+"// process 2-3\n",
+"qH=Cpo*(T2-T3); // Heat added\n",
+"// process 3-4\n",
+"T4=T3*(1/rp)^((k-1)/k); // Temperature at state 4\n",
+"// process 4-1 Refrigerating coil\n",
+"qL=Cpo*(T1-T4); // heat rejected\n",
+"wnet=qH-qL; // net work\n",
+"cop=qL/wnet; // Cop of plant\n",
+"pc=wnet/qL; // Power consumption per kW of refrigeration\n",
+"disp ('kW/kW',pc,'Power consumption per kW of refrigeration =',cop,'COP of the cycle =');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9.8: A_REGENERATIVE_HEAT_EXCHANGER.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc;\n",
+"p1=100; // Pressure of air at inlet in kPa\n",
+"T1=288; // Temperature of air at inlet in kelvin\n",
+"rp=12; // Pressure ratio of the compressor\n",
+"T4=223; // Temperature at state 4\n",
+"k=1.4; // Index of reversible adiabatic process\n",
+"Cvo=0.7165; // Specific heat at constant volume in kJ/kg K\n",
+"Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K\n",
+"R=0.287; // characteristic gas constant of air in kJ/kg K\n",
+"T3=T1; // From figure\n",
+"// process 1-2\n",
+"p2=12*p1; // Pressure at state 2\n",
+"T2=T1*(p2/p1)^((k-1)/k); // Temperature at state 2\n",
+"wc=Cpo*(T2-T1); // Compressor work\n",
+"// process 2-3\n",
+"qH=Cpo*(T2-T3); // Heat added\n",
+"// process 3-4 cooling in regenerative heat exchanger\n",
+"qregen=Cpo*(T3-T4); // cooling in regenerative heat exchanger\n",
+"// process 4-5 Expander\n",
+"T5=T4*(1/rp)^((k-1)/k); // Temperature at state 5\n",
+"wE=Cpo*(T4-T5); // Expander work\n",
+"// process 5-6 Refrigerating coil\n",
+"T6=T4; // From figure 9.32\n",
+"qL=Cpo*(T6-T5); // Heat rejected\n",
+"// process 6-1 Heating in regenerative heat exchanger\n",
+"qregen=Cpo*(T1-T6); // Heat supplied\n",
+"wnet=qH-qL; // net work\n",
+"cop=qL/wnet; // Cop of plant\n",
+"disp (cop,'COP of the modified cycle =');"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}