{ "metadata": { "name": "", "signature": "sha256:882feb469ab957881db3b5f222288d33682abe4b2aecf80e0e5d8c61ca30e228" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 2 - Basic concepts " ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2 pg 11" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "##calculate the mass of oxygen and density of oxygen and specific volume and molar specific volume\n", "##initialisation of variables\n", "n= 0.25 ## k mol\n", "M= 32 ##kg/kmol\n", "V= 0.5 ##m^3\n", "##CALCULATIONS\n", "m= n*M\n", "d= m/V\n", "v= 1/d\n", "v1= V/n\n", "##RESULTS\n", "print'%s %.0f %s'%(\"mass of oxygen=\",m,'kg')\n", "print'%s %.0f %s'%(\"density of oxygen=\",d,'kg/m^3')\n", "print'%s %.4f %s'%('specific volume=',v,'kg/m^3')\n", "print'%s %.0f %s'%('molar specific volume=',v1,'m^3/kmol')\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "mass of oxygen= 8 kg\n", "density of oxygen= 16 kg/m^3\n", "specific volume= 0.0625 kg/m^3\n", "molar specific volume= 2 m^3/kmol\n" ] } ], "prompt_number": 3 } ], "metadata": {} } ] }