{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 8: Second and Third law topics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.1: PvsS_calculatio.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Initialization of variables\n", "P=500 //psia\n", "T=700 //F\n", "J=778\n", "//calculations\n", "dpds=1490 *144/J\n", "//results\n", "printf('dp by ds at constant volume = %d F/ft^3/lbm',dpds)\n", "disp('The answer is a bit different due to rounding off error in textbook')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.2: Thermal_efficiency_calculation.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Initialization of variables\n", "cp=0.25 //Btu/lbm R\n", "T0=520 //R\n", "T1=3460 //R\n", "//calculations\n", "dq=cp*(T0-T1)\n", "ds=cp*log(T0/T1)\n", "dE=dq-T0*ds\n", "eta=dE/dq\n", "//results\n", "printf('Thermal efficiency = %.1f percent',eta*100)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 8.3: Loss_of_available_energy_calculation.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Initialization of variables\n", "cp=0.25 //Btu/lbm R\n", "T0=520 //R\n", "T1=3460 //R\n", "dG=21069 //Btu/lbm\n", "dH=21502 //Btu/lbm\n", "//calculations\n", "dq=cp*(T0-T1)\n", "ds=cp*log(T0/T1)\n", "dE=dq-T0*ds\n", "eta=dE/dq\n", "dw=eta*dH\n", "de=-dG+dw\n", "//results\n", "printf('Loss of available energy = %d Btu/lbm',de)\n", "disp('The answer is a bit different due to rounding off error in textbook')" ] } ], "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 }