{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 2: Fundamental concepts" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 2.1: Potential_energy.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Initialization of variables\n", "z=100 //ft\n", "m=32.1739 //lbm\n", "//calculations\n", "PE=m*z\n", "//results\n", "printf('Potential energy = %.2f ft-lbm',PE)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 2.3: Energy_and_mass_calculation.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc\n", "clear\n", "//Initialization of variables\n", "m0=18.016 //lbm\n", "gc=32.1739 //lbm ft/lbf sec^2\n", "c=186000*5280\n", "dU=94.4*10^6 //ft-lbf\n", "//calculations\n", "U=m0/gc *c^2\n", "dm= -dU*gc/c^2\n", "//results\n", "printf('Absolute energy of this mixture = %.2e ft-lbf',U)\n", "printf('\n In case b, there is no change in mass')\n", "printf('\n Change in mass = %.2e lbm',dm)\n", "disp('The answers are 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 }