{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 1: Fundamentals Concepts and Definitions of Thermodynamics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.11: Power_of_the_engine.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 1.11\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "V = 50;// km per hr\n", "V = V * (1000/3600);// in m per sec\n", "F = 900;// in N\n", "P = F * V;// in watt\n", "P = P *10^-3;// in kW\n", "disp(P,'Power of the engine of a car in kW is : ');\n", "H = P * 60;// in kJ \n", "disp(H,'Heat equivalent of work per minute in kJ is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.12: Power_required.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 1.12\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "E_air = 200-100;// in kJ/kg\n", "E_lost = 40;// in kJ/kg\n", "E_total = E_air + E_lost;// in kJ per kg\n", "M = 0.5;// mass flow rate in kg per s\n", "P = M * E_total;// in kJ/s\n", "disp(P,'Power required for an air mass flowin kJ/s is :');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.13: Specific_heat.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 1.13\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "m_b = 1;// in kg\n", "t_ib = 80;//in degree c\n", "m_w = 10;// in kg\n", "t_iw = 25;// in degree c\n", "del_t = 5;// in degree c\n", "S_w = 4.18;// in kJ/kg\n", "t_equ = (t_iw + del_t);// in degree c\n", "// Heat loss by metal = Heat gained by water\n", "S_b = m_w * S_w * (t_equ - t_iw)/(m_b * (t_ib - t_equ));// in kJ/kg-K\n", "disp(S_b,'Specific heat of metal block in kJ/kg-K is');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15: Convert_reading_in_kPa.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 1.15\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "P_gauge = 90;// in cm of hg\n", "P_atm = 760;// in mm of hg\n", "P_atm = 76;// in cm of hg\n", "P_abs = P_gauge + P_atm;// in cm of hg\n", "P_abs = P_abs * (101.32/76);// in kPa\n", "disp(P_abs,'Reading of pressure in kPa');\n", "// Part (b)\n", "P_vacuum = 40;// in cm of hg\n", "P_abs = P_atm - P_vacuum;// in cm of hg\n", "P_abs = P_abs * (101.32/76);// in kpa\n", "disp(P_abs,'Reading of pressure to kpa');\n", "// Part (c)\n", "Rho = 1000;// in kg per m^3\n", "g = 9.81;// \n", "h = 1.2;// in m \n", "P_gauge = Rho * g * h;// in N m^2\n", "P_gauge= P_gauge*10^-3;// in kPa\n", "P_atm = 101.32;// in kPa\n", "P_abs = P_gauge + P_atm;// in kpa\n", "disp(P_abs,'Reading of pressure in kPa');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.16: Depth_of_atmosphere.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 1.16\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "g=9.81;// in m/s^2\n", "P=1.0332*10^5;// in kN/m^2\n", "v='(2.3*10^4/p)^1/1.4';// given expression\n", "H= 1/g*(2.3*10^4)^(1/1.4)*integrate('(1/p)^(1/1.4)','p',0,P);// in m\n", "disp(H*10^-3,'The value of H in km is : ')\n", "\n", "// Note: There is the calculation error in the book in this question, so the answer in the book is wrong." ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.2: Absolute_pressure.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 1.2\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "Pvacc = 700;// mm of hg\n", "Patm = 760;// mm of hg\n", "Pabs = Patm - Pvacc;// mm of hg\n", "disp(Pabs/760,'Absolute pressure in in kg/cm^2 is :');// as 1kg/cm^2= 760 mm of Hg\n", "disp(Pabs*1.01325/760,'Absolute pressure in bar is : ');// as 1.01325 bar = 760 mm of Hg\n", "disp(Pabs*1.01325/760*10^2,'Absolute pressure in in kPa');// as 1 bar = 10^2 kPa" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.3: Tank_pressure.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Exa 1.3\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "Patm = 101;// kpa\n", "Rho = 13.6 * 10^3;// in kg per m^3\n", "h = 250;// in cm\n", "h = h*10^-2;// in m\n", "g = 9.806;\n", "p = Rho * g * h;// in N/m^2\n", "p= p*10^-3;// in kPa\n", "// Total pressure in tank\n", "p = p + Patm;// in kpa\n", "p = p*10^-3;// in Mpa\n", "disp(p,'Total pressure in tank in Mpa');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.4: Work_done_by_the_piston.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 1.4\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "m = 1.5;// in kg\n", "pi = 0.1;// in MPa\n", "pi= pi*10^6;// in Pa\n", "pf = 0.7;// in MPa\n", "pf= pf*10^6;// in Pa\n", "rho_i = 1.16;// kg per m^3\n", "vi = m/rho_i;// in m^3\n", "WorkDone= pi*vi*log(pi/pf);// in J\n", "disp(WorkDone*10^-3,'Work done in kJ is : ')\n", "if WorkDone<0 then\n", "disp('The -ve sign indicates work is done on the system, hence');\n", "disp((WorkDone*10^-3),'The work done by the piston in kJ is : ')\n", "end" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.5: Work_done.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exav1.5\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "p = 1.0;// in Mpa\n", "p = p*10^6;// in N per m^2\n", "del_v = 1.5;//m^3 per min\n", "del_v = del_v*60;// m^3 per h\n", "W = p * del_v;// W stands for work done in J\n", "W = W*10^-6;// in MJ\n", "disp(W,'Work done by the pump upon the water in an hour in MJ is : '); " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.6: Height_from_which_the_mass_should_fall.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 1.6\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "// W = 2*g*h\n", "// due to stirring of water\n", "g = 9.81;\n", "J = 4.1868*10^3;\n", "m = (0.2+10*10^-3)*10^3;// in gm\n", "s= 1;// in cal per gm°C\n", "del_T = 2;// in ° C\n", "H = m * s * del_T;// in cal\n", "H = H*10^-3;// in kcal\n", "// W = JH and W= 2*g*h\n", "h = J*H/(2 * g);// in m\n", "disp(h,'The height from the mass should be fall in meter is :');\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.7: Power_of_feed_pump.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// Exa 1.7\n", "clc;\n", "clear;\n", "close;\n", "// Given data\n", "// mass of 1 litr of water is 1 kg. so\n", "m = 5000;// in kg\n", "h = 10-1;// in m\n", "g= 9.81;//\n", "PE = m * g * h;// in N m\n", "PE = PE*10^-3;// in kj\n", "Eta = 0.85;\n", "// Eta = energy output/energy input\n", "E_input = PE/Eta;// in Kj\n", "E_input = E_input*10^3;// in J\n", "t = 45;// time in min\n", "t = t*60;// in sec\n", "P = E_input/t;// in J/s\n", "P = P*10^-3;// in kW\n", "disp(P,'Power required for the feed pump in kW is :');\n", "" ] } ], "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 }