summaryrefslogtreecommitdiff
path: root/sample_notebooks/RuchiMittal
diff options
context:
space:
mode:
authorThomas Stephen Lee2015-08-28 16:53:23 +0530
committerThomas Stephen Lee2015-08-28 16:53:23 +0530
commitdb0855dbeb41ecb8a51dde8587d43e5d7e83620f (patch)
treeb95975d958cba9af36cb1680e3f77205354f6512 /sample_notebooks/RuchiMittal
parent5a86a20b9de487553d4ef88719fb0fd76a5dd6a7 (diff)
downloadPython-Textbook-Companions-db0855dbeb41ecb8a51dde8587d43e5d7e83620f.tar.gz
Python-Textbook-Companions-db0855dbeb41ecb8a51dde8587d43e5d7e83620f.tar.bz2
Python-Textbook-Companions-db0855dbeb41ecb8a51dde8587d43e5d7e83620f.zip
add books
Diffstat (limited to 'sample_notebooks/RuchiMittal')
-rwxr-xr-xsample_notebooks/RuchiMittal/chap1.ipynb412
1 files changed, 412 insertions, 0 deletions
diff --git a/sample_notebooks/RuchiMittal/chap1.ipynb b/sample_notebooks/RuchiMittal/chap1.ipynb
new file mode 100755
index 00000000..c87721c5
--- /dev/null
+++ b/sample_notebooks/RuchiMittal/chap1.ipynb
@@ -0,0 +1,412 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:0634d7bf5367e0141c25c22bd055ab7dd0d67262eacfb1ab474c7c9ba196985e"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 Qualities of measurments"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1 Page no 3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=80.0 #expected value of voltage in Volts\n",
+ "V1=79 #Volts\n",
+ "\n",
+ "#Calculation\n",
+ "E=V-V1\n",
+ "E1=((V-V1)/V)*100\n",
+ "E2=1-((V-V1)/V)\n",
+ "A=100*E2\n",
+ "#Result\n",
+ "print\"(i) Absolute error is \",E,\"V\"\n",
+ "print\"(ii) percent error is \", E1,\"%\"\n",
+ "print\"(iii) reletive error is \", E2\n",
+ "print\"(iv) percent of accuracy is \", A,\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Absolute error is 1.0 V\n",
+ "(ii) percent error is 1.25 %\n",
+ "(iii) reletive error is 0.9875\n",
+ "(iv) percent of accuracy is 98.75 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2 Page no 4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\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\n",
+ "\n",
+ "#Calculation\n",
+ "X=(x1+x2+x3+x4+x5+x6+x7+x8+x9+x10)/10.0\n",
+ "P=(x6/X)\n",
+ "\n",
+ "#Result\n",
+ "print\"Precision of the 6th measurment is \",round(P,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Precision of the 6th measurment is 0.995\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3(a) Page no 7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#given\n",
+ "V=80 #milliammeter readings\n",
+ "I=10.0 #mA\n",
+ "V1=150 #Volts\n",
+ "R1=1000 #ohm/volt\n",
+ "\n",
+ "#Calculation\n",
+ "R=V/I\n",
+ "Rv=R1*V1\n",
+ "Rx=(R*V1)/(V1-R)\n",
+ "E=((Rx-R)/Rx)*100\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Apparent resistance of the unknown resistance \",R,\"K ohm\"\n",
+ "print \"Actual resistance of the unknown resistance is \",round(Rx,2),\"K ohm\"\n",
+ "print \"Error due to the loading effet of the voltmeter \",round(E,1),\"%\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Apparent resistance of the unknown resistance 8.0 K ohm\n",
+ "Actual resistance of the unknown resistance is 8.45 K ohm\n",
+ "Error due to the loading effet of the voltmeter 5.3 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 104
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3(b) Page no 7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=30 #Volts\n",
+ "V1=150 #Volts\n",
+ "I=0.6 #A\n",
+ "R1=1000 #ohm/volts\n",
+ "\n",
+ "#Calculation\n",
+ "R=V/I\n",
+ "Rv=(R1*V1)\n",
+ "Rx=(R*Rv)/(Rv-R)\n",
+ "E=((Rx-R)/Rx)*100\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) total circuit resistance is \", R,\"ohm\"\n",
+ "print \"(ii) The voltmeter resistance is \",round(Rx,2)\n",
+ "print\"(iii) Error due to loading effect of voltmeter \", round(E,3),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) total circuit resistance is 50.0 ohm\n",
+ "(ii) The voltmeter resistance is 50.02\n",
+ "(iii) Error due to loading effect of voltmeter 0.033 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 113
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.4 Page no 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "x1=49.7\n",
+ "x2=50.1\n",
+ "x3=50.2\n",
+ "x4=49.6\n",
+ "x5=49.7\n",
+ "\n",
+ "#Calculation\n",
+ "X=(x1+x2+x3+x4+x5)/5.0\n",
+ "d1=x1-X\n",
+ "d2=x2-X\n",
+ "d3=x3-X\n",
+ "d4=x4-X\n",
+ "d5=x5-X\n",
+ "dtotal=(d1+d2+d3+d4+d5)\n",
+ "\n",
+ "#Result\n",
+ "print\"(i) Arithmetic mean is \", X\n",
+ "print\"(ii) derivations from each value are\"\n",
+ "print \"d1=\",d1,\"\\nd2=\",d2,\"\\nd3=\",d3,\"\\nd4=\",d4,\"\\nd5=\",d5\n",
+ "print\"(iii) The algebric sum of derivative is \",round(dtotal,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Arithmetic mean is 49.86\n",
+ "(ii) derivations from each value are\n",
+ "d1= -0.16 \n",
+ "d2= 0.24 \n",
+ "d3= 0.34 \n",
+ "d4= -0.26 \n",
+ "d5= -0.16\n",
+ "(iii) The algebric sum of derivative is 0.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 77
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.5 Page no 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "x1=49.7\n",
+ "x2=50.1\n",
+ "x3=50.2\n",
+ "x4=49.6\n",
+ "x5=49.7\n",
+ "\n",
+ "#Calculation\n",
+ "X=(x1+x2+x3+x4+x5)/5.0\n",
+ "d1=x1-X\n",
+ "d2=x2-X\n",
+ "d3=x3-X\n",
+ "d4=x4-X\n",
+ "d5=x5-X\n",
+ "dtotal=(d1+d2+d3+d4+d5)/5.0\n",
+ "\n",
+ "#Result\n",
+ "print\"The average deviation is \",round(dtotal*10**14,3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The average deviation is 0.284\n"
+ ]
+ }
+ ],
+ "prompt_number": 86
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.6 Page no 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "d1= -0.16 \n",
+ "d2= 0.24 \n",
+ "d3= 0.34 \n",
+ "d4= -0.26 \n",
+ "d5= -0.16\n",
+ "\n",
+ "#Calculation\n",
+ "import math\n",
+ "D=math.sqrt((d1**2+d2**2+d3**2+d4**2+d5**2)/4.0)\n",
+ "print\"The standard deviation is \",round(D,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The standard deviation is 0.27\n"
+ ]
+ }
+ ],
+ "prompt_number": 90
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.7 Page no 15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=600 #Volts\n",
+ "V1=250.0 #Volts\n",
+ "a=0.02\n",
+ "\n",
+ "#Calculation\n",
+ "M=a*V\n",
+ "E=(M/V1)*100\n",
+ "\n",
+ "#Result\n",
+ "print\"The limited error is \", E,\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The limited error is 4.8 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 94
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.8 Page no 15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "V=70.0 #Volts\n",
+ "V1=100 #Volts\n",
+ "I=80.0 #mA\n",
+ "I1=150 #mA\n",
+ "a=0.015\n",
+ "\n",
+ "#calculation\n",
+ "M=a*V1\n",
+ "E=(M/V)*100\n",
+ "E1=a*I1\n",
+ "E2=(E1/I)*100\n",
+ "E3=E+E2\n",
+ "\n",
+ "#Result\n",
+ "print\"limiting error is \",round (E3,3),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "limiting error is 4.955 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 102
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file