diff options
author | hardythe1 | 2015-04-07 15:58:05 +0530 |
---|---|---|
committer | hardythe1 | 2015-04-07 15:58:05 +0530 |
commit | c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131 (patch) | |
tree | 725a7d43dc1687edf95bc36d39bebc3000f1de8f /sample_notebooks/MohdAsif/Chapter2,_Measurement_Errors.ipynb | |
parent | 62aa228e2519ac7b7f1aef53001f2f2e988a6eb1 (diff) | |
download | Python-Textbook-Companions-c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131.tar.gz Python-Textbook-Companions-c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131.tar.bz2 Python-Textbook-Companions-c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131.zip |
added books
Diffstat (limited to 'sample_notebooks/MohdAsif/Chapter2,_Measurement_Errors.ipynb')
-rwxr-xr-x | sample_notebooks/MohdAsif/Chapter2,_Measurement_Errors.ipynb | 257 |
1 files changed, 257 insertions, 0 deletions
diff --git a/sample_notebooks/MohdAsif/Chapter2,_Measurement_Errors.ipynb b/sample_notebooks/MohdAsif/Chapter2,_Measurement_Errors.ipynb new file mode 100755 index 00000000..f8ad79f0 --- /dev/null +++ b/sample_notebooks/MohdAsif/Chapter2,_Measurement_Errors.ipynb @@ -0,0 +1,257 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:7b602763fd5a9c056abb62703a3bc42ae0cb4a39b3c349f78c056ebe58b1c643" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Example 2_3_1" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Precision of the 5th measurement\n", + "#Given data : Measurements taken(Unit less)\n", + "X1=98;\n", + "X2=101;\n", + "X3=102;\n", + "X4=97;\n", + "X5=101;\n", + "X6=100;\n", + "X7=103;\n", + "X8=98;\n", + "X9=106;\n", + "X10=99.0;\n", + "#Calculation\n", + "Xn_bar=(X1+X2+X3+X4+X5+X6+X7+X8+X9+X10)/10;\n", + "Xn=101 # value of 5th measurement\n", + "P=(1-abs((Xn-Xn_bar)/Xn_bar))*100 #Precision\n", + "print \"Precision of the 5th measurement,P(%) = \",round(P,3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Precision of the 5th measurement,P(%) = 99.502\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Example 2_3_2_a" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Absolute error\n", + "#given data :\n", + "Ae=80.0 # in V\n", + "Am=79 # in V\n", + "e=Ae-Am #absolute error\n", + "print \"Absolute error,e(V) = \",e" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Absolute error,e(V) = 1.0\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Example 2_3_2_b" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Finding error\n", + "#given data :\n", + "Ae=80.0 # in V\n", + "Am=79 # in V\n", + "e=Ae-Am #error\n", + "ep=(e/Ae)*100 #relative percent error\n", + "print \"Relative Percent Error(%) = \",ep" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Relative Percent Error(%) = 1.25\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Example 2_3_3" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# maximum error\n", + "#given data :\n", + "V1=100 # in volts\n", + "V2=200 # in volts\n", + "V=V2-V1 # Voltage difference\n", + "A=.25 # Accuracy may be \u00b1 in %\n", + "max_error=(A/100)*V # in Volts\n", + "print \"maximum error(V) = \u00b1\",max_error" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "maximum error(V) = \u00b1 0.25\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Example 2_3_4" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#sensitivity and deflection error\n", + "# given data :\n", + "C=4.0 # change in output in mm\n", + "M=8.0 # magnitude of input in ohm\n", + "S=C/M # sensitivity\n", + "print \"sensitivity,S(mm/ohm) = \",S\n", + "D=M/C # Deflection\n", + "print \"Deflection factor,D(ohm/m) = \",D" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "sensitivity,S(mm/ohm) = 0.5\n", + "Deflection factor,D(ohm/m) = 2.0\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Example 2_3_5 " + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Resolution\n", + "# given data :\n", + "V=200.0 # full scale reading in volts\n", + "N=100.0 # number of divisions \n", + "Scale_div=V/N # Volts\n", + "R=(1/10.0)*Scale_div # Resolution in Volts\n", + "print \"Resolution, R(V) = \",round(R,4)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Resolution, R(V) = 0.2\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Example 2_3_6" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Resolution\n", + "#given data :\n", + "V=9.999 # full scale read out in volt\n", + "c=range(0,9999) # range from 0 to 9999\n", + "R=(1/max(c))*V*10.0**3\n", + "print \"Resolution, R(mV)\", R" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Resolution, R(mV) 0.0\n" + ] + } + ], + "prompt_number": 29 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |