{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# CHAPTER 1: UNITS, DIMENSIONS AND STANDARDS" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1-1, Page Number: 8" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total Magenetic Flux = 5.0 micro weber\n", "Cross Section= 6.45e-04 meter square\n", "Flux Density(B)= 7.75 mT\n" ] } ], "source": [ "import math\n", "\n", "#Variable Declaration\n", "\n", "phi=500*10**-8 #in weber\n", "A=(1*1)*(2.54*10**-2)**2 #in meter square \n", "\n", "#Calculation\n", "B=phi/A #in tesla \n", "\n", "#Results\n", "print \"Total Magenetic Flux =\",phi*10**6,\"micro weber\"\n", "print \"Cross Section=\",'%.2e' % A,\"meter square\"\n", "print \"Flux Density(B)=\",round(B*10**3,2),\"mT\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1-2, Page Number: 8" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Celsius Temperature= 37.0 degree celsisus\n", "Kelvin Temperature= 310.15 K\n" ] } ], "source": [ "import math\n", "\n", "#Variable Declaration\n", "F=98.6 #Temperature =98.6 Farenheit \n", "\n", "#Calculations\n", "\n", "Celsius_temperature=(F-32)/1.8 #in Celsius\n", " \n", "Kelvin_temperature=(F-32)/1.8+273.15 #in Kelvin\n", "\n", "#Results\n", "print \"Celsius Temperature=\",Celsius_temperature,\"degree celsisus\"\n", "print \"Kelvin Temperature=\",round(Kelvin_temperature,2),\"K\"\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1-3, Page Number: 10" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The dimensions of Voltage and Resistance are expressed in array format[M L T I],\n", "Voltage= [ 1 2 -3 -1]\n", "Resistance= [ 1 2 -3 -2]\n" ] } ], "source": [ "import numpy as np\n", "\n", "# Powers of M, L,T,I are expressed in an array consisting of four elements\n", "#Each array element represents the power of the corresponding dimension\n", "#it is of the form [M,L,T,I]\n", "\n", "\n", "P=np.array([1,2,-3,0]) #Dimesnion of Power\n", "I=np.array([0,0,0,1]) #Dimension of Current\n", "\n", "E=P-I #As E=P/I, the powers have to be subtracted\n", "\n", "R=E-I #As R=E/I, the powers have to be subtracted\n", "\n", "print \"The dimensions of Voltage and Resistance are expressed in array format[M L T I],\"\n", "print \"Voltage=\",E\n", "print \"Resistance=\",R" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.9" } }, "nbformat": 4, "nbformat_minor": 0 }