{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 3: Heat and Work" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.1: constant_pressure_work_done.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//solution\n", "//initialization of variables\n", "m=1 // mass in kg\n", "x=20/100 //quality of steam\n", "P=200 //constant pressure in kPa\n", "T1=100 //temperature intitial in degree centigrade\n", "T2=400 //temperature final in degree centigrade\n", "\n", "// first we find initial volume v1 and final volume v2\n", "\n", "// using table C.2\n", "vf=0.001061 // specific volume of saturated liquid in m^3 per kg \n", "vg=0.8857 //specific volume of saturated vapour in m^3 per kg \n", "\n", "v1=vf+x*(vg-vf);\n", "\n", "v2=1.549 //specific volume of steam in m^3 per kg at T2=400*C and P2=0.2MPa\n", "// now calculate work\n", "W=m*P*(v2-v1); //work done in constant pressure process\n", "printf('Work done is %.1f kJ',W) // work is in kJ as pressure was in kPa" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.2: 110mm_diameter_cylinder_work_done.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//initialization of variables\n", "D=110/1000 // diameter of cylinder in m\n", "V1=100e-6 // initial volume@ state 1 in m^3\n", "T1=60 // initial temp @ state 1 in *C\n", "T2=200 // final temo @ state 2 in *C\n", "M=50 // weight of piston in kg\n", "g=9.81 // gravitational accleration in m/sec^2\n", "Patm=100000 // atmospheric pressure in Pa\n", "A=%pi*(D^2)/4 // area of piston in m^2\n", "\n", "// BALANCING THE FORCES To GET PRESSURE P\n", "// M.g=P.A-Patm\n", "P=Patm+(M*g/A) // atm pressure is added to get absolute pressure\n", "\n", "v1=0.001017 // specific volume at 60*C and 0.15Mpa pressure\n", "m=V1/v1; // mass of water in kg\n", "\n", "// find volume at state 2 \n", "v2=1.444 // specific volume of steam at 200*C and 0.15 MPa\n", "V2=m*v2// final volume in m^3\n", "\n", "W=P*(V2-V1)/1000; // work done divided by 1000 to get in kJ\n", "printf('The work done is %.1f kJ',W)\n", "\n", "\n", "\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.3: isothermal_work_by_the_ideal_gas.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "//initialization of variables\n", "P1=200 // initial pressure in kPa\n", "V1=2 //initial volume in m^3\n", "P2=100 //final pressure in kPa\n", "C=P1*V1// isothermal process i.e P.V=constant\n", "// find final volume \n", "V2=P1*V1/P2 // final volume by P1.V1=P2.V2\n", "\n", "function[p]=pressure(v) // expressing pressure as function of volume\n", " p=C/v;\n", "endfunction\n", " \n", "W=integrate('C/v','v',V1,V2) //itegrating over volume to get work\n", "printf('The Work done by gas is %.0f kJ',W) // answer is approximated in textbook" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.4: A_100_kg_mass_drops_3_m.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc//\n", "//initialization of variables\n", "M=100 // mass in kg\n", "d=3 // depth by which mass drops in m\n", "V=0.002 // increased volume in m^3\n", "g=9.81 // gravitational accleration in m/sec^2\n", "Pgauge=100*1000// gauge pressure in N/m\n", "Patm =100*1000 // atmospheric pressure in N/m\n", "P=Pgauge+Patm // to get absolute pressure\n", "\n", "//calculate work done by paddle wheel\n", "Wpaddlewheel=(-M*g*d) // work is negative as it is done on the system\n", "\n", "//calculate work done on piston it \n", "Wboundary=P*V // area mulitiplied by height is volume thus W=P.V \n", "//net work\n", "Wnet=Wpaddlewheel+Wboundary; // Work in joule as SI units are used\n", "printf('The Net Work done is '+string(Wnet)+' J')\n", "// in textbook answer is 2450 J which is when we assume g=9.80 " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.5: drive_shaft_in_an_automobile_delivers.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "// initialization of variables\n", "T=100 // torque of shaft in N.m\n", "N=3000 // rotation speed in rpm\n", "omega=(N*2*%pi/60) // angular velocity in rad/sec\n", "// calculation of power\n", "Wdot=(T*omega); // power is work done per unit time\n", "printf('Power transmitted is %.1f hp',Wdot/746) // divided by 746 to convert W into hp\n", "//answer is approximated in textbook" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.6: Heat_supplied_at_constant_pressure.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "// initialization of variables\n", "D=10/100 //diameter of cylinder in m\n", "d=50/1000 //compression in spring in m\n", "Patm=100000 // atmospheric pressure in Pa\n", "K=10*1000 // spring constant converted in N/m\n", "w=50*9.81 // weight of piston in Newton =mass*gravitational acceleration\n", "\n", "// find the initial pressure in cylinder by force balance\n", "A=(%pi*D^2)/4; // area of piston\n", "P1=((Patm*A)+w)/A; // balancing forces on piston P1.A=Patm.A+W\n", "\n", "// work done by air to raise the piston for 50mm if spring not present\n", "Wgas=P1*A*d; // pressure*area= force and Work = Force* displacement\n", "\n", "// work done on spring to compress\n", "Wspring=(K*d^2)/2; // Work in j\n", "\n", "// now total work done by air is sum of two works\n", "Wnet=Wgas+Wspring; // Work in j\n", "\n", "printf('The net work done by air is %.2f J',Wnet)\n", "//The answer is approximated in textbook but here it is precise" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 3.7: non_quasiequilibrium_process.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "// variable initialization\n", "\n", "d=2 //distance travelled by weight in m\n", "m=50 // mass of weight in kg\n", "g=9.8 // gravitaional acceleration in m/sec^2\n", "\n", "// calculation of work in non-quasiequilibrium process\n", "W=m*g*d;// work in joules\n", "\n", "// the work done must be transferred as heat\n", "Q=W;\n", "\n", "printf('The heat that must transfer is '+string(Q)+' Joules')" ] } ], "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 }