diff options
Diffstat (limited to 'Electronic_Instrumentation_And_Measurements_by_J.B.Gupta/Chapter_02.ipynb')
-rw-r--r-- | Electronic_Instrumentation_And_Measurements_by_J.B.Gupta/Chapter_02.ipynb | 1047 |
1 files changed, 1047 insertions, 0 deletions
diff --git a/Electronic_Instrumentation_And_Measurements_by_J.B.Gupta/Chapter_02.ipynb b/Electronic_Instrumentation_And_Measurements_by_J.B.Gupta/Chapter_02.ipynb new file mode 100644 index 00000000..8b8c6f98 --- /dev/null +++ b/Electronic_Instrumentation_And_Measurements_by_J.B.Gupta/Chapter_02.ipynb @@ -0,0 +1,1047 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:be43ce8cfcf757315834ebcb5892c350b5dbd49ea038d4267cd2840c005e466a" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter - 02 : Measurement Errors" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.1 - Page No : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "Am= 10.25 # in ohm\n", + "A= 10.22 # in ohm\n", + "del_A= Am-A # in ohm\n", + "print \"Absolute error = %0.2f ohm\" %del_A" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Absolute error = 0.03 ohm\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.2 - Page No : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "Am= 6.7 # in A\n", + "A= 6.54 # in A\n", + "del_A= Am-A # in A\n", + "print \"Absolute error = %0.2f A\" %del_A\n", + "print \"Correction = %0.2f A\" %(-del_A)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Absolute error = 0.16 A\n", + "Correction = -0.16 A\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.3 - Page No : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "Am= 25.34 # in watt\n", + "del_A= -0.11 # in watt\n", + "A= Am-del_A \n", + "print \"True value = %0.2f watt\" %A" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "True value = 25.45 watt\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.4 - Page No : 24\n", + " " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Given data\n", + "Am= 205.3*10**-6 # in F\n", + "A= 201.4*10**-6 # in F\n", + "epsilon_o= Am-A \n", + "epsilon_r= epsilon_o/A*100 # in %\n", + "print \"Percentage relative error = %0.2f %%\" %epsilon_r" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percentage relative error = 1.94 %\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.5 - Page No : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division \n", + "#Given data\n", + "PerError= 5 # in %\n", + "epsilon_r= PerError/100 \n", + "Am=20 # in H\n", + "del_A= Am*epsilon_r \n", + "# A= Am+del_A and A= Am-del_A\n", + "print \"Limiting value of inductance =\",int(Am),\"\u00b1\",int(del_A),\"in Henry\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Limiting value of inductance = 20 \u00b1 1 in Henry\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.6 - Page No : 24" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "V=600 # in volt\n", + "A= 400 #in volt\n", + "epsilon_r= 2.5/100 \n", + "del_V= epsilon_r*V \n", + "PerLimitError= del_V/A*100 # in %\n", + "print \"The percentage limiting error at 400 volt = \u00b1 %0.2f %%\" %PerLimitError " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The percentage limiting error at 400 volt = \u00b1 3.75 %\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.7 - Page No : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "Am= 500 # in watt\n", + "epsilon_r= 1.5/100 # in neg and pos\n", + "# for positive value of epsilon_r\n", + "A1= Am*(1+epsilon_r) # in watt\n", + "# for positive value of epsilon_r\n", + "A2= Am*(1-epsilon_r) # in watt\n", + "print \"Range of reading of wattmeter is \",round(A2,1),\" watt to \",round(A1,1),\" watt\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Range of reading of wattmeter is 492.5 watt to 507.5 watt\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.8 - Page No : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "epsilon_r= 1.5/100 # in neg and pos\n", + "A= 10 # in amp\n", + "del_A= epsilon_r*A #in amp\n", + "# The magnitude of current being measured is 2.5 A. The relative error at this current is \n", + "A= 2.5 # in amp\n", + "epsilon_r= del_A/A \n", + "# Hence, the current under measurement is between the limits of\n", + "Am= 2.5 #in amp\n", + "# for positive value of epsilon_r\n", + "A1= Am*(1+epsilon_r) # in amp\n", + "# for positive value of epsilon_r\n", + "A2= Am*(1-epsilon_r) # in amp\n", + "print \"Limiting values of current under measurement are \",round(A2,2),\" amp to \",round(A1,2),\" amp\"\n", + "LimitingError= del_A/A*100 # in %\n", + "print \"Limiting Error = %0.f %%\" %LimitingError" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Limiting values of current under measurement are 2.35 amp to 2.65 amp\n", + "Limiting Error = 6 %\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.9 - Page No : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "epsilon_r= 1/100 \n", + "P=1000 # in watt\n", + "del_P= epsilon_r*P # in watt\n", + "# The magnitude of the power being measured is 100 watts.\n", + "PerLimitError= del_P/100*100 # in %\n", + "print \"The percentage limiting error at 1000 =\",int(PerLimitError),\"%\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The percentage limiting error at 1000 = 10 %\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.10 - Page No : 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "# For positive value of error\n", + "R1= 100+100*2/100 #in ohm\n", + "R2= 200+200*2.5/100 # in ohm\n", + "AddR1R2_pos= R1+R2 # in ohm\n", + "# For negative value of error\n", + "R1= 100-100*2/100 #in ohm\n", + "R2= 200-200*2.5/100 # in ohm\n", + "AddR1R2_neg= R1+R2 # in ohm\n", + "print \"Values of R1+R2 =\",int(AddR1R2_neg),\"ohm to\",int(AddR1R2_pos),\"ohm\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Values of R1+R2 = 293 ohm to 307 ohm\n" + ] + } + ], + "prompt_number": 25 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.12 - Page No : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "AV= 110.2 # true value of voltage in volt\n", + "AI= 5.3 # true value of current in amp\n", + "v= 0.2 # uncertainties in voltage in volt\n", + "i= 0.6 # uncertainties in current in amp\n", + "PLV= v/AV*100 # percentage limiting error to voltage drop\n", + "PLC= i/AI*100 # percentage limiting error to current\n", + "P= AV*AI # in watt\n", + "print \"The power dissipated in the resistor = %0.2f watt\" %P\n", + "LE_P= (PLV+PLC) # limiting error in the power dissipation in pos and neg\n", + "print \"The limiting error in the power dissipation = \u00b1 %0.2f\" %LE_P\n", + "print \"Power dissipation =\",round(P-P*LE_P/100,2),\"W to \",round(P+P*LE_P/100,2),\"W\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The power dissipated in the resistor = 584.06 watt\n", + "The limiting error in the power dissipation = \u00b1 11.50\n", + "Power dissipation = 516.88 W to 651.24 W\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.13 - Page No : 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "AR= 100 # true value of resistance in ohm\n", + "AI= 2 # true value of current in amp\n", + "R= 0.2 # uncertainties in resistance in ohm\n", + "I= 0.01 # uncertainties in current in amp\n", + "PLR= R/AR*100 # percentage limiting error to resistance\n", + "PLC= I/AI*100 # percentage limiting error to current\n", + "P=AI**2*AR # in watt\n", + "LE_P= 2*PLC+PLR # limiting error in the power dissipation \n", + "print \"Power dissipation =\",round(P-P*LE_P/100,1),\"W to\",round(P+P*LE_P/100,1),\"W\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Power dissipation = 395.2 W to 404.8 W\n" + ] + } + ], + "prompt_number": 33 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.14 - Page No : 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "FullScaleReading= 200 # in V\n", + "N= 100 # Number of division of scale\n", + "SD= FullScaleReading/N # 1 scale division\n", + "Resolution = 1/5*SD # in v\n", + "print \"The value of resolution = %0.1f volts\" %Resolution" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of resolution = 0.4 volts\n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.15 - Page No : 34" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "# u= 150+2.4 miu F and 150-2.4 miu F\n", + "# v= 120+1.5 miu F and 120-1.5 miu F\n", + "y=150+120 \n", + "del_y = 2.4+1.5 # Pos and neg\n", + "print \"Limiting error with pos and neg = \u00b1 %0.1f miu F\" %del_y\n", + "RelLimError= del_y/y*100 # in %\n", + "print \"Relative limiting error with pos and neg = %0.2f %%\" %RelLimError " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Limiting error with pos and neg = \u00b1 3.9 miu F\n", + "Relative limiting error with pos and neg = 1.44 %\n" + ] + } + ], + "prompt_number": 38 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.16 - Page No : 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "R1= 1 #in kohm\n", + "R1=R1*10**3 #in ohm\n", + "del_R1ByR1= 1 \n", + "del_R2ByR2= 1 \n", + "R2= 500 #in kohm\n", + "R= R1*R2/(R1+R2) #in ohm\n", + "# Let R= X/Y\n", + "X= R1*R2 \n", + "Y=R1+R2 \n", + "ErrorX= del_R1ByR1+del_R2ByR2 # with pos and neg\n", + "# ErrorY= del_R1/Y + del_R2/Y = R1/Y*del_R1ByR1 + R2/Y*del_R2ByR2\n", + "ErrorY= R1/Y*del_R1ByR1 + R2/Y*del_R2ByR2 # with pos and neg\n", + "PerError= ErrorX+ErrorY # in % with pos and neg\n", + "print \"Percentage error (maximum posible) in equivalent parallel resistance = \u00b1 %0.f %%\" %PerError\n", + "Error= 333.33*PerError/100 \n", + "Error=round(Error) \n", + "print \"Error (maximum possible) in equivalent parallel resistance = %0.f ohm\" %Error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Percentage error (maximum posible) in equivalent parallel resistance = \u00b1 3 %\n", + "Error (maximum possible) in equivalent parallel resistance = 10 ohm\n" + ] + } + ], + "prompt_number": 41 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.17 - Page No : 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "R1= 200 #in ohm\n", + "R2= 100 #in ohm\n", + "R3= 50 #in ohm\n", + "del_R1ByR1= 5 \n", + "del_R2ByR2= 5 \n", + "del_R3ByR3= 5 \n", + "# Part (i) when the resistance are connected in series\n", + "Rse= R1+R2+R3 # in ohm\n", + "print \"Equivalent resistance when connected in seried = %0.f ohm\" %Rse \n", + "LimError= R1/Rse*del_R1ByR1 + R2/Rse*del_R2ByR2 + R3/Rse*del_R3ByR3 \n", + "print \"Relative limiting error of series resistances = \u00b1 %0.f %%\" %LimError\n", + "LimError= Rse*LimError/100 #relative limiting error of series equivalent resistance in ohm\n", + "print \"Relative limiting error of series equivalent resistance = \u00b1 %0.1f ohm\" %LimError\n", + "\n", + "# Part(ii) when the resistance are connected in parallel\n", + "Rp= R1*R2*R3/(R1*R2+R2*R3+R3*R1) \n", + "print \"Equivalent resistance when connected in parallel = %0.2f ohm\" %Rp\n", + "# Let Rp= X/Y\n", + "X= R1*R2*R3 \n", + "Y=R1*R2+R2*R3+R3*R1 \n", + "y1= R1*R2 \n", + "y2= R2*R3 \n", + "y3= R3*R1 \n", + "ErrorX= del_R1ByR1 + del_R2ByR2 + del_R3ByR3 \n", + "Errory1= del_R1ByR1 + del_R2ByR2 \n", + "Errory2= del_R2ByR2 + del_R3ByR3 \n", + "Errory3= del_R3ByR3 + del_R1ByR1 \n", + "ErrorY= ( y1/Y*Errory1 + y2/Y*Errory2 + y3/Y*Errory3)\n", + "LimError= ErrorX + ErrorY \n", + "print \"Percentage error (maximum possible) in equivalent parallel resistance = \u00b1 %0.f %%\" %LimError\n", + "LimError= Rp*LimError/100 \n", + "print \"Error (maximum possible) in equivalent parallel resistance = %0.4f ohm\" %LimError" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equivalent resistance when connected in seried = 350 ohm\n", + "Relative limiting error of series resistances = \u00b1 5 %\n", + "Relative limiting error of series equivalent resistance = \u00b1 17.5 ohm\n", + "Equivalent resistance when connected in parallel = 28.57 ohm\n", + "Percentage error (maximum possible) in equivalent parallel resistance = \u00b1 25 %\n", + "Error (maximum possible) in equivalent parallel resistance = 7.1429 ohm\n" + ] + } + ], + "prompt_number": 45 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.18 - Page No : 36" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "epsilon_r= 1.5/100 \n", + "V=100 # in volt\n", + "I=150 # in mA\n", + "del_V= epsilon_r*V # in volt\n", + "Vm= 70 # magnitude of voltage being measured in volt\n", + "PerLimError_V= del_V/Vm*100 # in %\n", + "del_I= epsilon_r*I # in mA\n", + "Im= 80 #in mA\n", + "PerLimError_C= del_I/Im*100 # in %\n", + "P= Vm*Im/1000 # in watt\n", + "RelLImError_P= (PerLimError_V+PerLimError_C) # in %\n", + "print \"Relative limiting error in power measurement = %0.3f %%\" %RelLImError_P " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Relative limiting error in power measurement = 4.955 %\n" + ] + } + ], + "prompt_number": 46 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.19 - Page No : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "E= 200 # in V\n", + "del_E_by_E= 1 \n", + "R=1000 # in ohm\n", + "del_R_by_R= 5 \n", + "P=E**2/R # in watt\n", + "print \"Normal power consumed = %0.f watt\" %P\n", + "LimError= 2*del_E_by_E+del_R_by_R # in %\n", + "print \"Relative limiting error in measurement of power = \u00b1 %0.f %%\" %LimError\n", + "LimError= LimError*P/100 #in watt\n", + "print \"Limiting error of power = \u00b1 %0.1f watt\" %LimError" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Normal power consumed = 40 watt\n", + "Relative limiting error in measurement of power = \u00b1 7 %\n", + "Limiting error of power = \u00b1 2.8 watt\n" + ] + } + ], + "prompt_number": 47 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.20 - Page No : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "R1= 500 # in ohm\n", + "R2= 615 # in ohm\n", + "R3= 100 # in ohm\n", + "delR1ByR1= 1 \n", + "delR2ByR2= 1 \n", + "delR3ByR3= 0.5 \n", + "# Part(i)\n", + "R4=R1*R2/R3 # in ohm\n", + "print \"Unknown resistance = %0.f ohm\" %R4\n", + "delR4ByR4= delR1ByR1+delR2ByR2+delR3ByR3 \n", + "print \"Relative limiting error of unknown resistance = \u00b1 %0.1f %%\" %delR4ByR4\n", + "LimError= R4*delR4ByR4/100 \n", + "print \"Limiting error = %0.3f ohms\" %LimError " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Unknown resistance = 3075 ohm\n", + "Relative limiting error of unknown resistance = \u00b1 2.5 %\n", + "Limiting error = 76.875 ohms\n" + ] + } + ], + "prompt_number": 48 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.21 - Page No : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "del_PbyP=0.5 \n", + "del_CbyC=1 \n", + "del_VbyV=1 \n", + "del_PFbyPF=del_PbyP + del_CbyC + del_VbyV \n", + "print \"Relative limiting error = \u00b1 %0.1f %%\" %del_PFbyPF" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Relative limiting error = \u00b1 2.5 %\n" + ] + } + ], + "prompt_number": 49 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.22 - Page No : 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "C=1 # in miu F\n", + "C=C*10**-6 # in F\n", + "P=1000 # in ohm\n", + "Q=2000 # in ohm\n", + "r=200 # in ohm\n", + "S=2000 # in ohm\n", + "del_C_by_C= 1 \n", + "del_P_by_P= 0.4 \n", + "del_Q_by_Q= 1 \n", + "del_r_by_r= 0.5 \n", + "del_S_by_S= 0.5 \n", + "Lx= C*P/S*(r*(Q+S)+Q*S) # in Henry\n", + "print \"Unknown inductance = %0.1f Henry\" %Lx\n", + "# Let\n", + "u=Q+S # in ohm\n", + "Error_u= Q/u*del_Q_by_Q + S/u*del_S_by_S # in %\n", + "# Let v= r*(Q+S) = r*u\n", + "v= r*(Q+S) \n", + "Error_v= del_r_by_r + Error_u # in %\n", + "# Let \n", + "x=Q*S \n", + "Error_x= del_Q_by_Q + del_S_by_S # in %\n", + "# Let y= r*(Q+S)+Q*S = v+x\n", + "y=v+x \n", + "Error_y= v/y*Error_v + x/y*Error_x # in %\n", + "del_Lx_by_Lx= del_C_by_C + del_P_by_P + del_S_by_S + Error_y # in %\n", + "print \"Percentage error in inductance = %0.3f %%\" %del_Lx_by_Lx" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Unknown inductance = 2.4 Henry\n", + "Percentage error in inductance = 3.358 %\n" + ] + } + ], + "prompt_number": 51 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.23 - Page No : 38" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import pi \n", + "#Given data\n", + "R=100 # in ohm\n", + "del_R_by_R= 5 \n", + "L=2 # in Henry\n", + "del_L_by_L= 10 \n", + "omega= 2*pi*50 \n", + "# Let\n", + "u=R**2 \n", + "Error_u= 2*del_R_by_R \n", + "# Let\n", + "v= omega**2*L**2 \n", + "Error_v= 2*del_L_by_L \n", + "# Let \n", + "x= u+v \n", + "Error_x= u/x*Error_u + v/x*Error_v # in %\n", + "# Now\n", + "Z= x**(1/2) \n", + "Error_Z= 1/2*Error_x \n", + "print \"The uncertainly in the measurement of Z = %0.3f %%\" %Error_Z" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The uncertainly in the measurement of Z = 9.876 %\n" + ] + } + ], + "prompt_number": 53 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.24 - Page No : 40" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sqrt\n", + "#Given data\n", + "x1= 49.7 \n", + "x2= 50.1 \n", + "x3= 50.2 \n", + "x4= 49.6 \n", + "x5= 49.7 \n", + "n=5 \n", + "x_bar= (x1+x2+x3+x4+x5)/5 \n", + "d1= x1-x_bar \n", + "d2= x2-x_bar \n", + "d3= x3-x_bar \n", + "d4= x4-x_bar \n", + "d5= x5-x_bar \n", + "s= sqrt((d1**2+d2**2+d3**2+d4**2+d5**2)/(n-1)) \n", + "print \"The value of standard deviation = %0.2f\" %s" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The value of standard deviation = 0.27\n" + ] + } + ], + "prompt_number": 55 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.25 - Page No : 44" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "x1= 41.7 \n", + "x2= 42 \n", + "x3= 41.8 \n", + "x4= 42 \n", + "x5= 42.1 \n", + "x6= 41.9 \n", + "x7= 42.5 \n", + "x8= 42 \n", + "x9= 41.9 \n", + "x10=41.8 \n", + "n=10 \n", + "# (i)\n", + "x_bar= (x1+x2+x3+x4+x5+x6+x7+x8+x9+x10)/10 \n", + "print \"Arithmetic mean = %0.2f\" %x_bar\n", + "d1= x1-x_bar \n", + "d2= x2-x_bar \n", + "d3= x3-x_bar \n", + "d4= x4-x_bar \n", + "d5= x5-x_bar \n", + "d6= x6-x_bar \n", + "d7= x7-x_bar \n", + "d8= x8-x_bar \n", + "d9= x9-x_bar \n", + "d10= x10-x_bar \n", + "# (ii)\n", + "sigma= sqrt((d1**2+d2**2+d3**2+d4**2+d5**2+d6**2+d7**2+d8**2+d9**2+d10**2)/(n-1)) \n", + "print \"The value of standard deviation = %0.3f\" %sigma \n", + "\n", + "# (iii)\n", + "r= 0.6745*sigma \n", + "print \"Probable error of one reading = %0.3f\" %r" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Arithmetic mean = 41.97\n", + "The value of standard deviation = 0.221\n", + "Probable error of one reading = 0.149\n" + ] + } + ], + "prompt_number": 56 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example : 2.26 - Page No : 45" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + " #Given data\n", + "x1= 1.570 \n", + "x2= 1.597 \n", + "x3= 1.591 \n", + "x4= 1.562 \n", + "x5= 1.577 \n", + "x6= 1.580 \n", + "x7= 1.564 \n", + "x8= 1.586 \n", + "x9= 1.550 \n", + "x10=1.575 \n", + "n=10 \n", + "# (i)\n", + "x_bar= (x1+x2+x3+x4+x5+x6+x7+x8+x9+x10)/10 \n", + "print \"Arithmetic mean = %0.4f gramme\" %x_bar\n", + "d1= x1-x_bar \n", + "d2= x2-x_bar \n", + "d3= x3-x_bar \n", + "d4= x4-x_bar \n", + "d5= x5-x_bar \n", + "d6= x6-x_bar \n", + "d7= x7-x_bar \n", + "d8= x8-x_bar \n", + "d9= x9-x_bar \n", + "d10= x10-x_bar \n", + "\n", + "# (ii)\n", + "D= (abs(d1)+abs(d2)+abs(d3)+abs(d4)+abs(d5)+abs(d6)+abs(d7)+abs(d8)+abs(d9)+abs(d10))/n # in gramme\n", + "print \"Average deviation = %0.3f gramme\" %D\n", + "\n", + "# (iii)\n", + "sigma= sqrt((d1**2+d2**2+d3**2+d4**2+d5**2+d6**2+d7**2+d8**2+d9**2+d10**2)/(n-1)) # in gramme\n", + "print \"Standard deviation = %0.5f gramme\" %sigma \n", + "\n", + "# (iv)\n", + "V= sigma**2 # variance in gramme**2\n", + "print \"Variance = %0.3e gramme**2\" %V \n", + "\n", + "# (v)\n", + "r= 0.6745*sigma # in gramme\n", + "print \"Probable error = %0.4f gramme\" %r\n", + "\n", + "# (vi)\n", + "rm= r/sqrt(n-1) # in gramme\n", + "print \"Probable error of mean = %0.4f gramme\" %rm" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Arithmetic mean = 1.5752 gramme\n", + "Average deviation = 0.011 gramme\n", + "Standard deviation = 0.01426 gramme\n", + "Variance = 2.033e-04 gramme**2\n", + "Probable error = 0.0096 gramme\n", + "Probable error of mean = 0.0032 gramme\n" + ] + } + ], + "prompt_number": 63 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |