diff options
Diffstat (limited to 'Engineering_Physics/Chapter_1.ipynb')
-rw-r--r-- | Engineering_Physics/Chapter_1.ipynb | 166 |
1 files changed, 148 insertions, 18 deletions
diff --git a/Engineering_Physics/Chapter_1.ipynb b/Engineering_Physics/Chapter_1.ipynb index 4392ba50..080a49e2 100644 --- a/Engineering_Physics/Chapter_1.ipynb +++ b/Engineering_Physics/Chapter_1.ipynb @@ -1,6 +1,7 @@ { "metadata": { - "name": "Chapter 1" + "name": "", + "signature": "sha256:f155f4255421e223741f26abb6caa1287b63505ee5f432c40968d5b5ff6fb505" }, "nbformat": 3, "nbformat_minor": 0, @@ -11,25 +12,49 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": "Ultrasonics" + "source": [ + "Ultrasonics" + ] }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.1, Page number 28 " + "source": [ + "Example number 1.1, Page number 28 " + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the fundamental frequency of vibration\n\n#importing modules\nimport math\n\n#Variable declaration\nt=0.15*10**-2; #thickness of the quartz crystal in m\nY=7.9*10**10; #young's modulus of quartz in N/m^2\nrho=2650; #density of quartz in kg/m^3\n\n#Calculation\nx=math.sqrt(Y/rho);\nf=x/(2*t);\nf=f*10**-6; #converting f from Hz to MHz\nf=math.ceil(f*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"fundamental frequency of vibration in MHz is\",f);\n", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "t=0.15*10**-2; #thickness of the quartz crystal in m\n", + "Y=7.9*10**10; #young's modulus of quartz in N/m^2\n", + "rho=2650; #density of quartz in kg/m^3\n", + "\n", + "#Calculation\n", + "x=math.sqrt(Y/rho);\n", + "f=x/(2*t);\n", + "f=f*10**-6; #converting f from Hz to MHz\n", + "f=math.ceil(f*10**6)/10**6; #rounding off to 6 decimals\n", + "\n", + "#Result\n", + "print(\"fundamental frequency of vibration in MHz is\",f);\n" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('fundamental frequency of vibration in MHz is', 1.819992)\n" + "text": [ + "('fundamental frequency of vibration in MHz is', 1.819992)\n" + ] } ], "prompt_number": 2 @@ -38,19 +63,56 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.2, Page number 28 " + "source": [ + "Example number 1.2, Page number 28 " + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the fundamental frequency and the first overtone\n\n#importing modules\nimport math\n\n#Variable declaration\nt=1e-03; #thickness of the quartz crystal in m\nY=7.9*10**10; #young's modulus of quartz in N/m^2\nrho=2650; #density of quartz in kg/m^3\n\n#Calculation\nx=math.sqrt(Y/rho);\np1=1; #for fundamental frequency p=1\nf1=(p1*x)/(2*t);\nF1=f1/10**6;\nF1=math.ceil(F1*10**5)/10**5; #rounding off to 5 decimals\nf_1=f1*10**-6; #converting f1 from Hz to MHz\nf_1=math.ceil(f_1*10**5)/10**5; #rounding off to 5 decimals\np2=2; #for first overtone p=2\nf2=(p2*x)/(2*t);\nF2=f2/10**6;\nF2=math.ceil(F2*10**5)/10**5; #rounding off to 5 decimals\nf_2=f2*10**-6; #converting f2 from Hz to MHz\nf_2=math.ceil(f_2*10**5)/10**5; #rounding off to 5 decimals\n\n#Result\nprint(\"fundamental frequency in Hz is\",F1,\"*10**6\");\nprint(\"fundamental frequency in MHz is\",f_1);\nprint(\"frequency of the first overtone in Hz is\",F2,\"*10**6\");\nprint(\"frequency of the first overtone in MHz is\",f_2);\n", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "t=1e-03; #thickness of the quartz crystal in m\n", + "Y=7.9*10**10; #young's modulus of quartz in N/m^2\n", + "rho=2650; #density of quartz in kg/m^3\n", + "\n", + "#Calculation\n", + "x=math.sqrt(Y/rho);\n", + "p1=1; #for fundamental frequency p=1\n", + "f1=(p1*x)/(2*t);\n", + "F1=f1/10**6;\n", + "F1=math.ceil(F1*10**5)/10**5; #rounding off to 5 decimals\n", + "f_1=f1*10**-6; #converting f1 from Hz to MHz\n", + "f_1=math.ceil(f_1*10**5)/10**5; #rounding off to 5 decimals\n", + "p2=2; #for first overtone p=2\n", + "f2=(p2*x)/(2*t);\n", + "F2=f2/10**6;\n", + "F2=math.ceil(F2*10**5)/10**5; #rounding off to 5 decimals\n", + "f_2=f2*10**-6; #converting f2 from Hz to MHz\n", + "f_2=math.ceil(f_2*10**5)/10**5; #rounding off to 5 decimals\n", + "\n", + "#Result\n", + "print(\"fundamental frequency in Hz is\",F1,\"*10**6\");\n", + "print(\"fundamental frequency in MHz is\",f_1);\n", + "print(\"frequency of the first overtone in Hz is\",F2,\"*10**6\");\n", + "print(\"frequency of the first overtone in MHz is\",f_2);\n" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('fundamental frequency in Hz is', 2.72999, '*10**6')\n('fundamental frequency in MHz is', 2.72999)\n('frequency of the first overtone in Hz is', 5.45998, '*10**6')\n('frequency of the first overtone in MHz is', 5.45998)\n" + "text": [ + "('fundamental frequency in Hz is', 2.72999, '*10**6')\n", + "('fundamental frequency in MHz is', 2.72999)\n", + "('frequency of the first overtone in Hz is', 5.45998, '*10**6')\n", + "('frequency of the first overtone in MHz is', 5.45998)\n" + ] } ], "prompt_number": 1 @@ -59,19 +121,46 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.3, Page number 29 " + "source": [ + "Example number 1.3, Page number 29 " + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the velocity of ultrasonic wave\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda=589.3*10**-9; #wavelength of light in m\nf=100*10**6; #frequency of ultrasonic transducer in Hz\nn=1; #order of diffraction\ntheta=2.25; #angle of diffraction in degrees\ntheta=theta*0.0174532925; #converting degrees to radians\n\n#Calculation\nd=(n*lamda)/(2*math.sin(theta));\nd1=d*10**6; #converting d from m to micro m\nlamda1=2*d;\nv=f*lamda1;\nv=math.ceil(v*100)/100; #rounding off to 2 decimals\n\n#Result\nprint(\"wavelength of ultrasonic wave in m is\",lamda1);\nprint(\"velocity of ultrasonic wave in m/sec\",int(v));", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "lamda=589.3*10**-9; #wavelength of light in m\n", + "f=100*10**6; #frequency of ultrasonic transducer in Hz\n", + "n=1; #order of diffraction\n", + "theta=2.25; #angle of diffraction in degrees\n", + "theta=theta*0.0174532925; #converting degrees to radians\n", + "\n", + "#Calculation\n", + "d=(n*lamda)/(2*math.sin(theta));\n", + "d1=d*10**6; #converting d from m to micro m\n", + "lamda1=2*d;\n", + "v=f*lamda1;\n", + "v=math.ceil(v*100)/100; #rounding off to 2 decimals\n", + "\n", + "#Result\n", + "print(\"wavelength of ultrasonic wave in m is\",lamda1);\n", + "print(\"velocity of ultrasonic wave in m/sec\",int(v));" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('wavelength of ultrasonic wave in m is', 1.5010258944908707e-05)\n('velocity of ultrasonic wave in m/sec', 1501)\n" + "text": [ + "('wavelength of ultrasonic wave in m is', 1.5010258944908707e-05)\n", + "('velocity of ultrasonic wave in m/sec', 1501)\n" + ] } ], "prompt_number": 19 @@ -80,19 +169,42 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.4, Page number 29 " + "source": [ + "Example number 1.4, Page number 29 " + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the Doppler shifted frequency\n\n#importing modules\nimport math\n\n#Variable declaration\nf=2*10**6; #frequency of transducer in MHz\nv=3; #speed of blood in m/s\nc=800; #velocity of ultrasonic wave in m/s\ntheta=30; #angle of inclination in degrees\ntheta=theta*0.0174532925; #converting degrees to radians\n\n#Calculation\ndeltaf=(2*f*v*math.cos(theta))/c;\ndeltaf=deltaf*10**-6; #converting deltaf from Hz to MHz\ndeltaf=math.ceil(deltaf*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"doppler shifted frequency in MHz is\",deltaf);", + "input": [ + " \n", + "#importing modules\n", + "import math\n", + "\n", + "#Variable declaration\n", + "f=2*10**6; #frequency of transducer in MHz\n", + "v=3; #speed of blood in m/s\n", + "c=800; #velocity of ultrasonic wave in m/s\n", + "theta=30; #angle of inclination in degrees\n", + "theta=theta*0.0174532925; #converting degrees to radians\n", + "\n", + "#Calculation\n", + "deltaf=(2*f*v*math.cos(theta))/c;\n", + "deltaf=deltaf*10**-6; #converting deltaf from Hz to MHz\n", + "deltaf=math.ceil(deltaf*10**6)/10**6; #rounding off to 6 decimals\n", + "\n", + "#Result\n", + "print(\"doppler shifted frequency in MHz is\",deltaf);" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('doppler shifted frequency in MHz is', 0.012991)\n" + "text": [ + "('doppler shifted frequency in MHz is', 0.012991)\n" + ] } ], "prompt_number": 20 @@ -101,19 +213,37 @@ "cell_type": "heading", "level": 2, "metadata": {}, - "source": "Example number 1.5, Page number 30 " + "source": [ + "Example number 1.5, Page number 30 " + ] }, { "cell_type": "code", "collapsed": false, - "input": "#To calculate the velocity of ultrasonic wave\n\n#importing modules\nimport math\n\n#Variable declaration\nY=7.9*10**10; #young's modulus of quartz in N/m^2\nrho=2650; #density of quartz in kg/m^3\n\n#Calculation\nv=math.sqrt(Y/rho);\nv=math.ceil(v*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint(\"velocity of ultrasonic waves in m/s is\",v);\n", + "input": [ + " \n", + "import math\n", + "\n", + "#Variable declaration\n", + "Y=7.9*10**10; #young's modulus of quartz in N/m^2\n", + "rho=2650; #density of quartz in kg/m^3\n", + "\n", + "#Calculation\n", + "v=math.sqrt(Y/rho);\n", + "v=math.ceil(v*10**3)/10**3; #rounding off to 3 decimals\n", + "\n", + "#Result\n", + "print(\"velocity of ultrasonic waves in m/s is\",v);\n" + ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": "('velocity of ultrasonic waves in m/s is', 5459.975)\n" + "text": [ + "('velocity of ultrasonic waves in m/s is', 5459.975)\n" + ] } ], "prompt_number": 21 @@ -121,7 +251,7 @@ { "cell_type": "code", "collapsed": false, - "input": "", + "input": [], "language": "python", "metadata": {}, "outputs": [] |