{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 1:Concepts of Measurements and Electromechanical Instruments" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.1,Page No:28" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "static error = 0.08 V\n", "static correction = -0.08 V\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "Vm = 112.68; #voltmeter reading in V\n", "Vt = 112.6; #true value of voltage in V\n", "\n", "#calculations\n", "Es = Vm-Vt; #static error in V\n", "Cs = -Es; #static correction in V\n", "\n", "#result\n", "print'static error = %3.2f'%Es,'V';\n", "print'static correction = %3.2f'%Cs,'V';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.2,Page No:29" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "true value = 92.28 °C\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "V = 92.35; #thermometer reading in °C\n", "Cs = -0.07; #static correction in °C\n", "\n", "#calculations\n", "Vt = V+Cs; #true value in °C\n", "\n", "#result\n", "print'true value = %3.2f'%Vt,'°C';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.3,Page No:29" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "absolute error =-0.05 V\n", "relative error = 0.05 V\n", "relative error = -1.85 %\n", "relative error = -1.00 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "Vm = 2.65; #voltage reading in V\n", "Vt = 2.70; #true voltage value in V\n", "x = 5; #scale range\n", "\n", "#calculation\n", "Es = Vm-Vt; #absolute error in V\n", "Cs = -Es; #absolute correction in V\n", "Er = (Es/float(Vt))*100; #relative error as a function of true value in %\n", "Es1 = (Es/float(x))*100; #relative error as a function of full scale deflection in %\n", "\n", "#result\n", "print'absolute error =%3.2f'%Es,'V';\n", "print'relative error = %3.2f'%Cs,'V';\n", "print'relative error = %3.2f'%(Er),'%';\n", "print'relative error = %3.2f'%(Es1),'%';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.4,Page No:29" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "static error = 0.6 bar\n", "static correction = -0.6 bar\n", "relative error = 1.45 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "Vm = 42; #pressure reading in bar\n", "Vt = 41.4; #true value of pressure in bar\n", "x = 5; #scale range\n", "\n", "#calculations\n", "Es = Vm-Vt; #static error in bar\n", "Vs = -Es; #static correction in bar\n", "Er = (Es/float(Vt))*100; #relative error in %\n", "\n", "#result\n", "print'static error = %3.1f'%Es,'bar';\n", "print'static correction = %3.1f'%Vs,'bar';\n", "print'relative error = %3.2f'%Er,'%';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.5,Page No:29" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "percentage error = 0.3 %\n", "percentage error = 1.5 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "p1 = 50; #pressure range in bar\n", "e = 0.15; #error in bar(indicates both in -ve and +ve value)\n", "p2 = 10; #error in bar\n", "\n", "#calculations\n", "pe1 = (e/float(p1))*100; #percentage error on basis of maximum scale value(indicates both in -ve and +ve value)\n", "pe2 = (e/float(p2))*100; #percentage error on basis of maximum scale value of 10 bar(indicates both in -ve and +ve value)\n", "\n", "#result\n", "print'percentage error = %3.1f'%pe1,'%';\n", "print'percentage error = %3.1f'%pe2,'%';\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.6,Page No:30" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "error is possibly as large as 2.60 % but probably not large than 1.69 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "\n", "e1 = 0.3; #accuracy limits for transmitter(indicates both in -ve and +ve value)\n", "e2 = 1.4; #accuracy limits for relay(indicates both in -ve and +ve value)\n", "e3 = 0.9; #accuracy limits for receiver(indicates both in -ve and +ve value)\n", "\n", "\n", "#calculations\n", "em = e1+e2+e3; #maximum possible error(indicates both in -ve and +ve value)\n", "x = math.sqrt((e1**2)+(e2**2)+(e3**2)); #least root square accuracy(indicates both in -ve and +ve value)\n", "\n", "#result\n", "print'error is possibly as large as %3.2f'%em,'%',' but probably not large than %3.2f'%x,'%'; \n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.7,Page No:31" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "maximum static error = 0.11 bar\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "r1 = 5; #pressure gauge minimum value in bar\n", "r2 = 60; #pressure guage maximum value in bar\n", "a = 0.2; #accuracy in percent(indicates both in -ve and +ve value)\n", "\n", "#calculations\n", "r = r2-r1; #span of pressure gauge in bar\n", "es = (a*r)/float(100); #maximum static error in bar(indicates both in -ve and +ve value)\n", "\n", "#result\n", "print'maximum static error = %3.2f'%es,'bar';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.8,Page No:34" ] }, { "cell_type": "code", "execution_count": 27, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "sensitivity = 2.5 *(math.pi) mm/Pa\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "d = 300; #full scale deflection in degrees\n", "r = 90; #radius of scale in mm\n", "p = 60; #calibration pressure in pascals\n", "\n", "#calculations\n", "f = (d/float(180)); #full scale deflection(multiple of math.pi) in rad.\n", "l = f*r; #length of scale(multiple of math.pi) in mm\n", "s = l/float(p); #sensitivy in mm/pa\n", "\n", "#result\n", "print'sensitivity = %3.1f'%s,'*(math.pi) mm/Pa';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.9,Page No:35" ] }, { "cell_type": "code", "execution_count": 28, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "sensitivity = 0.4 mm/Ω\n", "deflection factor = 2.5 Ω/mm\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "d = 2.4; #change in deflection in mm\n", "R = 6; #change in arm of wheatstone bridge in Ω\n", "\n", "#calculations\n", "s = d/float(R); #sensitivity in mm/Ω\n", "D = R/float(d); #deflection factor in Ω/mm\n", "\n", "#result\n", "print'sensitivity = %3.1f'%s,'mm/Ω';\n", "print'deflection factor = %3.1f'%D,'Ω/mm';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.10,Page No:35" ] }, { "cell_type": "code", "execution_count": 29, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "deflection on the chart = 6.96 mm\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "s1 = 6.8; #sensitivity of piezoelectric transducer in pC/bar\n", "s2 = 0.0032; #sensitivity of charge amplifier in V/pC\n", "s3 = 16; #sensitivity of ultraviolet charge recorder in mm/V\n", "i = 20; #pressure change in bar \n", "\n", "#calculations\n", "S = s1*s2*s3; #overall sensitivty of measuring system in mm/bar\n", "O = S*i; #change of output signal in mm\n", "\n", "\n", "#result\n", "print'deflection on the chart = %3.2f'%O,'mm';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.11,Page No:37" ] }, { "cell_type": "code", "execution_count": 30, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "smallest change = 0.3 N\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "Rn = 200; #range of force 0-200\n", "r = 0.15; #resolution of full scale in %\n", "\n", "#calculations\n", "s = (r*Rn)/float(100); #smallest change which can be measured in N\n", "\n", "#result\n", "print'smallest change = %3.1f'%s,'N';\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.12,Page No:37" ] }, { "cell_type": "code", "execution_count": 32, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "resolution = 0.1 V\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "V = 50; #full scale reading in V\n", "d = 50; #divisions\n", "y = 10; #reciprocal of scale division\n", "\n", "#calculations\n", "x = 1/float(y); #scale division\n", "s1 = V/float(d); #one scale division\n", "R = x*s1; #resolution in V\n", "\n", "#result\n", "print'resolution = %3.1f'%R,'V';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.13,Page No:37" ] }, { "cell_type": "code", "execution_count": 33, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "resolution of digital voltmeter = 1 mV\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "f = 9.999; #full scale reading in V\n", "R = 9999; #read out range in counts\n", "\n", "#calculations\n", "r = f/float(R); #resolution of a digital voltmeter in V\n", "\n", "#result\n", "print'resolution of digital voltmeter = %3.1d'%(r*10**3),'mV';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.14,Page No:38" ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Hence a change of 0.55°C must occur before it is detected\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "t1 = 300; #calibration minimum value in °C\n", "t2 = 800; #calibration minimum value in °C \n", "d = 0.11; #dead zone in percent of span\n", "\n", "#calculations\n", "s = t2-t1; #span of the pyrometr in °C\n", "D = (d*s)/float(100); #dead zone in °C\n", "\n", "#result\n", "print'Hence a change of %3.2f°C must occur before it is detected'%D,;\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.15,Page No:39" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "loading error 24 %\n", "loading error 0.040 %\n", "When voltmeter with high internal resistance is connectedd across two points in a high resistance circuit ,\n", "the loading effect is appreciable and, therefore, the voltmeter gives misleading voltage reading\n", "\n", "The saame voltmeter has a negligible loading error when connected across a low resistance circuit and\n", "it gives more reliable voltage reading\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "Rv = 125; #internal resistance of the voltmeter in kΩ\n", "Rappt = 30; #apparent resistance in kΩ\n", "Rappt1 = 50; #apparent resistance in kΩ\n", "v1 = 180; #voltage in V\n", "i1 = 6*10**-3; #current in A\n", "v2 = 60; #voltage in V\n", "i2 = 1.2*10**-3; #current in A\n", "\n", "#calculations\n", "Rt = (v1/float(i1))*10**-3; #total resistance of circuit in kΩ\n", "Ract = (Rt*Rv)/float(Rv-Rt); #actual value of resistance in kΩ\n", "pe = ((Ract-Rappt)/float(Ract))*100; #percentage loading error in %\n", "Rt1 = (v2/float(i2))*10**-3; #total resistance of circuit in kΩ\n", "Ract1 = ((Rt1*Rv)/float(Rv-(Rt1/float(1000)))); #actual value of resistance in kΩ\n", "pe1 = ((Ract1-Rappt1)/float(Ract1))*100; #percentage loading error in %\n", "\n", "#calculations\n", "print'loading error %3.0f'%pe,'%';\n", "print'loading error %3.3f'%pe1,'%';\n", "print'When voltmeter with high internal resistance is connectedd across two points in a high resistance circuit ,'\n", "print'the loading effect is appreciable and, therefore, the voltmeter gives misleading voltage reading\\n'\n", "print'The saame voltmeter has a negligible loading error when connected across a low resistance circuit and'\n", "print'it gives more reliable voltage reading'\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.18,Page No:60" ] }, { "cell_type": "code", "execution_count": 45, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "thermometers reading 67.27 °C\n", "thermometers reading 78.86 °C\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration \n", "Ii = 160; #input in °C\n", "t1 = 1.2; #time constant in s\n", "t2 = 2.2; #time constant in s\n", "Iin = 20; #initial reading in °C\n", "\n", "#calculations\n", "x = t1/float(t2); #ratio of time to time constant \n", "I0 = Ii*(1-(math.exp(-x))); #thermometer's reading\n", "e = math.exp(-x);\n", "I1 = (Ii)+(((Iin)-(Ii))*e); #thermometer's reading if intial temperature was 20°C\n", "#calculations\n", "print'thermometers reading %3.2f'%I0,'°C';\n", "print'thermometers reading %3.2f'%I1,'°C';\n", " \n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.19,Page No:60" ] }, { "cell_type": "code", "execution_count": 46, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "temperature after 10s is 142.4 °C\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "t1 = 5; #time constant in s\n", "t2 = 10; #time constant in s\n", "Iin = 30; #initial temperature in °C\n", "Ii = 160; #final temperature in °C\n", "\n", "#calculations\n", "x = t2/float(t1); #ratio of time to time constant \n", "I0 = (Ii)+(((Iin)-(Ii))*(math.exp(-x))); #temperature afte 10s in °C\n", "\n", "#result\n", "print'temperature after 10s is %3.1f'%I0,'°C'; \n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.20,Page No:60" ] }, { "cell_type": "code", "execution_count": 48, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "time taken by the transducer = 2.08 s\n" ] } ], "source": [ "import math\n", " \n", "#variable declaration\n", "T = 9; #three time constant in s\n", "X = 0.5; #temperature difference of I0/I1 \n", "\n", "#calculations\n", "T1 = T/float(3); #time constant in s\n", "t = -3*math.log(1-X); #time taken by the transducer in s\n", "\n", "#result\n", "print'time taken by the transducer = %3.2f'%t,'s';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.21,Page No:61" ] }, { "cell_type": "code", "execution_count": 49, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "resistance = 111.74 Ω\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "sg = 0.296; #steady stage gain W/°C\n", "dT = 80; #change in temperature in °C\n", "t = 12; #time in s\n", "T = 4.8; #time constant in s\n", "R = 90; #stable resistance before step change in W\n", "\n", "\n", "#calculations\n", "r = sg*dT; #step input in terms of resistance in Ω\n", "Rt = r*(1-(math.exp(-t/T)))+(R); #resistance in Ω\n", "\n", "#result\n", "print'resistance = %3.2f'%Rt,'Ω';\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.22,Page No:61" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "time constant for the thermometer = 6.12 s\n", "indicated temperature after five minutes constant 139.16 °C\n", "After a time interval equivalent to five times constants, the thermometer reaches the equivaence condition\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "Iin = 15; #intial temperature in °C\n", "Ii = 140; #temperature in °C\n", "Io = 75; #temperature in °C\n", "X = 5\n", "\n", "#calculation\n", "x = (Io-Ii)/float(Iin-Ii); #change in output to input\n", "t = -4/float(math.log(x)); #time constant for the thermometer in s \n", "I0 = Ii+(Iin-Ii)*math.exp(-X); #indicated temperature after five minutes constant in °C\n", "\n", "#result\n", "print'time constant for the thermometer = %3.2f'%t,'s';\n", "print'indicated temperature after five minutes constant %3.2f'%I0,'°C';\n", "print'After a time interval equivalent to five times constants, the thermometer reaches the equivaence condition'\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.23,Page No:62" ] }, { "cell_type": "code", "execution_count": 52, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "time constant = 19.5 s\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "Edy = 3.9; #dynamic error °C\n", "phi = 0.2; #slope °C/s\n", "\n", "#calculation\n", "T = Edy/float(phi); #time constant in s\n", "\n", "#result\n", "print'time constant = %3.1f'%T,'s';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.24,Page No:62" ] }, { "cell_type": "code", "execution_count": 53, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "actual altitude 2460 m\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "T = 8; #time constant in s\n", "rt = 5; #rate of rise of the ballon in m/s\n", "T1 = 30; #temperature indicated at ana altitude of 2500 min °C\n", "Rt = 0.011; #rate of temperature variation with altitude in °C/m\n", "h = 2500; #height in m\n", "\n", "#calculations\n", "y = Rt*rt; #rate of change of temperature with time in °C/s\n", "Edy = y*T; #error in °C\n", "e = Edy/float(Rt); #error in amplitude in m\n", "a = h-e; #actual altitude in m\n", "\n", "#result\n", "print'actual altitude %d'%a,'m';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.25,Page No:62" ] }, { "cell_type": "code", "execution_count": 54, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ratio of output to input 0.8467\n", "Time lag 44.64 s\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "T = 50; #time constant of thermometer on s\n", "t = 500; #time period in s\n", "\n", "#calculations\n", "w = (2*math.pi)/float(t); #frequency of temperature variaton in rad/s\n", "x = 1/float(math.sqrt(1+((w*T)**2))); #ratio of output to input \n", "phi = math.atan(w*T); #phase shift in rad \n", "tl = (1/float(w))*phi; #time lag in s\n", "\n", "#result\n", "print'ratio of output to input %3.4f'%x;\n", "print'Time lag %3.2f'%tl,'s';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.26,Page No:63" ] }, { "cell_type": "code", "execution_count": 55, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "variation in indicated temperature 22.15 °C\n", "lag = 18.42 s\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "T = 20; #time constant in s\n", "Ii = 25; #sinusoidal variation of input in °C\n", "t = 4; #time in minutes\n", "\n", "#calculation\n", "f = 1/float(t*60); #frequency in Hz\n", "w = 2*math.pi*f; #angular frequency in rad./s\n", "x = 1/float(math.sqrt((1+(w*T)**2))); #temperature indicated to temperature of the medium \n", "I0 = x*Ii; #variation in temperature indictaed in °C(indicates both in -ve and +ve value)\n", "phl = math.atan(w*T); #phase lag in rad\n", "l = (1/w)*phl; #lag in seconds\n", "\n", "#result\n", "print'variation in indicated temperature %3.2f'%I0,'°C';\n", "print'lag = %3.2f'%l,'s';\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.27,Page No:64" ] }, { "cell_type": "code", "execution_count": 56, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "maximum time constant 5.526e-05 s\n", "time lag at 90 cycles per second is 5.523e-05 s\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "f = 120; #input frequency in s\n", "p = 4; #amplitude accuracy permissible in %\n", "x = 0.96 #temperature indicated to temperature of the medium \n", "\n", "#calculations\n", "w = 2*math.pi*f; #angular fruequency in rad/s\n", "x1 = 1/float(x);\n", "t1 = ((x1)-1);\n", "T = t1/(float(w)); #maximum time constant in s\n", "phi = math.atan(w*T); #for sinusoidal input phi \n", "tl = (1/float(w))*phi; #time lag at 90 cycles per second\n", "\n", "#result\n", "print'maximum time constant %3.3e'%T,'s';\n", "print'time lag at 90 cycles per second is %3.3e'%tl,'s';\n", "\n", "\n", "\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.28,Page No:64" ] }, { "cell_type": "code", "execution_count": 57, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "maximum temperature = 568.68 °C\n", "minimum temperature = 531.32 °C\n", "phase shift = 0.899 °\n", "time lag = 7.15 s\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "R1 = 520; #Range of temperature in °C\n", "R2 = 580; #Range of temperature in °C\n", "t = 50; #periodic time in s\n", "T = 10; #time constant in s\n", "Ii = 30; #initial amplitude in °C\n", "\n", "#calculations\n", "R = (R1+R2)/float(2.0); #temperature oscillating mean value in °C\n", "w = (2*math.pi)/float(t); #angular frequency in rad/s\n", "X = 1/float(math.sqrt((1+(w*T)**2))); #amplitude ratio after transient effect dies away \n", "I0 = X*Ii; #amplitude in °C \n", "Tmax = R+I0; #maximum temperature in °C\n", "Tmin = R-I0; #minimum temperature in °C\n", "phi = math.atan(w*T); #phase shift in rad\n", "Tl = (1/float(w))*phi; #time lag in s\n", "\n", "#result\n", "print'maximum temperature = %3.2f'%Tmax,'°C';\n", "print'minimum temperature = %3.2f'%Tmin,'°C';\n", "print'phase shift = %3.3f'%phi,'°';\n", "print'time lag = %3.2f'%Tl,'s';\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.29,Page No:65" ] }, { "cell_type": "code", "execution_count": 59, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "output expression 0.0463 sin(25t-82.4 °)\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "Ii = 0.35; #sinusoidal input amplitude from given expression 0.35sin(25t)\n", "T = 0.3; #time constant in s\n", "w = 25; #angular frequency in °,from given expression 0.35sin(25t)\n", "\n", "#calculations\n", "\n", "X = 1/float(math.sqrt((1+((w*T)**2)))); #amplitude ratio\n", "I0 = X*Ii; #magnitude of output \n", "phi = math.atan(w*T); #phase shift in radians\n", "\n", "#result\n", "print'output expression %3.4f'%I0,'sin(25t-%3.1f'%((phi*180)/float(math.pi)),'°)';\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.30,Page No:66" ] }, { "cell_type": "code", "execution_count": 60, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "maximum value of temperature indicated 6.82 °C\n", "Time lag = 35.12 s\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "T1 = 18; #time constant for the bulb in s\n", "T2 = 36; #time constant for the well in s\n", "t = 120; #time in s\n", "Temp = 20; #rate of change in temperature in °C\n", "\n", "#calculation\n", "w = (2*math.pi)/float(t);\n", "X1 = 1/float(math.sqrt((1+(w*T1)**2))); #amplitude ratio of first system \n", "X2 = 1/float(math.sqrt((1+(w*T2)**2))); #amplitude for second system \n", "X = X1*X2; #amplitude for double capacity system\n", "Tmax = Temp*X; #maximum temperature in °C(indicates both in -ve and +ve value)\n", "Al = math.atan(w*T1)+math.atan(w*T2); #angle of lag in rad\n", "Tl = (1/float(w))*Al; #time lag in s\n", "\n", "#result\n", "print'maximum value of temperature indicated %3.2f'%Tmax,'°C';\n", "print'Time lag = %3.2f'%Tl,'s';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.31,Page No:66" ] }, { "cell_type": "code", "execution_count": 61, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "output expression 0.857 sin(2t-30.96 °) + 0.316 sin(10t-71.57 °)\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "T = 0.3; #time constant in s\n", "I1 = 2; #sinusoidal input amplitude from given expression 2sin(2t)+0.5sin(10t)\n", "w1 = 2; #angular frequency in °,from given expression 2sin(2t)+0.5sin(10t)\n", "I2 = 0.5; #sinusoidal input amplitude from given expression 2sin(2t)+0.5sin(10t)\n", "w2 = 10; #angular frequency in °,from given expression 2sin(2t)+0.5sin(10t)\n", "\n", "#calculations\n", "X1 = 1/float(math.sqrt((1+((w1*T)**2)))); #magnitude of output \n", "phi1 = math.atan(w1*T); #phase shift in radians\n", "X2 = 1/float(math.sqrt((1+((w2*T)**2)))); #magnitude of output\n", "phi2 = math.atan(w2*T); #phase shift in radians\n", "\n", "#result\n", "\n", "print'output expression %3.3f'%X1,'sin(2t-%3.2f' %((phi1*180)/float(math.pi)),'°)','+ %3.3f'%X2,'sin(10t-%3.2f' %((phi2*180)/float(math.pi)),'°)';\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.32,Page No:67" ] }, { "cell_type": "code", "execution_count": 63, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "output expression 1.916 sin(2t-16.7 °) - 0.128 sin(8t+180-50.19 °)\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "T = 0.15; #time constant in s\n", "I1 = 2; #sinusoidal input amplitude from given expression 2sin(2t)+0.5cos(8t) or 2sin(2t)-0.5sin(180-8t) \n", "w1 = 2; #angular frequency in °,from given expression 2sin(2t)+0.5sin(8t) or 2sin(2t)-0.5sin(180-8t)\n", "I2 = 0.2; #sinusoidal input amplitude from given expression 2sin(2t)+0.5sin(8t) or 2sin(2t)-0.5sin(180-8t)\n", "w2 = 8; #angular frequency in °,from given expression 2sin(2t)+0.5sin(8t) or 2sin(2t)-0.5sin(180-8t)\n", "\n", "#calculations\n", "X1 = 1/float(math.sqrt((1+((w1*T)**2)))); #amplitude ratio\n", "I01 = X1*I1; #magnitude of output \n", "phi1 = math.atan(w1*T); #phase shift in radians\n", "X2 = 1/float(math.sqrt((1+((w2*T)**2)))); #amplitude ratio\n", "I02 = X2*I2; #magnitude of output\n", "phi2 = math.atan(w2*T); #phase shift in radians\n", "\n", "#result\n", "\n", "print'output expression %3.3f'%I01,'sin(2t-%3.1f' %((phi1*180)/float(math.pi)),'°)','- %3.3f'%I02,'sin(8t+180-%3.2f' %((phi2*180)/float(math.pi)),'°)';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.34,Page No:68" ] }, { "cell_type": "code", "execution_count": 64, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "percentage reduction in mass 24.4 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "m1 = 4.5; # mass in g\n", "p = 1.15; #percentage increase requiredd in %\n", "\n", "#formula\n", "#wn2 = p*wn1\n", "#m2 = m1*(wn2/wn1)\n", "x = (1/float(p))**2;\n", "#m2 = m1*x\n", "#percentage reduction = (m1-m2)/m1\n", "# p = (m1-x*m1)/m1\n", "m3 = ((1-x)/float(1))*100; #percentage reduction in mass(%)\n", "\n", "\n", "#result\n", "print'percentage reduction in mass %3.1f'%m3,'%'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.35,Page No:69" ] }, { "cell_type": "code", "execution_count": 66, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "damping ratio = 0.274\n", "damped natural frequency = 5.268 rad/s\n", "static sensitivity = 1\n", "time constant = 0.1826 s\n" ] } ], "source": [ "import math\n", "wn = 5.477; #natural frequency\n", "k1 = 0.1; #ratio of 2*gamma/wn\n", "k = 1; #static sensitivity \n", "\n", "#calculations\n", "gamma = (k1*wn)/float(2); #damping ratio\n", "y = (1-(gamma**2)); #damped natural frequency in rad/s\n", "wd = wn*math.sqrt(y); #static sensitivity\n", "t = 1/float(wn); #time constant in s\n", "\n", "#result\n", "print'damping ratio = %3.3f'%gamma;\n", "print'damped natural frequency = %3.3f'%wd,'rad/s';\n", "print'static sensitivity =%3.0f'%k;\n", "print'time constant = %3.4f'%t,'s';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.36,Page No:70" ] }, { "cell_type": "code", "execution_count": 67, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "natural frequency = 2.95 rad/s\n", "damping ratio 0.556\n", "damped natural frequency 2.454 rad/s\n", "time constant 0.339 s\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "w = 1.95; #angular frequency in rad/s\n", "em = 8; #maximum permissible error in %\n", "J = 0.14; #moment of inertia of load in kg m**2\n", "q = 1.22; #torsional constant of the shaft in Nm/rad\n", "M = 1.08; #amplitude ratio \n", "\n", "#calculations\n", "wn = math.sqrt(q/float(J)); #natural frequency in rad/s\n", "r = w/float(wn); #normalised frequency ratio\n", "x = 1/float(M**2); \n", "gamma =math.sqrt((x-((1-r**2)**2))/float(2*r)**2); #damping ratio \n", "wd = wn*(math.sqrt(1-(gamma**2))); #damped natural frequency in rad/s\n", "T = 1/float(wn); #time constant in s\n", "\n", "#result\n", "print'natural frequency = %3.2f'%wn,'rad/s';\n", "print'damping ratio %3.3f'%gamma;\n", "print'damped natural frequency %3.3f'%wd,'rad/s';\n", "print'time constant %3.3f'%T,'s';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.37,Page No:71" ] }, { "cell_type": "code", "execution_count": 68, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "effective damping ratio = 0.56\n", "undamped natural frequency = 2.74 Hz\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "po =12; #percentage overshoot in %\n", "Tr = 0.22; #rise time in s\n", "\n", "#calculations\n", "x = -math.log(12/float(100)); \n", "gamma = x/float(math.sqrt((x**2)+(math.pi**2))); #effective damping ratio \n", "wd = math.pi/float(Tr); #damped natural frequency in rad/s\n", "wn = wd/float(math.sqrt(1-(gamma**2))); #undamped angular frequency in rad/s\n", "fn = wn/float(2*math.pi); #undamped natural frequency in Hz\n", " \n", "#result\n", "print'effective damping ratio = %3.2f'%gamma;\n", "print'undamped natural frequency = %3.2f'%fn,'Hz';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.38,Page No:73" ] }, { "cell_type": "code", "execution_count": 70, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "natural frequency 1.4\n", "amplitude ratio 0.504\n", "error = 49.6 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "gamma = 0.62; #damping ratio \n", "fn = 5; #natural frequency in Hz\n", "f = 7; #exicitation frequency in Hz\n", " \n", "#calculations\n", "r = f/float(fn); #ratio of excitation frequency tonatural frequency\n", "M = 1/float(math.sqrt(((1-(r**2))**2)+((2*gamma*r)**2))); #amplitude ratio\n", "e = (1-M)*100; #error in %\n", "\n", "#result\n", "print'natural frequency %3.1f'%r;\n", "print'amplitude ratio %3.3f'%M;\n", "print'error = %3.1f'%e,'%';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.39,Page No:73 " ] }, { "cell_type": "code", "execution_count": 73, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "the deviation remains within 12 percent of output for the frequency range 0 - 723.09 cps\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "fn = 800; #natural frequency of the system in cps\n", "gamma = 62; #damping ratio per cent\n", "d = 12; #maximum amount of deviation of amplitude ratio in per cent\n", "M = 1.12; \n", "M1 =0.88;\n", "\n", "#calculations\n", "#M = 1/math.sqrt(((1-r**2)**2)+((2*0.62*r)**2));\n", "x = (1/float(M))**2;\n", "#1+(r**4)-(2*r**2)+(1.58*(r**2))=x\n", "#r**4-((0.462)*(r**2))+0.203 =0\n", "y = (1/float(M1))**2\n", "#1+(r**4)-(2*r**2)+(1.58*(r**2))=y\n", "#r**4-(0.462*(r**2))-0.29=0\n", "x = math.sqrt((0.462**2)+(4*0.29));\n", "r1 = (0.462+x)/float(2);\n", "r = math.sqrt(r1);\n", "f = fn*r;\n", "\n", "#result\n", "print'the deviation remains within 12 percent of output for the frequency range 0 - %3.2f'%f,'cps';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Example:1.40,Page No:74" ] }, { "cell_type": "code", "execution_count": 74, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "required expresssion for the output is 0.495 sin(3.77t-69.00°)\n", "output ampliude 0.495\n", "output frequency 3.77\n", "phase lag 69.00 °\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "f = 0.6; #frequency in rad/s\n", "m = 1; #magnitude of input\n", "a = 3.77; #angle value from sin(3.77t)\n", "\n", "#calculations\n", "w = 2*math.pi*f; #angular frequency\n", "#x = complex(8/float(((j*w)**2)+(4*j*w)+20));\n", "x1 =(-(w**2)+20)/float(8);\n", "y1 = (4*w)/float(8);\n", "x = (complex(x1,y1));\n", "X = abs(x);\n", "phi = ((math.atan(y1/float(x1)))*180)/(math.pi); #phase lag in rad\n", "m = (1/float(2.02))*m;\n", "\n", "#result\n", "print'required expresssion for the output is %3.3f'%m,'sin(3.77t-%3.2f°)'%phi;\n", "print'output ampliude %3.3f'%m;\n", "print'output frequency %3.2f'%a;\n", "print'phase lag %3.2f'%phi,'°';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.41,Page No:75" ] }, { "cell_type": "code", "execution_count": 75, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "when the error is specified as a percentage of full scale deflection,the wattmeter reading may be between 42.5 to 57.5 W\n", "when the error is specified as a percentage of true value,the wattmeter reading may be between 49.25 to 50.75 W\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "R = 500; #range of wattemeter in W\n", "e = 1.5; #percentage of full scale deflection rantging -1.5 to +1.5\n", "Qs = 50; #true or specified power in W\n", "me1 = 7.5; #percentage of full scale deflection indicating -7.5 to +7.5\n", "\n", "#calculations\n", "me = (e/float(100))*R; #magnitude of limiting error at full scale in W ranging -me to +me\n", "Rmax = Qs+me; #maximum wattmeter reading may be Rmax in W\n", "Rmin = Qs-me; #minimum wattmeter reading may be Rmin in W\n", "Er = (me1/float(Qs))*100; #relative error in %\n", "Em = ((e*Qs)/float(100));\n", "Mmax = Qs+Em; #maximum wattmeter reading may be Mmax in W\n", "Mmin = Qs-Em; #minimum wattmeter reading may be Mmin in W\n", "\n", "#result\n", "print'when the error is specified as a percentage of full scale deflection,the wattmeter reading may be between %3.1f'%Rmin,'to %3.1f'%Rmax,'W';\n", "print'when the error is specified as a percentage of true value,the wattmeter reading may be between %3.2f'%Mmin,'to %3.2f'%Mmax,'W';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.42,Page No:76" ] }, { "cell_type": "code", "execution_count": 77, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "percentage limiting error = 6.00 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "Er = 3; #accuracy of flow meter of full scale reading in % ranging -Er to +Er\n", "Qs = 2.5*10**-6; #full scale reading in m**3/s\n", "Qs1 = 1.25*10**-6; #flow measured by the meter in m**3/s\n", "\n", "#calculations\n", "dQ = (Er/float(100))*Qs; #magnitude of limiting error ranging -dQ to +dQ in m**3/s\n", "Er1 = dQ/float(Qs1); #relative error \n", "Q1 = Qs1*(1); #flow rate in m**3/s\n", "Q2 = Qs1*Er1; #flow rate in m**3/s\n", "Er2 = (Q2/float(Q1))*100; #percentage limiting error ranging -Er2 to +Er1 in %\n", "\n", "#result\n", "\n", "print'percentage limiting error = %3.2f'%Er2,'%';\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "##Example:1.43,Page No:77" ] }, { "cell_type": "code", "execution_count": 82, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "limting value of resultant reistance is 140.40 and 129.60 Ω\n", "percent limiting error of the series combination of resistance 4.00 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "R1 = 25; #resitance in Ω\n", "R2 = 65; #resitance in Ω\n", "R3 = 45; #resitance in Ω\n", "e1 = 4; #limiting error indicating both in -ve and +ve values in %\n", "e2 = 4; #limiting error indicating both in -ve and +ve values in %\n", "e3 = 4; #limiting error indicating both in -ve and +ve values in % \n", "\n", "#calculations\n", "e11 = (e1*R1)/float(100); #error value indicating both in -ve and +ve values\n", "e21 = (e2*R2)/float(100); #error value indicating both in -ve and +ve values\n", "e31 = (e3*R3)/float(100); #error value indicating both in -ve and +ve values\n", "R = R1+R2+R3; #magnitude of resitance in Ω\n", "e = e11+e21+e31; #error indicating both in -ve and +ve values\n", "Rmax = R+e;\n", "Rmin = R-e;\n", "p =((e)/float(R))*100; #percent limiting error of the series combination of resistance in %(indicating both in -ve and +ve values)\n", "\n", "\n", "#result\n", "print'limting value of resultant reistance is %3.2f'%Rmax,' and %3.2f'%Rmin,' Ω';\n", "print'percent limiting error of the series combination of resistance %3.2f'%p,'%';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.44,Page No:78" ] }, { "cell_type": "code", "execution_count": 83, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "limiting error in the measurement of resistance 2.80 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "x = 1.2; #limiting error in the measurement of power(dP/p) in % \n", "y = 0.8; #limiting error in the measurement of current(dI/I) in %\n", "\n", "#calculations\n", "z = (x+(2*y)); #limiting error in the measurement of resistance(dR/R) indicating -z to +z in %\n", "\n", "#result\n", "print'limiting error in the measurement of resistance %3.2f'%z,'%';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.45,Page No:78" ] }, { "cell_type": "code", "execution_count": 84, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "magnitude of unknown resitance= 4400.00 Ω\n", "relative limiting error 1.50 %;\n", "limiting error 66.00 Ω\n", "the guaranteed values of resitance lie between 4334.00 and 4466.00 Ω\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "R1 = 50; #resistance in Ω\n", "R2 = 500; #resistance in Ω\n", "R3 = 440; #resistance in Ω\n", "dR1 = 0.5; #limiting error(dR1/R1) of R1 ranging -dR1 to +dR1 in %\n", "dR2 = 0.5; #limiting error(dR2/R2) of R1 ranging -dR2 to +dR2 in %\n", "dR3 = 0.5; #limiting error(dR3/R3) of R1 ranging -dR3 to +dR3 in %\n", "\n", "#calculations\n", "R4 = (R2*R3)/float(R1); #unknoen resistance in Ω\n", "x = (dR1+dR2+dR3); #relative limiting error of unknown resistance ranging -x to +x in %\n", "e = (x*R4)/float(100); #limiting error(Ω) indcating -ve and +ve values \n", "Rmax = R4+e; #maximum value of resitance in Ω\n", "Rmin = R4-e; #minimum value of resistance in Ω\n", "\n", "#result\n", "print'magnitude of unknown resitance= %3.2f'%R4,'Ω';\n", "print'relative limiting error %3.2f'%x,'%;'\n", "print'limiting error %3.2f'%e,'Ω';\n", "print'the guaranteed values of resitance lie between %3.2f'%Rmin,'and %3.2f'%Rmax,'Ω';\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.46,Page No:78" ] }, { "cell_type": "code", "execution_count": 85, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "limiting error in force 0.2918 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration \n", "db = 0.01; #accuracy of width ranging -db to +db\n", "b = 4.5; #width in mm\n", "dd = 0.01; #accuracy of depth ranging -dd to +dd\n", "d = 0.9; #depth in mm\n", "dl = 0.01; #accuracy of length ranging -dl to +dl\n", "l = 45; #length in mm\n", "x = 0.2; #modulus of rigidity(dE/E) in %\n", "dy = 0.1; #accuracy of deflection ranging -dy to +dy\n", "y = 1.8; #deflection in mm\n", "\n", "#calculations \n", "f = (x+(db/float(b))+(3*(dd/float(d)))+(3*(dl/float(l)))+(dy/float(y))); #limiting error in force(dF/F) ranging -f to +f in %\n", "\n", "#result\n", "print'limiting error in force %3.4f'%f,'%';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.47,Page No:79" ] }, { "cell_type": "code", "execution_count": 86, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "magnitude of power = 1.993 kW\n", "magnitude of limiting error 0.0339 kW\n", "magnitude of limiting error can lie between 2.03 and 1.96 kW\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "F = 4.26; #force at the end of torque arm in kg\n", "dF = 0.02; #error in force ranging -dF to +dF in kg \n", "L = 382; #length of torque arm in mm\n", "dL = 1.2; #error in length ranging -dL to +dL in mm\n", "R = 1192; #number of revolutions during time t\n", "dR = 1.0; #error in number of revolutions \n", "t = 60; #time for test run in s\n", "dt = 0.5; #error in time in s\n", "\n", "#calculations\n", "P = (2*math.pi*9.81*F*L*R)/float(t*10**6); #magnitude of power in kW\n", "p = ((dF/float(F))+(dL/float(L))+(dR/float(R))+(dt/float(t))); #limiting error(dP/P) computed ranging -p to +p\n", "dp = p*P; #limiting error in kW\n", "Pmax = P+dp; #maximum value of power in kW\n", "Pmin = P-dp; #minimum value of power in kW\n", "\n", "#result\n", "print'magnitude of power = %3.3f'%P,'kW';\n", "print'magnitude of limiting error %3.4f'%dp,'kW';\n", "print'magnitude of limiting error can lie between %3.2f'%Pmax,'and %3.2f'%Pmin,'kW';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.48,Page No:80" ] }, { "cell_type": "code", "execution_count": 87, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "power percentage to original power 101.96 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "I = 26.5; #current in A\n", "Ix = 1.1; #ammeter reading was low by Ix\n", "R = 0.12; #resistance in Ω\n", "Rx = 0.25; #resistance reading was high by Rx\n", "\n", "#calculations\n", "It = I*((1+(Ix/float(100)))); #true value of current in A\n", "Rt = R*((1-(Rx/float(100)))); #true value of resistance in Ω\n", "Pt = (It**2)*Rt; #true value of power in W\n", "Pm = (I**2)*R; #measured value of power in W\n", "P = (Pt/float(Pm))*100; #power percentage of that originally calculated in %\n", "\n", "#result\n", "print'power percentage to original power %3.2f'%P,'%';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.49,Page No:87" ] }, { "cell_type": "code", "execution_count": 88, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "arthimetic mean 1.461 mm\n", "average deviation 0.065\n", "standard deviation 0.08075 mm\n", "variance 0.00652 mm**2\n" ] } ], "source": [ "import math\n", "\n", "#varioable declaration\n", "q1 = 1.34; #micrometer reading in mm\n", "q2 = 1.38; #micrometer reading in mm\n", "q3 = 1.56; #micrometer reading in mm\n", "q4 = 1.47; #micrometer reading in mm\n", "q5 = 1.42; #micrometer reading in mm\n", "q6 = 1.44; #micrometer reading in mm\n", "q7 = 1.53; #micrometer reading in mm\n", "q8 = 1.48; #micrometer reading in mm\n", "q9 = 1.40; #micrometer reading in mm\n", "q10 = 1.59; #micrometer reading in mm\n", "n = 10; #number of readings\n", "\n", "#calculations\n", "q = (q1+q2+q3+q4+q5+q6+q7+q8+q9+q10)/float(10); #arthmetic mean in mm\n", "d1 = q1-q; #derivation in mm\n", "d2 = q2-q; #derivation in mm\n", "d3 = q3-q; #derivation in mm\n", "d4 = q4-q; #derivation in mm\n", "d5 = q5-q; #derivation in mm\n", "d6 = q6-q; #derivation in mm\n", "d7 = q7-q; #derivation in mm\n", "d8 = q8-q; #derivation in mm\n", "d9 = q9-q; #derivation in mm\n", "d10 = q10-q; #derivation in mm\n", "d = (abs(d1)+abs(d2)+abs(d3)+abs(d4)+abs(d5)+abs(d6)+abs(d7)+abs(d8)+abs(d9)+abs(d10))/float(n); #average deviation in mm\n", "s = math.sqrt(((d1**2)+(d2**2)+(d3**2)+(d4**2)+(d5**2)+(d6**2)+(d7**2)+(d8**2)+(d9**2)+(d10**2))/float(n-1)); #standard deviation in mm\n", "V = s**2; #variance in mm**2\n", "\n", "#result\n", "print'arthimetic mean %3.3f'%q,'mm';\n", "print'average deviation %3.3f'%d;\n", "print'standard deviation %3.5f'%s,'mm';\n", "print'variance %3.5f'%V,'mm**2';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.50,Page No:88" ] }, { "cell_type": "code", "execution_count": 90, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "arthimetic mean 419.62 kHz\n", "average deviation 5.75 kHz\n", "standard deviation 6.55 kHz\n", "variance 42.95 kHz**2\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "q1 = 412; #resonant frequency in KHz\n", "q2 = 428; #resonant frequency in KHz\n", "q3 = 423; #resonant frequency in KHz\n", "q4 = 415; #resonant frequency in KHz\n", "q5 = 426; #resonant frequency in KHz\n", "q6 = 411; #resonant frequency in KHz\n", "q7 = 423; #resonant frequency in KHz\n", "q8 = 416; #resonant frequency in KHz\n", "n = 8; #number of readings \n", "\n", "#calculations\n", "q = (q1+q2+q3+q4+q5+q6+q7+q8+q9+q10)/float(n); #arthimetc mean in khz\n", "d1 = q1-q; #deviation in kHz\n", "d2 = q2-q; #deviation in kHz\n", "d3 = q3-q; #deviation in kHz\n", "d4 = q4-q; #deviation in kHz\n", "d5 = q5-q; #deviation in kHz\n", "d6 = q6-q; #deviation in kHz\n", "d7 = q7-q; #deviation in kHz\n", "d8 = q8-q; #deviation in kHz\n", "d = (abs(d1)+abs(d2)+abs(d3)+abs(d4)+abs(d5)+abs(d6)+abs(d7)+abs(d8))/float(n); #average deviation in kHz\n", "s = math.sqrt(((d1**2)+(d2**2)+(d3**2)+(d4**2)+(d5**2)+(d6**2)+(d7**2)+(d8**2))/float(n-1)); #standard deviation in k Hz\n", "V = s**2; #variance in (kHz)**2\n", "\n", "#result\n", "print'arthimetic mean %3.2f'%q,'kHz';\n", "print'average deviation %3.2f'%d,'kHz';\n", "print'standard deviation %3.2f'%s,'kHz';\n", "print'variance %3.2f'%V,'kHz**2';\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.51,Page No:94" ] }, { "cell_type": "code", "execution_count": 92, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "arthimetic mean 39.87 °C\n", "standard deviation 0.22136 °C\n", "probable error = 0.15 °C\n", "probable error of mean 0.05 °C\n", "range 0.80 °C\n" ] } ], "source": [ "import math\n", "\n", "#varioable declaration\n", "q1 = 39.6; #temperature reading °C\n", "q2 = 39.9; #temperature reading °C\n", "q3 = 39.7; #temperature reading °C\n", "q4 = 39.9; #temperature reading °C\n", "q5 = 40.0; #temperature reading °C\n", "q6 = 39.8; #temperature reading °C\n", "q7 = 39.9; #temperature reading °C\n", "q8 = 39.8; #temperature reading °C\n", "q9 = 40.4; #temperature reading °C\n", "q10 = 39.7; #temperature reading °C\n", "n = 10; #number of observations\n", "\n", "#calculations\n", "q = (q1+q2+q3+q4+q5+q6+q7+q8+q9+q10)/float(10); #arthimetic mean in °C\n", "d1 = q1-q; #deviation in °C\n", "d2 = q2-q; #deviation in °C\n", "d3 = q3-q; #deviation in °C\n", "d4 = q4-q; #deviation in °C\n", "d5 = q5-q; #deviation in °C\n", "d6 = q6-q; #deviation in °C\n", "d7 = q7-q; #deviation in °C\n", "d8 = q8-q; #deviation in °C\n", "d9 = q9-q; #deviation in °C\n", "d10 = q10-q; #deviation in °C\n", "R1 = 40.4; #maximum value of temperature in °C\n", "R2 = 39.6; #minimum value of temperature in °C\n", "s = math.sqrt(((d1**2)+(d2**2)+(d3**2)+(d4**2)+(d5**2)+(d6**2)+(d7**2)+(d8**2)+(d9**2)+(d10**2))/float(n-1)); #standard deviation in °C\n", "r1 = 0.6745*s; #probable error of one reading in °C\n", "rm = r1/math.sqrt(float(n-1)); #probable error of mean in °C\n", "R = R1-R2; #range in °C\n", "#result\n", "print'arthimetic mean %3.2f'%q,'°C';\n", "print'standard deviation %3.5f'%s,'°C';\n", "print'probable error = %3.2f'%r1,'°C';\n", "print'probable error of mean %3.2f'%rm,'°C';\n", "print'range %3.2f'%R,'°C';\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.52,Page No:96" ] }, { "cell_type": "code", "execution_count": 94, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "arthimetic mean = 200.77 °C\n", "average deviation = 1.096 °C\n", "standard deviation = 1.482 °C\n", "variance = 2.197 °C**2\n", "probable error of one reading = 1 °C\n", "probable error of the mean = 0.1 °C\n", "standard deviation of the standard deviation = 0.1048 °C\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "T1 = 197; #temperature reading °C\n", "T2 = 198; #temperature reading °C\n", "T3 = 199; #temperature reading °C\n", "T4 = 200; #temperature reading °C\n", "T5 = 201; #temperature reading °C\n", "T6 = 202; #temperature reading °C\n", "T7 = 203; #temperature reading °C\n", "T8 = 204; #temperature reading °C\n", "T9 = 205; #temperature reading °C\n", "f1 = 2; #frequency of occurence \n", "f2 = 4; #frequency of occurence \n", "f3 = 10; #frequency of occurence \n", "f4 = 24; #frequency of occurence \n", "f5 = 36; #frequency of occurence \n", "f6 = 14; #frequency of occurence \n", "f7 = 5; #frequency of occurence \n", "f8 = 3; #frequency of occurence \n", "f9 = 2; #frequency of occurence \n", "\n", "\n", "#calculations\n", "t1 = T1*f1;\n", "t2 = T2*f2;\n", "t3 = T3*f3;\n", "t4 = T4*f4;\n", "t5 = T5*f5;\n", "t6 = T6*f6;\n", "t7 = T7*f7;\n", "t8 = T8*f8;\n", "t9 = T9*f9;\n", "n = (f1+f2+f3+f4+f5+f6+f7+f8+f9); \n", "AM = (t1+t2+t3+t4+t5+t6+t7+t8+t9)/float(n); #arthimetic mean in °C\n", "tf = (t1+t2+t3+t4+t5+t6+t7+t8+t9)/float(n);\n", "d1 = T1-tf;\n", "d2 = T2-tf;\n", "d3 = T3-tf;\n", "d4 = T4-tf;\n", "d5 = T5-tf;\n", "d6 = T6-tf;\n", "d7 = T7-tf;\n", "d8 = T8-tf;\n", "d9 = T9-tf;\n", "x1 = d1*f1;\n", "x2 = d2*f2;\n", "x3 = d3*f3;\n", "x4 = d4*f4;\n", "x5 = d5*f5;\n", "x6 = d6*f6;\n", "x7 = d7*f7;\n", "x8 = d8*f8;\n", "x9 = d9*f9;\n", "x = abs(x1)+abs(x2)+abs(x3)+abs(x4)+abs(x5)+abs(x6)+abs(x7)+abs(x8)+abs(x9);\n", "y1 = f1*(d1**2);\n", "y2 = f2*(d2**2);\n", "y3 = f3*(d3**2);\n", "y4 = f4*(d4**2);\n", "y5 = f5*(d5**2);\n", "y6 = f6*(d6**2);\n", "y7 = f7*(d7**2);\n", "y8 = f8*(d8**2);\n", "y9 = f9*(d9**2);\n", "y = y1+y2+y3+y4+y5+y6+y7+y8+y9;\n", "sigma = x/float(n); #average deviation in °C\n", "sd = math.sqrt(y/float(n)); #standard deviation in °C\n", "V = sd**2; #variance in °C**2\n", "r1 = 0.6745*sd; #probable error of one reading in °C\n", "rm = r1/float(math.sqrt(n)); #probable error of mean in °C\n", "sigmam = sd/float(math.sqrt(n)); #standard deviation of the mean in °C\n", "sigmasd = sigmam/float(math.sqrt(2)); #standard deviation of standard deviation in °C\n", "\n", "#result\n", "print'arthimetic mean = %3.2f'%AM,'°C';\n", "print'average deviation = %3.3f'%sigma,'°C';\n", "print'standard deviation = %3.3f'%sd,'°C';\n", "print'variance = %3.3f'%V,'°C**2';\n", "print'probable error of one reading = %3.0f'%r1,'°C';\n", "print'probable error of the mean = %3.1f'%rm,'°C';\n", "print'standard deviation of the standard deviation = %3.4f'%sigmasd,'°C';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Example:1.53,Page No:97" ] }, { "cell_type": "code", "execution_count": 96, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "thus about 57 % of readings are within -1.2A to 1.2A of the true value\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "I = 80; #current in A\n", "p = 0.2; #p(y) value given \n", "x = 0.8; #probabiltiy of error \n", "y = 0.5248; #y valu from probability tables for sorresponding p(y) value\n", "x1 = 1.2; #probabiltiy of error\n", "\n", "#calculation\n", "sigma = (x/float(y)); #standard eviation\n", "y1 = x1/float(sigma); \n", "#p(y) value corresponding to y1 value from probabitiy table is 0.2842\n", "p1 = 0.2842;\n", "P = (2*p1)*100; #probabity of an error \n", "\n", "#result\n", "print'thus about %3.0f'%P,'% of readings are within -1.2A to 1.2A of the true value';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.54,Page No:97" ] }, { "cell_type": "code", "execution_count": 99, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "number of readings exceeding maximum deflection of 25mm is 16 mm\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "x1 =25; #deflaction in mm\n", "x2 = 21.9; #deflaction in mm\n", "r = 2.1; #probable error in mm\n", "\n", "#calculations\n", "x = x1-x2; #deviation in mm\n", "sigma = r/float(0.6745); #standard deviation\n", "y = x/float(sigma); #ratio \n", "n = 2*0.341*100; \n", "ne = 100-n; #number of readings exceeding a deviation of 3.1\n", "nx = ne/float(2); #number of readings exceeding maximum deflection of 25mm in mm\n", "\n", "#result\n", "print'number of readings exceeding maximum deflection of 25mm is %3.0f'%nx,'mm';\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.55,Page No:98" ] }, { "cell_type": "code", "execution_count": 100, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "total number of rods whose length between specified limits is 8953\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "#in case of me of normal distribution .thereis equal probability of +ve and -ve errors\n", "n1 = 5000; #number of rods having length greater than 20 mm\n", "n2 = 1000; #number of rods having length greater than 20.25 mm\n", "n3 = 5000; #number of rods having length smaller than 20 mm\n", "y = 1.3; #from probability tables ,corresponding to the probability of p(y) \n", "x1 = 20.25; #maximum length of rod ,that should not be exceed in mm\n", "x2 = 20.0; #nominal length in mm\n", "x4 = 19.5; #minimum length of rod ,that should not be smmaler than this value in mm\n", "y2 = 0.4953; #from probability tables ,corresponding to the y value \n", "\n", "#calculations\n", "n4 = n1-n2; #number of rods wehere length lies between 20mm and 20.25\n", "x = x1-x2; #probability that 4000 rods have a value greater than 20mm and less than 20.25mm\n", "sigma = x/float(y); #standard deviation\n", "y1 = (x2-x4)/float(sigma); #y value for with nominal length of 19.5mm and 20mm\n", "n = (n1+n3)*y2; #number of rods that have lengths between 19.5 and 20mm\n", "N = n+n4; #total number of rods whose length between specified limits \n", "\n", "#result\n", "print'total number of rods whose length between specified limits is %3.0f'%N;\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.56,Page No:98" ] }, { "cell_type": "code", "execution_count": 102, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "we expect 12 readings to lie between 1485 to 1515 rpm\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "q = 1515; #tachometer reading in rpm\n", "q1 = 1500; #tachometer reading in rpm\n", "h = 0.04; #precision index\n", "p = 0.3015; #p(y) value from probability table corresponding to y value\n", "n =20; #number of readings\n", "\n", "#calculations\n", "x = q-q1; #deviation in r.p.m(indicates in both -ve and +ve value)\n", "sigma = 1/float((math.sqrt(2))*h); #standard deviation\n", "y = x/float(sigma); \n", "#p(y) from probability table is 0.3015\n", "p = 2*p; #probability of an error\n", "N = p*n; #number of redings\n", "\n", "#result\n", "print'we expect %3.2d'%N,'readings to lie between 1485 to 1515 rpm';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Example:1.57,Page No:99" ] }, { "cell_type": "code", "execution_count": 105, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Thus 75 percent of depth measurements lie within th range 15.09 and -14.91 cm\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "d = 15; #nominal depth of water in cm\n", "n = 40; #total number of times the measurements taken\n", "n1 = 10; #number of measurement reading found to lie outside a particular range \n", "h = 9; #precision index in cm**-1\n", "y = 1.15; #from probability table corresponding value of p(y)\n", "\n", "#calculations\n", "P = (n-n1)/float(n); #probability of falling within a particular range \n", "p1 = P/float(2); #half of these measiurements have a +ve and half have -ve errors\n", "sigma = 1/float((math.sqrt(2))*h); #standard defviation\n", "x = y*sigma; \n", "Rmax = d+x;\n", "Rmin = d-x;\n", "\n", "#result\n", "print'Thus 75 percent of depth measurements lie within th range %3.2f'%Rmax,'and -%3.2f'%Rmin,'cm';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Example:1.58,Page No:100" ] }, { "cell_type": "code", "execution_count": 107, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "precision index 0.099\n", "number of false alarms 6.00\n", "precision index 0.1155\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "py1 = 0.45; #py1 is p(y) given data\n", "y = 0.675; #from probavility table corresponding to p(y) value\n", "x = 4.8; \n", "q = 100; #fixed mass flow rate in kg/s\n", "q1 = 88; #flow meter reading in kg/s\n", "n = 30; #number of days in november month\n", "n1 = 4; #number of times flow is checked in a day\n", "x1 = 0.5; #overall probabilty \n", "y2 = 1.96; #y value corresponding to py ,from probability table\n", "\n", "#calculations\n", "sigma = x/float(y); #standard deviation \n", "a = (math.sqrt(2))*sigma;\n", "h = 1/float(a); #precision index\n", "x1 = q-q1;\n", "y1 = x1/float(sigma); #y value for masss flow rate of 88kg/s\n", "\n", "#p(y) corresponding to y1 is 0.45\n", "\n", "e = 0.5-py1; #amount it fall into false alarms \n", "N = n*n1; #number of measurements in themonth of november\n", "E = e*N; #expected false alarms\n", "E1 = x*E; #reduced number of flase alarms\n", "P = E1/float(N); #probability of false alarms\n", "py = 0.5-P; #probability of datato lie in tolerent band\n", "sigma1 = x1/float(y2); #standard deviation\n", "h1 = 1/float((math.sqrt(2))*sigma1); #precision index\n", "\n", "\n", "#result\n", "print'precision index %3.3f'%h;\n", "print'number of false alarms %3.2f'%E;\n", "print'precision index %3.4f'%h1;\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Example:1.59,Page No:103" ] }, { "cell_type": "code", "execution_count": 109, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "It is given that for 10 readings the ratio of deviation to standard deviation is not to exceed 1.96\n", "therfore x5 = 2.05 which is greater than 1.96,reading 4.33 should be rejected\n" ] } ], "source": [ "import math\n", "\n", "#varioable declaration\n", "q1 = 5.30; #length in cm\n", "q2 = 5.73; #length in cm\n", "q3 = 6.77; #length in cm\n", "q4 = 5.26; #length in cm\n", "q5 = 4.33; #length in cm\n", "q6 = 5.45; #length in cm\n", "q7 = 6.09; #length in cm\n", "q8 = 5.64; #length in cm\n", "q9 = 5.81; #length in cm\n", "q10 = 5.75; #length in cm\n", "n = 10; #number of copper wires\n", "\n", "#calculations\n", "q = (q1+q2+q3+q4+q5+q6+q7+q8+q9+q10)/float(10); #arthimetic mean in cm\n", "d1 = q1-q; #deviation in cm\n", "d2 = q2-q; #deviation in cm\n", "d3 = q3-q; #deviation in cm\n", "d4 = q4-q; #deviation in cm\n", "d5 = q5-q; #deviation in cm\n", "d6 = q6-q; #deviation in cm\n", "d7 = q7-q; #deviation in cm\n", "d8 = q8-q; #deviation in cm\n", "d9 = q9-q; #deviation in cm\n", "d10 = q10-q; #deviation in cm\n", "s = math.sqrt(((d1**2)+(d2**2)+(d3**2)+(d4**2)+(d5**2)+(d6**2)+(d7**2)+(d8**2)+(d9**2)+(d10**2))/float(n-1)); #standard deviation in cm \n", "x1 = abs(d1)/float(s); #ratio of deviation to standard deviation\n", "x2 = abs(d2)/float(s); #ratio of deviation to standard deviation\n", "x3 = abs(d3)/float(s); #ratio of deviation to standard deviation\n", "x4 = abs(d4)/float(s); #ratio of deviation to standard deviation\n", "x5 = abs(d5)/float(s); #ratio of deviation to standard deviation\n", "x6 = abs(d6)/float(s); #ratio of deviation to standard deviation\n", "x7 = abs(d7)/float(s); #ratio of deviation to standard deviation\n", "x8 = abs(d8)/float(s); #ratio of deviation to standard deviation\n", "x9 = abs(d9)/float(s); #ratio of deviation to standard deviation\n", "x10 = abs(d10)/float(s); #ratio of deviation to standard deviation\n", "\n", "#result\n", "print'It is given that for 10 readings the ratio of deviation to standard deviation is not to exceed 1.96';\n", "print'therfore x5 = %3.2f'%x5,'which is greater than 1.96,reading %3.2f should be rejected'%q5;\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.60,Page No:105" ] }, { "cell_type": "code", "execution_count": 111, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "linear equation 0.672 u +0.591\n", "standard deviation = 0.34\n", "standard deviation = 0.51\n", "standard deviation = 0.04\n", "standard deviation = 0.31\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "u1 = 1.8; #initial velocity\n", "u2 = 4.6; #initial velocity\n", "u3 = 6.6; #initial velocity\n", "u4 = 9.0; #initial velocity\n", "u5 = 11.4; #initial velocity\n", "u6 = 13.4; #initial velocity\n", "n = 6;\n", "v1 = 2.2; #final velocity\n", "v2 = 3.2; #final velocity\n", "v3 = 5.2; #final velocity\n", "v4 = 6.4; #final velocity\n", "v5 = 8.0; #final velocity\n", "v6 = 10.0; #final velocity\n", "\n", "#calulations\n", "w1 = u1*v1;\n", "w2 = u2*v2;\n", "w3 = u3*v3;\n", "w4 = u4*v4;\n", "w5 = u5*v5;\n", "w6 = u6*v6;\n", "x1 = u1**2;\n", "x2 = u2**2;\n", "x3 = u3**2;\n", "x4 = u4**2;\n", "x5 = u5**2;\n", "x6 = u6**2;\n", "u = u1+u2+u3+u4+u5+u6;\n", "v = v1+v2+v3+v4+v5+v6;\n", "w = w1+w2+w3+w4+w5+w6;\n", "x = x1+x2+x3+x4+x5+x6;\n", "a = ((n*w)-(u*v))/float((n*x)-(u**2));\n", "b = ((v*x)-(w*u))/float((n*x)-(u**2));\n", "y1 = (((a*u1)+b-v1)**2);\n", "y2 = (((a*u2)+b-v2)**2);\n", "y3 = (((a*u3)+b-v3)**2);\n", "y4 = (((a*u4)+b-v4)**2);\n", "y5 = (((a*u5)+b-v5)**2);\n", "y6 = (((a*u6)+b-v6)**2);\n", "y = y1+y2+y3+y4+y5+y6;\n", "Sv = math.sqrt(y/float(n)); #standard deviation indicate sboth -ve and +ve values\n", "Su = Sv/float(a); #standard deviation indicate sboth -ve and +ve values\n", "Sa = (math.sqrt((n)/float(abs((n*x)-(u**2)))))*Sv; #standard deviation indicate sboth -ve and +ve values\n", "Sb = (math.sqrt((x)/float(abs((n*x)-(u**2)))))*Sv; #standard deviation indicate sboth -ve and +ve values\n", "\n", "\n", "#result\n", "print'linear equation %3.3f'%a,'u +%3.3f'%b;\n", "print'standard deviation = %3.2f'%Sv;\n", "print'standard deviation = %3.2f'%Su;\n", "print'standard deviation = %3.2f'%Sa;\n", "print'standard deviation = %3.2f'%Sb;\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Example:1.61,Page No:106" ] }, { "cell_type": "code", "execution_count": 113, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Best fit equation 4.569e-05 f**2 +1.519e-02 f mW\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "u1 = 550; #initial velocity\n", "u2 = 700; #initial velocity\n", "u3 = 850; #initial velocity\n", "u4 = 1000; #initial velocity\n", "n = 4;\n", "v1 = 0.04182; #final velocity\n", "v2 = 0.04429; #final velocity\n", "v3 = 0.05529; #final velocity\n", "v4 = 0.0610; #final velocity\n", "\n", "#calulations\n", "#P = ((a)*(f**2))+(b*f)\n", "#P/f = (a*f)+b\n", "w1 = u1*v1;\n", "w2 = u2*v2;\n", "w3 = u3*v3;\n", "w4 = u4*v4;\n", "x1 = u1**2;\n", "x2 = u2**2;\n", "x3 = u3**2;\n", "x4 = u4**2;\n", "u = u1+u2+u3+u4;\n", "v = v1+v2+v3+v4;\n", "w = w1+w2+w3+w4;\n", "x = x1+x2+x3+x4;\n", "a = ((n*w)-(u*v))/float((n*x)-(u**2));\n", "b = ((v*x)-(w*u))/float((n*x)-(u**2));\n", "\n", "\n", "#result\n", "print'Best fit equation %3.3e'%a,'f**2 +%3.3e f'%b,'mW';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.62,Page No:108" ] }, { "cell_type": "code", "execution_count": 114, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "limiting error 1.33 %\n", "standard deviations 0.943 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "q1 = 50; #measuremnent in series in units\n", "q2 = 100; #measuremnent in series in units\n", "x = 0.02; #error in measurement of q1\n", "y = 0.01; #error in measurement of q2\n", "a = 1; #x % of 50\n", "b = 1; #y % of 100\n", "\n", "\n", "#calculations\n", "e1 = (q1*x)/float(q1+q2); #individual limiting errors\n", "e2 = (q2*y)/float(q1+q2); #individual limiting errors\n", "e = (e1+e2)*100; #combined limiting errors in % (indicates both -ve and +ve values)\n", "er = (math.sqrt((a**2)+(b**2))); #resultant error \n", "er1 = (er/float(q1+q2))*100; #standard deviation in %\n", "\n", "#result\n", "print'limiting error %3.2f'%e,'%';\n", "print'standard deviations %3.3f'%er1,'%';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.63,Page No:116" ] }, { "cell_type": "code", "execution_count": 117, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "series resistance 97.5 Ω\n", "shunt resistance 0.02525 Ω\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "Rm =2.5; #resistance in Ω\n", "Im = 0.1; #current in A\n", "V = 10; #voltage in V\n", "I = 10; #ammeter reading in A\n", "\n", "#calculations\n", "Rs = (V/float(Im))-Rm; #series resistance in Ω\n", "Rsh = (Im*Rm)/float(I-Im); #shunt resistance in Ω\n", "\n", "#result\n", "print'series resistance %3.1f'%Rs,'Ω';\n", "print'shunt resistance %3.5f'%Rsh,'Ω';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.64,Page No:116" ] }, { "cell_type": "code", "execution_count": 118, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "shunt resistance 0.05025 Ω\n", "series resistance 990 Ω\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "Rm = 10; #resistance in Ω\n", "Im = 0.005; #current in A\n", "I = 1; #current in A\n", "V = 5; #voltage in V\n", "\n", "#calculations\n", "Rsh = (Im*Rm)/float(I-Im); #shunt resistance in Ω\n", "Rs = (V-(Im*Rm))/float(Im); #series resistance in Ω\n", "\n", "#result\n", "print'shunt resistance %3.5f'%Rsh,'Ω';\n", "print'series resistance %3.0f'%Rs,'Ω';\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.65,Page No:117" ] }, { "cell_type": "code", "execution_count": 119, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "deflecting torque 8.1e-05 N-m\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "N = 100; #number of turns \n", "l = 0.03; #length of each side in m\n", "B = 0.09; #flux density in Wb/m**2\n", "I = 0.01; #current through the coil in A\n", "\n", "\n", "#calculation\n", "F = N*B*I*l; #force in N\n", "T = F*l; #deflecting torque in N-m\n", "\n", "#result\n", "print'deflecting torque %3.1e'%T,'N-m';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.66,Page No:118" ] }, { "cell_type": "code", "execution_count": 120, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "percentage error when internal resiatance is 5Ω is 7.13\n", "percentage error after rise of temperature 1.5\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "Rm = 5; #resistance in Ω\n", "Im = 0.015; #current through instrument in A\n", "I = 100; #current to be measured in A\n", "alpham = 0.00015; #manganin in °C\n", "alphac = 0.004; #copper in °C\n", "R1 = 1; #reistance of copper in Ω\n", "R2 = 4; #reistance of manganin in Ω\n", "T = 20; #temperature in °C\n", " \n", "#calculations\n", "Ish = I-Im; #current through shunt in A\n", "v = Im*Rm; #voltage across the shunt in V\n", "Rsh = v/float(Ish); #shunt resistance in Ω \n", "Rshunt = Rsh*(1+(T*alpham)); #shunt resistance after rise of temperature in Ω \n", "Rinst = Rm*(1+(T*alphac)); #instrument resistance in Ω \n", "i = (Rshunt/float(Rinst+Rshunt))*100; #current through instrument in A\n", "R = (i/float(Im))*100; #reading of instrument in A\n", "e = I-R; #percentage error \n", "Rinst1 = R1*(1+(T*alphac))+R2*(1+(T*alpham)); #instrument resistance in Ω \n", "Iinst = (Rshunt/float(Rinst1+Rshunt))*100; #instrument current in A\n", "Iread = (Iinst*100)/float(Im); #instrument reading in A\n", "e1 = I-Iread; #percentage error \n", "#result\n", "print'percentage error when internal resiatance is 5Ω is %3.2f'%e;\n", "print'percentage error after rise of temperature %3.1f'%e1;" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.67,Page No:118" ] }, { "cell_type": "code", "execution_count": 121, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "percentage error 0.8 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "V = 250; #voltage in V\n", "R = 500; #resistance in Ω\n", "L = 1; #inductance in H\n", "I = 0.05; #current in A\n", "f = 100; #frequency in Hz\n", "\n", "#calculations\n", "R1 = V/float(I); #total ohmic resistance in Ω\n", "Z = math.sqrt((R1**2)+((2*math.pi*f*L)**2)); #coil impedance in Ω\n", "Vr = (V*R1)/float(Z); #voltage reading in A.c\n", "e = ((V-Vr)/float(V))*100; #percentage error in %\n", "\n", "#result\n", "print'percentage error %3.1f'%e,'%';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.68,Page No:119" ] }, { "cell_type": "code", "execution_count": 122, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "voltmeter reading at 25Hz frequency 14.97 V\n", "voltmeter reading at 100Hz frequency 14.55 V\n", "As frequency is increased ,impedance of the voltmeter increases ,hence current is decreased\n", "therefore voltmeter readings are lower\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "R = 300; #resistance in Ω\n", "L = 0.12; #inductance in H\n", "f = 25; #frequency in Hz\n", "I = 15; #current in A\n", "f1 = 100; #frequency in Hz\n", "\n", "\n", "#calculations\n", "Z = math.sqrt((R**2)+((2*math.pi*f*L)**2)); #impedance at 25Hz in Ω\n", "V = I*(R/float(Z)); #voltmeter reading at 25 Hz in V\n", "Z1 = math.sqrt((R**2)+((2*math.pi*f1*L)**2)); #impedance at 100Hz in Ω \n", "V1 = I*(R/float(Z1)); #voltmeter reading at 100Hz in V\n", "\n", "#result\n", "print'voltmeter reading at 25Hz frequency %3.2f'%V,'V';\n", "print'voltmeter reading at 100Hz frequency %3.2f'%V1,'V';\n", "print'As frequency is increased ,impedance of the voltmeter increases ,hence current is decreased';\n", "print'therefore voltmeter readings are lower';\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Example:1.69,Page No:132" ] }, { "cell_type": "code", "execution_count": 123, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "power factor of the motor 0.75 (lag)\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "W1 =920; #wattmeter reading in W\n", "W2 =300; #wattmeter reading in W\n", "\n", "#calculations\n", "phi = math.atan(((math.sqrt(3))*(W1-W2))/(float(W1+W2)))*(180/float(math.pi)); \n", "pf = math.cos((phi)*(math.pi/float(180))); #power factor \n", "\n", "#result\n", "print'power factor of the motor %3.2f'%pf,'(lag)';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Example:1.70,Page No:132" ] }, { "cell_type": "code", "execution_count": 124, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "power factor of the motor 0.22 (lag)\n", "line current 47.34 A\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "W1 =14.2; #wattmeter reading in W\n", "W2 =-6.1; #wattmeter reading in W \n", "El = 440; #line voltage in V\n", "P = 8.1*1000; #power in W\n", "\n", "#calculations\n", "phi = math.atan(((math.sqrt(3))*(W1-W2))/(float(W1+W2)))*(180/float(math.pi)); #phase lag\n", "pf = math.cos((phi)*(math.pi/float(180))); #power factor \n", "Il = P/float((math.sqrt(3))*(El)*(pf)); #line current in A\n", "\n", "#result\n", "print'power factor of the motor %3.2f'%pf,'(lag)';\n", "print'line current %3.2f'%Il,'A';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.71,Page No:132" ] }, { "cell_type": "code", "execution_count": 125, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "W1 = 22.12 kW\n", "W2 = 2.88 kW\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "P = 25; #input power in kW\n", "El = 440; #line voltage in \n", "pf = 0.6; #power factor\n", "\n", "#calculations\n", "phi = ((math.acos(pf))*180)/float(math.pi);\n", "t = (math.tan((phi)*(math.pi/float(180))));\n", "#we have tan = math.sqrt(3)*(W1-W2)/W1+W2\n", "#W1+W2 =E\n", "y = (P*t)/float(math.sqrt(3));\n", "W1 = (P+y)/float(2);\n", "W2 = (P-y)/float(2);\n", "\n", "#result\n", "print'W1 = %3.2f'%W1,'kW';\n", "print'W2 = %3.2f'%W2,'kW';\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.72,Page No:134" ] }, { "cell_type": "code", "execution_count": 126, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "percentage error 0.33 %(fast)\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "V = 230; #voltage in V\n", "i = 5; #current in A \n", "t = 360; #time in s\n", "n = 60; #number of revolutions\n", "n1 = 520; #number of revolutions\n", "cosphi = 1; #power factor \n", "\n", "#calculations\n", "\n", "E = (V*i*cosphi*t)/float(1000*3600); #energy consumed in 360 seconds in kWh\n", "Er = n/float(n1); #energy recorded by the meter in kWh\n", "e = ((Er-E)/float(Er))*100; #percentage error in %\n", "\n", "#result\n", "\n", "print'percentage error %3.2f'%(e),'%(fast)';\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.73,Page No:135" ] }, { "cell_type": "code", "execution_count": 144, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "percentage error 1.0562 %\n", "Note:Ans printing mistake in textbook\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "V = 230; #voltage in V\n", "i = 4.5; #current in A\n", "cosphi = 1;\n", "t = 190; #time in s\n", "n = 10; #number of revolutions\n", "n1 = 185; #number of revolutions\n", "\n", "#calculations\n", "E = (V*i*cosphi*t)/float(1000*3600); #energy consumed in 360 seconds in kWh\n", "Er = n/float(n1); #energy recorded by the meter in kWh\n", "e = ((E-Er)/float(Er))*100; #percentage error in %\n", "\n", "#result\n", "print'percentage error %3.4f'%(e),'%';\n", "print'Note:Ans printing mistake in textbook'\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.74,Page No:135" ] }, { "cell_type": "code", "execution_count": 145, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "power in the circuit 800 W\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "x = 150; #number of revolutions\n", "t = 45; #time in s\n", "\n", "\n", "#calculations\n", "p = 1*(x/float(15000)); #power metered in kWh\n", "a =t/float(3600); #energy consumed in t seconds in times of P\n", "P = p/float(a); #power in the circuit in W\n", "\n", "#result\n", "print'power in the circuit %3.0f'%(P*1000),'W';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example:1.75,Page No:135" ] }, { "cell_type": "code", "execution_count": 146, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "energy recorded 0.575 kWh\n", "actual energy consumed 0.5367 kWh\n", "percentage error 6.67 %\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "V = 230; #D.C supply in V\n", "r = 225; #number of revolutions\n", "i = 40*225; #meter reading in A-s\n", "t =10; #time in minutes\n", "l = 14; #current in A\n", "\n", "\n", "#calculations\n", "L = i/float(10*60); #current in A\n", "E = (V*L*t)/float(1000*60); #energy recorded in kWh\n", "Ea = (V*l*t)/float(1000*60); #actual energy consumed kWh\n", "e = ((E-Ea)/float(E))*100; #percentage error in %\n", "\n", "#result\n", "print'energy recorded %3.3f'%E,'kWh';\n", "print'actual energy consumed %3.4f'%Ea,'kWh';\n", "print'percentage error %3.2f'%e,'%'\n" ] } ], "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.6" } }, "nbformat": 4, "nbformat_minor": 0 }