{ "metadata": { "name": "Chapter_4" }, "nbformat": 2, "worksheets": [ { "cells": [ { "cell_type": "markdown", "source": [ "

Chapter 4: Acceleration Vibration and Density

" ] }, { "cell_type": "markdown", "source": [ "

Example 4.1, Page Number:209

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "''''mechanical system for a seismic instrument'''", "", "import math", "#(a)", "", "#variable Declaration", "k=50.0 #Spring constant ", "m=0.005 # mass in kg", "", "#calculation", "wn=math.sqrt(k/m)", "", "#result", "print('(a)\\nNatural frequency(wn)= %d rad/s' %wn)", "", "", "#(b)", "", "#calculation", "Cc=2*(m*k)**(0.5)", "", "#result", "print('\\n(b)\\nCc=%d' %Cc)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)", "Natural frequency(wn)= 100 rad/s", "", "(b)", "Cc=1" ] } ], "prompt_number": 1 }, { "cell_type": "markdown", "source": [ "

Example 4.2, Page Number:209

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Frequency and phase angle of motion'''", "", "#(a)", "import math", "", "#variable Declaration", "Cc=1.0 # damping ratio ", "C=0.7*Cc # Critical damping ratio ", "m=0.005 # mass", "k=50.0 # spring constant", "", "#calculation", "w=math.sqrt((k/m)-(C/(2*m))**2)", "", "#result", "print('(a)\\nw=%.1f rad/s' %w)", "", "#(b)", "", "#variable Declaration", "w1=250.0 # angular velocity", "", "#calculation", "theta=C*w1/(k-m*w1**2)", "print('\\ntheta=%f' %theta)", "fi=math.atan(-theta)", "fi=fi*180.0/math.pi", "", "#result", "print('\\nfi = %d\u00b0'%fi)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)", "w=71.4 rad/s", "", "theta=-0.666667", "", "fi = 33\u00b0" ] } ], "prompt_number": 2 }, { "cell_type": "markdown", "source": [ "

Example 4.3, PAge Number: 210

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''time calculation for exponetial transient term'''", "import math", "", "#variable Declaration", "m=0.005 # mass ", "c=0.7 # damping ratio", "", "#calculation", "y=-math.log(0.01)", "t=y*2*m/c", "", "#result", "print('t=%.4f Secs' %t)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "t=0.0658 Secs" ] } ], "prompt_number": 3 }, { "cell_type": "markdown", "source": [ "

Example 4.4, Page Number:210

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Acceleration measurement'''", "", "#variable Declaration", "rg1=1200.0 #resistance in Ohm", "rg2=1200.0 #resistance in Ohm", "rg3=1200.0 #resistance in Ohm", "rg4=1200.0 #resistance in Ohm", "", "#calculation", "D1=rg1*5.0/100.0", "D2=rg2*5.0/100.0", "D3=rg3*5.0/100.0", "D4=rg4*5.0/100.0", "E=12.0", "v=E*(((rg1+D1)/(rg1+D1+rg2-D2))-((rg4-D4)/(rg3+D3+rg4-D4)))", "v=v*1000.0", "", "#result", "print('V0=%d mV' %v)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "V0=600 mV" ] } ], "prompt_number": 4 }, { "cell_type": "markdown", "source": [ "

Example 4.5, Page Number:211

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''output voltage of quartz piezoelectric crystal'''", "", "#variable declaration", "g=0.06 # voltage sensitivity", "", "#calculation", "t=2.5*10**-3", "p=20*9.8*10**4", "E=g*t*p", "", "#Result", "print('E=%d V' %E)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "E=294 V" ] } ], "prompt_number": 5 }, { "cell_type": "markdown", "source": [ "

Example 4.6, Page Number: 211

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Differential values of capacitor'''", "", "#resistance in Ohm", "c0=25.0 # capacitance in pF", "x0=0.5 # distance between plates", "x1=0.05 # steady state displacement ", "", "#calculations", "c1=c0*x0/(x0-x1)", "c2=c0*x0/(x0+x1)", "", "#result", "print('C1=%.2f pF\\nC2=%.2f pF'%(c1,c2))" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "C1=27.78 pF", "C2=22.73 pF" ] } ], "prompt_number": 6 }, { "cell_type": "markdown", "source": [ "

Example 4.7, Page Number: 211

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Specific Gravity Conversion'''", "", "#(a)", "", "#Specific gravity at 60 degree F", "sg_at_60=1.02", "", "#calculation", "API=(141.5/sg_at_60)-131.5", "", "#result", "print('(a)\\nDegrees API = %.2f\u00b0API' %API)", "", "#(b)", "", "#calculation", "Be=145-145/sg_at_60", "", "#result", "print('\\n(b)\\nDegrees Baume(heavy) = %.1f\u00b0Be' %Be)", "", "", "#(c)", "", "#calculation", "Bk=(sg_at_60-1)*1000", "", "#result", "print('\\n(c)\\nDegrees Barkometer = %d\u00b0Bk' %Bk)", "", "#(d)", "", "#calculation", "Q=(sg_at_60-1)*1000", "", "#result", "print('\\n(c)\\nDegrees Quevenne = %d\u00b0Q' %Q)", "", "#(e)", "", "#calculation", "Tw=200*(sg_at_60-1.0)", "", "#result", "print('\\n(d)\\nDegrees Twaddel = %d\u00b0Tw' %Tw)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)", "Degrees API = 7.23\u00b0API", "", "(b)", "Degrees Baume(heavy) = 2.8\u00b0Be", "", "(c)", "Degrees Barkometer = 20\u00b0Bk", "", "(c)", "Degrees Quevenne = 20\u00b0Q", "", "(d)", "Degrees Twaddel = 4\u00b0Tw" ] } ], "prompt_number": 7 }, { "cell_type": "markdown", "source": [ "

Example 4.8, Page NUmber: 212

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''calculation of the volume of displacer'''", "", "import math", "", "#variable Declaration", "T=0.5 # Torque Tube Force", "sg1=1.02 # Maximum spe.gravity to be measured", "sg2=0.98 # Minimum spe.gravity to be measured", "wt=1000*10**-6", "", "#calculation", "v=T/((sg1-sg2)*wt)", "v=math.ceil(v)", "", "#result", "print('V=%d cm^3' %v)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "V=12500 cm^3" ] } ], "prompt_number": 8 }, { "cell_type": "markdown", "source": [ "

Example 4.9, Page Number: 212

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Differential pressure Sensor'''", "", "import math", "", "#variavle declaration", "sg1=0.85 # Maximum spe.gravity to be measured", "sg2=0.8 # Minimum spe.gravity to be measured", "span=150.0 # D/P cell span", "", "", "#a", "", "#calculation", "H=span/(sg1-sg2)", "", "#result", "print('(a)\\nH=%d mm = %dm' %(H,H/1000))", "", "#b", "", "#calculation", "span_min=1500.0", "span2=span_min*(sg1-sg2)", "span2=math.ceil(span2)", "", "#result", "print('\\n(b)\\nD/P span = %d mm' %span2)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)", "H=3000 mm = 3m", "", "(b)", "D/P span = 75 mm" ] } ], "prompt_number": 9 }, { "cell_type": "markdown", "source": [ "

Example 4.10, Page Number:212

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Specific Gravity of unknown liquid'''", "", "#variable declaration", "Ww=12-2 # Width of water", "dw=1000.0 # density of water", "", "#calculation", "v=Ww/dw", "dx=(10-2)/v", "sg=dx/dw ", "", "#result", "print('Specific Gravity of X =%.1f' %sg)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Specific Gravity of X =0.8" ] } ], "prompt_number": 10 }, { "cell_type": "markdown", "source": [ "

Example 4.11, PAge Number: 213

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''calculation of specific gravity'''", "", "#(a)", "", "#variable declaration", "wt=1.5 # weight of object", " ", "#calculation", "v_obj=2.0/1000", "dx=wt/v_obj", "sg=dx/1000", "", "#result", "print('(a)\\nSpecific Gravity = %.2f' %sg)", "", "#(b)", "", "sgl=0.8 # specific grav of liquid", "dens=800.0 # density", "", "#calculation", "W1=dens*v_obj-wt", "", "#result", "print('\\n(b)\\nW1 = %.1f kg' %W1)", "", "", "#(c)", "", "#variable declaration", "sg2=1.2 # spe. grav.", "dens2=1200.0 # density", "", "#calculation", "W2=dens2*v_obj-wt", "", "#result", "print('\\n(c)\\nW2 = %.1f kg' %W2)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)", "Specific Gravity = 0.75", "", "(b)", "W1 = 0.1 kg", "", "(c)", "W2 = 0.9 kg" ] } ], "prompt_number": 11 } ] } ] }