{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 1: Introduction" ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example 1.1, Page Number: 6" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "\n", "\n", "#Variable declaration:\n", "Pi = 4200 #input power(W)\n", "E = 120 #voltage supply of generator(V)\n", "I = 32.2 #supply current(A)\n", "\n", "\n", "#Calculation:\n", "Po = E*I #output power(W)\n", "n = Po/Pi*100 #efficiency(%)\n", "Pl = Pi-Po #power lost(W)\n", "El = Pl*60 #energy lost per minute(J)\n", "\n", "\n", "#Result:\n", "print \"The percentage efficiency of the generator is\",n,\"%\"\n", "print \"Energy lost per minute of operation is\",El,\"J\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The percentage efficiency of the generator is 92.0 %\n", "Energy lost per minute of operation is 20160.0 J\n" ] } ], "prompt_number": 2 } ], "metadata": {} } ] }