{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 1: Fundamental concepts and definitions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.02: Effort_required.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.02.sce')\n", "//filename=pathname+filesep()+'1.02-data.sci'\n", "//exec(filename)\n", "//Diameter of the vessel(in m):\n", "d=30*10^-2\n", "//Accelertion due to gravity(in m/s^2):\n", "g=9.78\n", "//Atmospheric pressure(in Pa):\n", "p=76*(10^-2)*13550*g\n", "//Area:\n", "a=(%pi*d^2)/4\n", "//Effort required:\n", "F=p*a\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Effort required= %f N',F)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.03: To_find_out_the_actual_pressure_of_air.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.03.sce')\n", "//filename=pathname+filesep()+'1.03-data.sci'\n", "//exec(filename)\n", "//Difference in mercury column(in m):\n", "h=30*10^-2\n", "//Atmospheric Pressure(in kPa):\n", "pa=101\n", "//Acceleration due to gravity(in m/s^2):\n", "g=9.78\n", "//Guage pressure(in kPa):\n", "gp=13550*g*h*10^-3\n", "//Actual pressure:\n", "ap=gp+pa\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Actual pressure of air= %f kPa',ap)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.04: To_find_out_the_guage_pressure.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.04.sce')\n", "//filename=pathname+filesep()+'1.04-data.sci'\n", "//exec(filename)\n", "//Depth of tank(in m):\n", "h=1\n", "//Specific gravity:\n", "s=0.8\n", "//Density of water(in kg/m^3):\n", "d=1000\n", "//Acceleration due to gravity(in m/s^2):\n", "g=9.81\n", "//Density of oil(in kg/m3):\n", "dO=s*d\n", "//Gauge pressure(in kPa):\n", "gp=dO*g*h*10^-3\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Gauge pressure=%f kPa\n\n',gp)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.05: To_find_out_the_pressure_of_the_gas.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.05.sce')\n", "//filename=pathname+filesep()+'1.05-data.sci'\n", "//exec(filename)\n", "//Barometer Reading(in m):\n", "h=76*10^-2\n", "//Density of mercury(in kg/m^3):\n", "d=13.6*10^3\n", "//Acceleration due to gravity(in m/s^2):\n", "g=9.8\n", "//Difference of heights in gas barometer(in m):\n", "h1=40*10^-2\n", "//Pressure of gas(in kPa):\n", "pg=(d*g*h1+d*g*h)*10^-3\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Pressure of gas=%f kPa\n\n',pg)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.06: To_find_out_the_change_in_temperature.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.06.sce')\n", "//filename=pathname+filesep()+'1.06-data.sci'\n", "//exec(filename)\n", "//Mass of water(in kg):\n", "m=1\n", "//Altitude(in m):\n", "h=1000\n", "//Specific heat of water(in J/kg-K):\n", "c=4.18*10^3\n", "//Acceleration due to gravity(in m/s^2):\n", "g=9.81\n", "//Heat required for heating = Potential energy \n", "Q=m*g*h\n", "dT=Q/c\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n The change in temperature =%f degree celcius ',dT)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.07: To_find_out_the_spring_balance_reading.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.07.sce')\n", "//filename=pathname+filesep()+'1.07-data.sci'\n", "//exec(filename)\n", "//Weight of object at standard gravitational acceleration(in N):\n", "w=100\n", "//Standard acceleration due to gravity(in m/s^2):\n", "g=9.81\n", "//Gravitation acceleration at given location(in m/s^2):\n", "g1=8.5\n", "//Mass of object(in kg):\n", "m=w/g\n", "//Spring balance reading(in N):\n", "s=m*g1\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n The spring balance reading = %f N \n\n',s)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.08: To_determine_the_mass_of_the_piston.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.08.sce')\n", "//filename=pathname+filesep()+'1.08-data.sci'\n", "//exec(filename)\n", "//Diameter of cylinder(in m):\n", "dia=15*10^-2\n", "//Manometer difference in Hg column(in m):\n", "h=12*10^-2\n", "//Density of mercury(in kg/m^3):\n", "d=13.6*10^3\n", "//Acceleration due to gravity(in m/s^2):\n", "g=9.81\n", "//Weight of piston(in N): pressure*area\n", "w=h*d*g*%pi*dia^2/4\n", "//Mass of the piston(in kg):\n", "m=w/g\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Mass of the piston= %f kg',m)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.09: To_determine_the_pressure_of_the_steam.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.09.sce')\n", "//filename=pathname+filesep()+'1.09-data.sci'\n", "//exec(filename)\n", "//Height of water column in limb AB(in m):\n", "Hab=2*10^-2\n", "//Height of mercury column in limb CD(in m):\n", "Hcd=10*10^-2\n", "//Barometer reading for atmospheric pressure(in m):\n", "h=76*10^-2\n", "//Density of mercury(in kg/m^3):\n", "dm=13.6*10^3\n", "//Density of water(in kg/m^3):\n", "dw=1000\n", "//Acceleration due to gravity(in m/s^2):\n", "g=9.81\n", "//Atmospheric pressure(in kPa):\n", "Patm=dm*h*g*10^-3\n", "//Pressure of water in column AB(in kPa):\n", "Pab=dw*Hab*g*10^-3\n", "//Pressure of mercury in column CD(in kPa):\n", "Pcd=dm*Hcd*g*10^-3\n", "//Pressure of steam(in kPa):\n", "Ps=Patm+Pcd-Pab\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Pressure of steam = %f kPa',Ps)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.10: To_determine_the_absolute_pressure_in_A_and_B.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.10.sce')\n", "//filename=pathname+filesep()+'1.10-data.sci'\n", "//exec(filename)\n", "//Pressure in compartment A(in kPa):\n", "Pa=400\n", "//Pressure in compartment B(in kPa):\n", "Pb=150\n", "//Reading of barometer(in m):\n", "h=720*10^-3\n", "//Density of mercury(in kg/m^3):\n", "d=13.6*10^3\n", "//Acceleration due to gravity(in m/s^2):\n", "g=9.81\n", "//Atmospheric pressure from barometer reading(in kPa):\n", "Patm=d*g*h*10^-3\n", "//Absolute pressure in compartment A(in kPa):\n", "PaA=Pa+Patm\n", "//Absolute pressure in compartment B(in kPa):\n", "PaB=Pb+Patm\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Absolute pressure in compartment A=%f kPa',PaA)\n", "printf('\n Absolute pressure in compartment B=%f kPa \n\n',PaB)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.11: To_determine_the_air_pressure.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.11.sce')\n", "//filename=pathname+filesep()+'1.11-data.sci'\n", "//exec(filename)\n", "//Atmospheric pressure(in kPa):\n", "Patm=90\n", "//Density of water(in kg/m^3):\n", "dw=1000\n", "//Density of oil(in kg/m^3):\n", "doil=850\n", "//Density of mercury(in kg/m^3):\n", "dm=13600\n", "//Height of water column(in m):\n", "h1=0.15\n", "//Height of oil column(in m):\n", "h2=0.25\n", "//Height of mercury column(in m):\n", "h3=0.40\n", "//Acceleration due to gravity(in m/s^2):\n", "g=9.81\n", "//Pressure due to water column at reference line(in kPa):\n", "Pw=dw*g*h1*10^-3\n", "//Pressure due to oil column at reference line(in kPa):\n", "Po=doil*g*h2*10^-3\n", "//Pressure due to mercury column at reference line(in kPa):\n", "Pm=dm*g*h3*10^-3\n", "//Pressure due to air(in kPa):\n", "Pa=Patm+Pm-Pw-Po\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Air pressure=%f kPa \n\n',Pa)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.12: To_determine_the_kinetic_energy.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.12.sce')\n", "//filename=pathname+filesep()+'1.12-data.sci'\n", "//exec(filename)\n", "//Velocity of the object(in m/s):\n", "v=750\n", "//Gravitational force acting on the body(in N):\n", "F=4000\n", "//Acceleration due to gravity(in m/s^2):\n", "g=8\n", "//Mass of the object(in kg):\n", "m=F/g\n", "//Kinetic energy of the body(in J):\n", "KE=1/2*m*v^2\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Kinetic energy = %f J \n\n',KE)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.13: To_determine_the_molecular_weight_of_the_gas.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.13.sce')\n", "//filename=pathname+filesep()+'1.13-data.sci'\n", "//exec(filename)\n", "//Specific heat at constant pressure(in kJ/kg-K):\n", "Cp=2.286\n", "//Specific heat at constant volume(in kJ/kg-K):\n", "Cv=1.768\n", "//Universal gas constant(in kJ/kg-K):\n", "Ru=8.314\n", "//Gas constant(in kJ/kg-K):\n", "R=Cp-Cv\n", "//Molecular weight of gas(in kg/K mol):\n", "m=Ru/R\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Molecular weight of gas = %f kg/K mol',m)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.14: To_determine_the_final_temperature.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.14.sce')\n", "//filename=pathname+filesep()+'1.14-data.sci'\n", "//exec(filename)\n", "//Initial pressure(in Pa):\n", "p1=750*10^3\n", "//Initial temperature(in K):\n", "t1=600\n", "//Initial volume(in m^3):\n", "v1=0.2\n", "//Final pressure(in Pa):\n", "p2=2*10^5\n", "//Final volume(in m^3):\n", "v2=0.5\n", "//Final temperature(in K):\n", "t2=p2*v2*t1/(p1*v1)\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Final temperature = %f K \n\n',t2)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.15: To_find_out_mass_of_air_removed_and_volume_at_initial_states.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.15.sce')\n", "//filename=pathname+filesep()+'1.15-data.sci'\n", "//exec(filename)\n", "//Initial pressure(in kPa):\n", "p1=100\n", "//Initial temperature(in K):\n", "t1=300\n", "//Initial volume(in m^3):\n", "v1=5\n", "//Final pressure(in kPa):\n", "p2=50\n", "//Final temperature(in K):\n", "t2=280\n", "//Final volume(in m^3):\n", "v2=5\n", "//Gas constant for air(in J/kg-K):\n", "R=287//Initial pressure(in kPa):\n", "p1=100\n", "//Initial temperature(in K):\n", "t1=300\n", "//Initial volume(in m^3):\n", "v1=5\n", "//Final pressure(in kPa):\n", "p2=50\n", "//Final temperature(in K):\n", "t2=280\n", "//Final volume(in m^3):\n", "v2=5\n", "//Gas constant for air(in J/kg-K):\n", "R=287\n", "//Initial mass(in kg):\n", "m1=p1*v1/(R*t1)*10^3\n", "//Final mass(in kg):\n", "m2=p2*v2/(R*t2)*10^3\n", "//Mass removed(in kg):\n", "dm=m1-m2\n", "//Volume of this mass of air at initial states(in m^3):\n", "V=dm*R*t1/p1\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Mass of air removed = %f kg',dm)\n", "printf('\n Volume of air at initial states = %f m^3\n\n',V)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.16: To_determine_heat_to_be_supplied.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.16.sce')\n", "//filename=pathname+filesep()+'1.16-data.sci'\n", "//exec(filename)\n", "//Diameter of the vessel(in m):\n", "d=1\n", "//Height of the vessel(in m):\n", "h=4\n", "//Volume of the vessel(in m^3):\n", "v=%pi*d^2*h/4\n", "//Initial pressure(in kPa):\n", "p1=100\n", "//Initial temperature(in K):\n", "t1=300\n", "//Final pressure(in kPa):\n", "p2=125\n", "//Cp of hydrogen(in kJ/kg-K):\n", "Cp=14.307\n", "//Cv of volume(in kJ/kg-K):\n", "Cv=10.183\n", "//Final temperature(in K):\n", "t2=p2*t1/p1\n", "//Gas constant for hydrogen:\n", "R=Cp-Cv\n", "//Mass of hydrogen(in kg):\n", "m=p1*v/(R*t1)\n", "//Heat supplied at const. volume(in kJ):\n", "Q=m*Cv*(t2-t1)\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Heat to be supplied = %f kJ',Q)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.17: To_determine_the_final_pressure.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.17.sce')\n", "//filename=pathname+filesep()+'1.17-data.sci'\n", "//exec(filename)\n", "//Total volume(in m^3):\n", "v=2+2\n", "//Mass of air in container 1(in kg):\n", "m1=20\n", "//Mass of air in container 2(in kg):\n", "m2=4\n", "//Temperature of the system(in K):\n", "t=300\n", "//Gas constant for air(in J/kg-K):\n", "R=287\n", "//Total mass after the valve is opened(in kg):\n", "m=m1+m2\n", "//Final pressure(in kPa):\n", "p=m*R*t/v*10^-3\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Final pressure = %f kPa',p)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.18: To_determine_the_pressure_of_carbon_di_oxide_gas.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.18.sce')\n", "//filename=pathname+filesep()+'1.18-data.sci'\n", "//exec(filename)\n", "//Mass of gas(in kg):\n", "m=5\n", "//Volume of the container(in m^3):\n", "v=2\n", "//Temperature in the container(in K):\n", "t=300\n", "//Universal gas constant(in kJ/kg-K):\n", "R=8.314\n", "//Vander-Waals Constant(from table):\n", "a=3628.5*10^2\n", "b=3.14*10^-2\n", "//Molecular weight of CO2:\n", "mw=44.01\n", "//Considering it as a perfect gas\n", "//Gas constant for CO2(in j/kg-K):\n", "Rp=R*10^3/mw\n", "//Pressure of the gas(in N/m^2):\n", "pp=m*Rp*t/v\n", "//Considering it as a real gas:\n", "//Molar specific volume(in m^3/kg.mol):\n", "v1=v*mw/m\n", "//Vanderwall eqn:\n", "pr=R*10^3*t/(v1-b)-a/(v1^2)\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Pressure if considered perfect gas = %f N/m^2',pp)\n", "printf('\n\n Pressure if considered real gas = %f N/m^2',pr)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.19: To_find_out_the_specific_volume.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.19.sce')\n", "//filename=pathname+filesep()+'1.19-data.sci'\n", "//exec(filename)\n", "//Pressure of steam(in kPa):\n", "p=17672\n", "//Temperature of steam(in K):\n", "t=712\n", "//Critical pressure(in kPa):\n", "Pc=22.09*10^3\n", "//Critical temperature(in K):\n", "Tc=647.3\n", "//Gas constant for steam(in kJ/kg-K):\n", "Rs=0.4615\n", "//Considering perfect gas:\n", "//Specific volume(in m^3/kg)\n", "vp=Rs*t/p\n", "//Considering real gas:\n", "//Reduced pressure:\n", "Rp=p/Pc\n", "//Reduced temperature:\n", "Rt=t/Tc\n", "//Value of compressibility factor(from chart for Rp & Rt):\n", "Z=0.785\n", "//Specific volume(in m^3/kg):\n", "vr=Z*vp\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Specific volume considering perfect gas = %f m^3/kg',vp)\n", "printf('\n Specific volume considering real gas =%f m^3/kg \n\n',vr)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.1: To_find_out_the_pressure.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.01.sce')\n", "//filename=pathname+filesep()+'1.01-data.sci'\n", "//exec(filename)\n", "//Manometer deflection of Mercury(in m):\n", "h=30*10^-2\n", "//Density of mercury(in kg/m^3)\n", "d=13550\n", "//Acceleration due to gravity(in m/s^2):\n", "g=9.8\n", "//Pressure difference(in Pa):\n", "p=d*g*h*10^-2\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Pressure Difference= %f Pa \n\n',p)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.20: To_find_out_load_lifting_capacity.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.20.sce')\n", "//filename=pathname+filesep()+'1.20-data.sci'\n", "//exec(filename)\n", "//Diameter of the balloon(in m):\n", "d=5\n", "//Atmospheric pressure(in N/m^2):\n", "p=1.013*10^5\n", "//Temperature of the surroundings(in K):\n", "t=17+273\n", "//Universal gas constant(in J/kg-K):\n", "R=8.314*10^3\n", "//Molecular weight of hydrogen:\n", "mw=2\n", "//Gas constant for air(in J/kg-K):\n", "Ra=287\n", "//Volume of the balloon(in m^3):\n", "v=4/3*%pi*(5/2)^3\n", "//Gas constant for H2(in kJ/kg-K):\n", "Rh=R/mw\n", "//Mass of H2 in balloon(in kg):\n", "mh=p*v/(Rh*t)\n", "//Volume of air displaced(in m^3):\n", "vd=v\n", "//Mass of air displaced(in kg):\n", "ma=p*vd/(Ra*t)\n", "//Load lifting capacity due to buoyant force(in kg):\n", "L=ma-mh\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Load lifting capacity = %f \n\n',L)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.21: To_find_out_the_time_required.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.21.sce')\n", "//filename=pathname+filesep()+'1.21-data.sci'\n", "//exec(filename)\n", "//Volume of vessel(in m^3):\n", "v=20\n", "//Rate at which air is drawn(in m^3/min):\n", "q=0.25\n", "//Initial pressure/final pressure (ratio):\n", "Pr=4\n", "//Time required(in min):\n", "t=v/q*log(Pr)\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Time required = %f mins \n\n',t)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.22: To_determine_the_specific_heats.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.22.sce')\n", "//filename=pathname+filesep()+'1.22-data.sci'\n", "//exec(filename)\n", "//Total mass of system of gas(in kg):\n", "M=5\n", "//Compostion of Nitrogen:\n", "n=0.80\n", "//Compostion of Oxygen:\n", "o=0.18\n", "//Composition of Carbon dioxide:\n", "c=0.02\n", "//Compression ratio for Oxygen:\n", "ro=1.4\n", "//Compression ratio for Nitrogen:\n", "rn=1.4\n", "//Compression ratio for Carbon dioxide:\n", "rc=1.3\n", "//Universal gas constant(in J/kg-K):\n", "R=8314\n", "//Molecular weight of Nitrogen:\n", "mwn=28\n", "//Molecular weight of Oxygen:\n", "mwo=32\n", "//Molecular weight of Carbon dioxide:\n", "mwc=44\n", "//Gas constant for Nitrogen(in J/kg-K):\n", "Rn=R/mwn\n", "//Gas constant for Oxygen(in J/kg-K):\n", "Ro=R/mwo\n", "//Gas constant for Carbon dioxide(in J/kg-K):\n", "Rc=R/mwc\n", "//Gas constant for mixture(in J/kg-K):\n", "Rm=n*Rn+o*Ro+c*Rc\n", "//Specific heat at constant pressure for Nitrogen(in kJ/kg-K):\n", "Cpn=(rn/(rn-1))*Rn\n", "//Specific heat at constant pressure for Oxygen(in kJ/kg-K):\n", "Cpo=(ro/(ro-1))*Ro\n", "//Specific heat at constant pressure for Carbon dioxide(in kJ/kg-K):\n", "Cpc=rc/(rc-1)*Rc\n", "//Specific heat at constant pressure for the mixture(in kJ/kg-K):\n", "Cpm=n*Cpn+o*Cpo+c*Cpc\n", "//Number of moles of Nitrogen:\n", "nn=n*M/mwn\n", "//Number of moles of Oxygen:\n", "no=o*M/mwo\n", "//Number of moles of Carbon dioxide:\n", "nc=c*M/mwc\n", "//Total number of moles:\n", "nt=nn+no+nc\n", "//Mole fraction of Nitrogen:\n", "xn=nn/nt\n", "//Mole fraction of Oxygen:\n", "xo=no/nt\n", "//Mole fraction of Carbon dioxide:\n", "xc=nc/nt\n", "//Molecular weight of the mixture\n", "mwm=xn*mwn+xo*mwo+xc*mwc\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n The molecular weight of the mixture = %f kg/kmol \n\n',mwm)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.23: To_determine_partial_pressure_of_gases.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.23.sce')\n", "//filename=pathname+filesep()+'1.23-data.sci'\n", "//exec(filename)\n", "//Composition of Oxygen:\n", "o=0.18\n", "//Composition of Nitrogen:\n", "n=0.75\n", "//Composition of Carbon dioxide:\n", "c=0.07\n", "//Pressure of mixture(in MPa):\n", "p=0.5\n", "//Temperature of the mixture(in K):\n", "t=107+273\n", "//Total mass of the mixture(in kg):\n", "m=5\n", "//Molecular weight of Nitrogen:\n", "mwn=28\n", "//Molecular weight of Oxygen:\n", "mwo=32\n", "//Molecular weight of Carbon dioxide:\n", "mwc=44\n", "//Total values of mixture(assume):\n", "v=1\n", "//Mole fraction of Oxygen(by volume):\n", "xvo=o/v\n", "//Mole fraction of Nitrogen(by volume):\n", "xvn=n/v\n", "//Mole fraction of Carbon dioxide(by volume):\n", "xvc=c/v\n", "//Molecular weight of the mixture(in kg/kmol):\n", "mwm=xo*mwo+xn*mwn+xc*mwc\n", "//Mole fraction of Nitrogen(by mass):\n", "xmn=n*mwn/mwm\n", "//Mole fraction of Oxygen(by mass):\n", "xmo=o*mwo/mwm\n", "//Mole fraction of Carbon dioxide(by mass):\n", "xmc=c*mwc/mwm\n", "//Partial pressure of Oxygen:\n", "po=o*p\n", "//Partial pressure of Nitrogen:\n", "pn=n*p\n", "//Partial pressure of Carbon dioxide:\n", "pc=c*p\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Mole fraction of Oxygen by mass = %f ',xmo)\n", "printf('\n Mole fraction of Nitrogen by mass = %f ',xmn)\n", "printf('\n Mole fraction of Carbon dioxide by mass = %f ',xmc)\n", "printf('\n\n Partial pressure of Oxygen = %f MPa',po)\n", "printf('\n Partial pressure of Nitrogen = %f MPa',pn)\n", "printf('\n Partial pressure of Carbon dioxide = %f MPa',pc)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.24: To_find_out_the_equilibrium_pressure_and_temperature.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.24.sce')\n", "//filename=pathname+filesep()+'1.24-data.sci'\n", "//exec(filename)\n", "//Volume of gas in 1 chamber(in m^3):\n", "V=3\n", "//Partial pressure of Nitrogen(in kPa):\n", "pn=800\n", "//Partial pressure of Carbon dioxide(in kPa):\n", "pc=400\n", "//Temperature of Nitrogen(in K):\n", "tn=480\n", "//Temperature of Carbon dioxide(in K):\n", "tc=390\n", "//Compression ratio for Nitrogen:\n", "rn=1.4\n", "//Compression ratio for Carbon dioxide:\n", "rc=1.3\n", "//Universal gas constant(in J/kg-K):\n", "R=8314\n", "//Molecular weight of Nitrogen:\n", "mwn=28\n", "//Molecular weight of Carbon dioxide:\n", "mwc=44\n", "//Moles of Nitrogen:\n", "nn=pn*V/(R*tn)\n", "//Moles of Carbon dioxide:\n", "nc=pc*V/(R*tc)\n", "//Total no of moles:\n", "nt=nn+nc\n", "//Specific heat for Nitrogen at constant volume(in J/kg-K):\n", "cvn=(R/mwn)/(rn-1)\n", "//Specific heat for Carbon dioxide at constant volume(in J/kg-K):\n", "cvc=(R/mwc)/(rc-1)\n", "//Mass of Nitrogen(in kg):\n", "mn=nn*mwn\n", "//Mass of Carbon dioxide(in kg):\n", "mc=nc*mwc\n", "//Equilibrium temperature of the mixture(in K):\n", "t=(mn*cvn*tn+mc*cvc*tc)/(mn*cvn+mc*cvc)\n", "//Equilibrium pressure of the mixture(kPa):\n", "p=nt*R*t/(V+V)\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Equilibrium temperature = %f K ',t)\n", "printf('\n Equilibrium pressure = %f kPa',p)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.25: To_find_out_specific_heat_of_the_mixture.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.25.sce')\n", "//filename=pathname+filesep()+'1.25-data.sci'\n", "//exec(filename)\n", "//Mass of hydrogen taken(in kg):\n", "mh=2\n", "//Mass of helium taken(in kg):\n", "mhe=3\n", "//Specific heat at constant pressure for hydrogen(in kJ/kg-K):\n", "Ch=11.23\n", "//Specific heat at constant pressure for helium(in kJ/kg-K):\n", "Che=5.193\n", "//Total mass of the mixture(in kg):\n", "mt=mh+mhe\n", "//Specific heat at constant pressure for the mixture(in kJ/kg-K):\n", "Cm=(Ch*mh+Che*mhe)/mt\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Specific heat at constant pressure for the mixture = %f kJ/kg-K \n\n',Cm)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.26: To_determine_capacity_of_the_vessel.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.26.sce')\n", "//filename=pathname+filesep()+'1.26-data.sci'\n", "//exec(filename)\n", "//Mass of Hydrogen(in kg):\n", "mh=18\n", "//Mass of Nitrogen(in kg):\n", "mn=10\n", "//Mass of Carbon dioxide(in kg):\n", "mc=2\n", "//Initial temperature(in K):\n", "t1=27+273.15\n", "//Final temperature(in K):\n", "t2=2*t1\n", "//Universal gas constant(in kJ/kg-K):\n", "R=8.314\n", "//Molecular weight of Hydrogen:\n", "mwh=2\n", "//Molecular weight of Nitrogen:\n", "mwn=28\n", "//Molecular weight of Carbon dioxide:\n", "mwc=44\n", "//Initial pressure of the gases(in kPa)\n", "p1=101.325\n", "//Gas constant for Hydrogen(in kJ/kg-K):\n", "Rh=R/mwh\n", "//Gas constant for Nitrogen(in kJ/kg-K):\n", "Rn=R/mwn\n", "//Gas constant for Carbon dioxide(in kJ/kg-K):\n", "Rc=R/mwc\n", "//Gas constant for the mixture(in kJ/kg-K):\n", "Rm=(mh*Rh+mn*Rn+mc*Rc)/(mh+mn+mc)\n", "//Capacity of the vessel(in m^3):\n", "V=(mh+mn+mc)*Rm*t1/p\n", "//Final pressure of the mixture(in kPa):\n", "p2=p1*t2/t1\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Volume of the vessel = %f m^3',V)\n", "printf('\n Final pressure of the mixture =%f kPa',p2)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.27: To_determine_the_ratio_of_exit_to_inlet_diameter.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.27.sce')\n", "//filename=pathname+filesep()+'1.27-data.sci'\n", "//exec(filename)\n", "//Temperature of entering air(in K):\n", "t1=27+273.15\n", "//Temperature to which it gets heated up to(in K):\n", "t2=500\n", "//Ratio of exit to inlet diameter:\n", "R=sqrt(t2/t1)\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Ratio of exit to inlet diameter = %f \n\n',R)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1.28: To_determine_the_mass_pumped_out.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//pathname=get_absolute_file_path('1.28.sce')\n", "//filename=pathname+filesep()+'1.28-data.sci'\n", "//exec(filename)\n", "//Volume of vessel(in m^3):\n", "v=2\n", "//Atmospheric pressure(in kPa):\n", "p1=76/76*101.325\n", "//Temperature of gas(in K):\n", "t1=27+273.15\n", "//Pressure difference(in kPa):\n", "dp=70/76*101.325\n", "//Univeresal gas constant(in kJ/kg-K):\n", "R=8.314\n", "//Molecular weight of hydrogen:\n", "mwh=2\n", "//Temperature after cooling(in case 2)(in K):\n", "t2=10+273.15\n", "//Case 1:\n", "//Gas constant of hydrogen(in kJ/kg-K):\n", "Rh=R/mwh\n", "//Final pressure of hydrogen(in kPa):\n", "p2=p1-dp\n", "//Mass pumped out(in kg):\n", "m=(p1-p2)*v/(Rh*t1)\n", "//Case 2:(temperature reduces till 10 degrees isochorically)\n", "//Pressure after cooling(in kPa):\n", "p3=t2/t1*p2\n", "printf('\n\n RESULT \n\n')\n", "printf('\n\n Mass pumped out = %f kg',m)\n", "printf('\n Final pressure if the temperature is reduced = %f kPa',p2)" ] } ], "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 }