summaryrefslogtreecommitdiff
path: root/Industrial_Instrumentation/Chapter_2.ipynb
diff options
context:
space:
mode:
authordebashisdeb2014-06-20 15:42:42 +0530
committerdebashisdeb2014-06-20 15:42:42 +0530
commit83c1bfceb1b681b4bb7253b47491be2d8b2014a1 (patch)
treef54eab21dd3d725d64a495fcd47c00d37abed004 /Industrial_Instrumentation/Chapter_2.ipynb
parenta78126bbe4443e9526a64df9d8245c4af8843044 (diff)
downloadPython-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.tar.gz
Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.tar.bz2
Python-Textbook-Companions-83c1bfceb1b681b4bb7253b47491be2d8b2014a1.zip
removing problem statements
Diffstat (limited to 'Industrial_Instrumentation/Chapter_2.ipynb')
-rw-r--r--Industrial_Instrumentation/Chapter_2.ipynb871
1 files changed, 449 insertions, 422 deletions
diff --git a/Industrial_Instrumentation/Chapter_2.ipynb b/Industrial_Instrumentation/Chapter_2.ipynb
index f6c4dada..41a457ab 100644
--- a/Industrial_Instrumentation/Chapter_2.ipynb
+++ b/Industrial_Instrumentation/Chapter_2.ipynb
@@ -1,603 +1,630 @@
{
"metadata": {
- "name": "Chapter_2"
- },
- "nbformat": 2,
+ "name": "",
+ "signature": "sha256:e12000c40c7eba5fb38d72e0bdbc08735899d3485eb0ecea04e85215c845b6b8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h1>Chapter 2: Pressure<h1>"
]
- },
+ },
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h3>Example 2.1, Page Number: 116<h3>"
]
- },
+ },
{
- "cell_type": "code",
- "collapsed": false,
+ "cell_type": "code",
+ "collapsed": false,
"input": [
- "'''Pressure conversion'''",
- "",
- "#(a)",
- "",
- "#variable declaration",
- "#1kg/cm^2=10000 mmWG",
- "x=10000.0*10.0 #equivalnt to 10kg/cm^2",
- "",
- "#result",
- "print('(a)\\n 10kg/cm^2 = %.0f mmWG' %x)",
- "",
- "#(b)",
- "",
- "#variable declaration",
- "onemm_Hg=13.546 #pressure of 1 mm Hg",
- "",
- "#calculation",
- "y=10.0**5/onemm_Hg",
- "y=y/10.0**3",
- "",
- "#result",
- "print('\\n(b)\\n10kg/cm^2 = 10^5 mmWG = %.2f * 10^3 mmHg' %y)",
- "",
- "#(c)",
- "",
- "#variable declaration",
- "onebar=1.03 # 1 Bar presssure in kg/cm^2",
- "#calculation",
- "z=10.0/onebar",
- "",
- "#result",
+ "\n",
+ "\n",
+ "#(a)\n",
+ "\n",
+ "#variable declaration\n",
+ "#1kg/cm^2=10000 mmWG\n",
+ "x=10000.0*10.0 #equivalnt to 10kg/cm^2\n",
+ "\n",
+ "#result\n",
+ "print('(a)\\n 10kg/cm^2 = %.0f mmWG' %x)\n",
+ "\n",
+ "#(b)\n",
+ "\n",
+ "#variable declaration\n",
+ "onemm_Hg=13.546 #pressure of 1 mm Hg\n",
+ "\n",
+ "#calculation\n",
+ "y=10.0**5/onemm_Hg\n",
+ "y=y/10.0**3\n",
+ "\n",
+ "#result\n",
+ "print('\\n(b)\\n10kg/cm^2 = 10^5 mmWG = %.2f * 10^3 mmHg' %y)\n",
+ "\n",
+ "#(c)\n",
+ "\n",
+ "#variable declaration\n",
+ "onebar=1.03 # 1 Bar presssure in kg/cm^2\n",
+ "#calculation\n",
+ "z=10.0/onebar\n",
+ "\n",
+ "#result\n",
"print('\\n(c)\\n10kg/cm^2 = %.2f bars' %z)"
- ],
- "language": "python",
+ ],
+ "language": "python",
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
- "stream": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
"text": [
- "(a)",
- " 10kg/cm^2 = 100000 mmWG",
- "",
- "(b)",
- "10kg/cm^2 = 10^5 mmWG = 7.38 * 10^3 mmHg",
- "",
- "(c)",
+ "(a)\n",
+ " 10kg/cm^2 = 100000 mmWG\n",
+ "\n",
+ "(b)\n",
+ "10kg/cm^2 = 10^5 mmWG = 7.38 * 10^3 mmHg\n",
+ "\n",
+ "(c)\n",
"10kg/cm^2 = 9.71 bars"
]
}
- ],
+ ],
"prompt_number": 1
- },
+ },
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h3>Example 2.2, Page Number: 116<h3>"
]
- },
+ },
{
- "cell_type": "code",
- "collapsed": false,
+ "cell_type": "code",
+ "collapsed": false,
"input": [
- "'''Gauge and absolute pressure'''",
- "",
- "#(a)",
- "",
- "#variable Declaration",
- "gamm=1000.0 # density of water",
- "d=35.0 # depth of water ",
- "dens_Hg=13.546 # density of Hg",
- "",
- "#calculation",
- "press_in_kg_cm=gamm*d*10**-4",
- "press_in_mmHg=gamm*d/dens_Hg",
- "press_in_mmHg=press_in_mmHg/10**3",
- "",
- "#result",
- "print('(a)\\nThe pressure at depth of %d meters in a water tank=%.1f kg/cm^2 = %.2f*10^3 mmHg'%(d, press_in_kg_cm, press_in_mmHg))",
- "",
- "#(b)",
- "",
- "#varible declaration",
- "press_atm=1.03 #atmospheric pressure",
- "",
- "#calculation",
- "abspress=press_in_kg_cm+press_atm",
- "abspress_mmHg=press_in_mmHg*1000.0+760.0",
- "abspress_mmHg=abspress_mmHg/1000.0",
- "",
- "#result",
+ "\n",
+ "\n",
+ "#(a)\n",
+ "\n",
+ "#variable Declaration\n",
+ "gamm=1000.0 # density of water\n",
+ "d=35.0 # depth of water \n",
+ "dens_Hg=13.546 # density of Hg\n",
+ "\n",
+ "#calculation\n",
+ "press_in_kg_cm=gamm*d*10**-4\n",
+ "press_in_mmHg=gamm*d/dens_Hg\n",
+ "press_in_mmHg=press_in_mmHg/10**3\n",
+ "\n",
+ "#result\n",
+ "print('(a)\\nThe pressure at depth of %d meters in a water tank=%.1f kg/cm^2 = %.2f*10^3 mmHg'%(d, press_in_kg_cm, press_in_mmHg))\n",
+ "\n",
+ "#(b)\n",
+ "\n",
+ "#varible declaration\n",
+ "press_atm=1.03 #atmospheric pressure\n",
+ "\n",
+ "#calculation\n",
+ "abspress=press_in_kg_cm+press_atm\n",
+ "abspress_mmHg=press_in_mmHg*1000.0+760.0\n",
+ "abspress_mmHg=abspress_mmHg/1000.0\n",
+ "\n",
+ "#result\n",
"print('\\n(b)\\nAbsolute Pressure= %.2f kg/cm^2 Abs = %.2f*10^3 mmHg Abs'%(abspress, abspress_mmHg))"
- ],
- "language": "python",
+ ],
+ "language": "python",
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
- "stream": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
"text": [
- "(a)",
- "The pressure at depth of 35 meters in a water tank=3.5 kg/cm^2 = 2.58*10^3 mmHg",
- "",
- "(b)",
+ "(a)\n",
+ "The pressure at depth of 35 meters in a water tank=3.5 kg/cm^2 = 2.58*10^3 mmHg\n",
+ "\n",
+ "(b)\n",
"Absolute Pressure= 4.53 kg/cm^2 Abs = 3.34*10^3 mmHg Abs"
]
}
- ],
+ ],
"prompt_number": 2
- },
+ },
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h3>Example 2.3, Page Number:116<h3>"
]
- },
+ },
{
- "cell_type": "code",
- "collapsed": false,
+ "cell_type": "code",
+ "collapsed": false,
"input": [
- "''' Gauge and absolute pressure'''",
- "",
- "#varible declaration",
- "egp=260.0 # equivalent gauge pressure",
- "",
- "#calculation",
- "abspress=760.0-egp",
- "",
- "#result",
+ "\n",
+ "\n",
+ "#varible declaration\n",
+ "egp=260.0 # equivalent gauge pressure\n",
+ "\n",
+ "#calculation\n",
+ "abspress=760.0-egp\n",
+ "\n",
+ "#result\n",
"print('Absolute Presssure = %d mmHg' %abspress)"
- ],
- "language": "python",
+ ],
+ "language": "python",
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
- "stream": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
"text": [
"Absolute Presssure = 500 mmHg"
]
}
- ],
+ ],
"prompt_number": 3
- },
+ },
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h3>Example 2.4,Page Number:117<h3>"
]
- },
+ },
{
- "cell_type": "code",
- "collapsed": false,
+ "cell_type": "code",
+ "collapsed": false,
"input": [
- "'''pressure measurement using U tube manometer'''",
- "",
- "#(a)",
- "",
- "#variable declaration",
- "p_diff=500.0 #pressure difference in mmHg",
- "",
- "#calculations",
- "pdiff=p_diff*13.546/10000",
- "",
- "#Result",
- "print('(a)\\np1-p2 = %.3f kg/cm^2' %pdiff)",
- "",
- "",
- "#(b)",
- "",
- "#variable declaration",
- "p1=6770.0 # Gauge pressure in mmWG",
- "p_atm=10300.0 # atmospheric pressure ",
- "",
- "#calculation",
- "abs_p1=p1+p_atm",
- "",
- "#result",
- "print('\\n(b)If p2 is open to atmosphere:\\nAbsolute Pressure P1 = %d mmWG abs.' %abs_p1)",
- "",
- "#(c)",
- "",
- "#variable declaration",
- "P1=500.0 #mmHg absolute pressure",
- "",
- "#calculations",
- "P1_gauge=P1-760.0",
- "",
- "#result",
+ "\n",
+ "\n",
+ "#(a)\n",
+ "\n",
+ "#variable declaration\n",
+ "p_diff=500.0 #pressure difference in mmHg\n",
+ "\n",
+ "#calculations\n",
+ "pdiff=p_diff*13.546/10000\n",
+ "\n",
+ "#Result\n",
+ "print('(a)\\np1-p2 = %.3f kg/cm^2' %pdiff)\n",
+ "\n",
+ "\n",
+ "#(b)\n",
+ "\n",
+ "#variable declaration\n",
+ "p1=6770.0 # Gauge pressure in mmWG\n",
+ "p_atm=10300.0 # atmospheric pressure \n",
+ "\n",
+ "#calculation\n",
+ "abs_p1=p1+p_atm\n",
+ "\n",
+ "#result\n",
+ "print('\\n(b)If p2 is open to atmosphere:\\nAbsolute Pressure P1 = %d mmWG abs.' %abs_p1)\n",
+ "\n",
+ "#(c)\n",
+ "\n",
+ "#variable declaration\n",
+ "P1=500.0 #mmHg absolute pressure\n",
+ "\n",
+ "#calculations\n",
+ "P1_gauge=P1-760.0\n",
+ "\n",
+ "#result\n",
"print('\\n(c)If p2 is evacuated and sealed:\\np1= %d mmHg gauge Pressure' %P1_gauge)"
- ],
- "language": "python",
+ ],
+ "language": "python",
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
- "stream": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
"text": [
- "(a)",
- "p1-p2 = 0.677 kg/cm^2",
- "",
- "(b)If p2 is open to atmosphere:",
- "Absolute Pressure P1 = 17070 mmWG abs.",
- "",
- "(c)If p2 is evacuated and sealed:",
+ "(a)\n",
+ "p1-p2 = 0.677 kg/cm^2\n",
+ "\n",
+ "(b)If p2 is open to atmosphere:\n",
+ "Absolute Pressure P1 = 17070 mmWG abs.\n",
+ "\n",
+ "(c)If p2 is evacuated and sealed:\n",
"p1= -260 mmHg gauge Pressure"
]
}
- ],
+ ],
"prompt_number": 4
- },
+ },
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h3>Example 2.5, Page Number: 117<h3>"
]
- },
+ },
{
- "cell_type": "code",
- "collapsed": false,
+ "cell_type": "code",
+ "collapsed": false,
"input": [
- "'''Specific Gravity and weight density'''",
- "",
- "#variable declaration",
- "spe_grav_water=1.0 # specific gravity of water",
- "",
- "#calculation",
- "spe_grav_X=spe_grav_water*100.0/50.0",
- "wt_dens_water=1000.0",
- "wt_dens_X=wt_dens_water*2.0",
- "",
- "#result",
+ "\n",
+ "\n",
+ "#variable declaration\n",
+ "spe_grav_water=1.0 # specific gravity of water\n",
+ "\n",
+ "#calculation\n",
+ "spe_grav_X=spe_grav_water*100.0/50.0\n",
+ "wt_dens_water=1000.0\n",
+ "wt_dens_X=wt_dens_water*2.0\n",
+ "\n",
+ "#result\n",
"print('Weight Density of X = %d kg/m^3' %wt_dens_X)"
- ],
- "language": "python",
+ ],
+ "language": "python",
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
- "stream": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
"text": [
"Weight Density of X = 2000 kg/m^3"
]
}
- ],
+ ],
"prompt_number": 5
- },
+ },
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h3>Example 2.6, Page Number: 117<h3>"
]
- },
+ },
{
- "cell_type": "code",
- "collapsed": false,
+ "cell_type": "code",
+ "collapsed": false,
"input": [
- "'''water flow rate using mercury manometer'''",
- "",
- "#variable declaration",
- "A=1.0/20.0 # Area ratio",
- "p_diff=1500.0 # pressure difference in mmWG",
- "",
- "#result",
- "print('(a)\\nAs Delta_h=A2/A1*h << h and normally negligible for well type manometer')",
- "print('hence, p1-p2 = h = %d =111 mmHg' %p_diff)",
- "print('\\n(b)\\nh measured above the oriinal reference will be half of H, i.e. 111/2=55.5 mmHg')",
+ "\n",
+ "\n",
+ "#variable declaration\n",
+ "A=1.0/20.0 # Area ratio\n",
+ "p_diff=1500.0 # pressure difference in mmWG\n",
+ "\n",
+ "#result\n",
+ "print('(a)\\nAs Delta_h=A2/A1*h << h and normally negligible for well type manometer')\n",
+ "print('hence, p1-p2 = h = %d =111 mmHg' %p_diff)\n",
+ "print('\\n(b)\\nh measured above the oriinal reference will be half of H, i.e. 111/2=55.5 mmHg')\n",
"print('(Since area of both legs are same)')"
- ],
- "language": "python",
+ ],
+ "language": "python",
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
- "stream": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
"text": [
- "(a)",
- "As Delta_h=A2/A1*h << h and normally negligible for well type manometer",
- "hence, p1-p2 = h = 1500 =111 mmHg",
- "",
- "(b)",
- "h measured above the oriinal reference will be half of H, i.e. 111/2=55.5 mmHg",
+ "(a)\n",
+ "As Delta_h=A2/A1*h << h and normally negligible for well type manometer\n",
+ "hence, p1-p2 = h = 1500 =111 mmHg\n",
+ "\n",
+ "(b)\n",
+ "h measured above the oriinal reference will be half of H, i.e. 111/2=55.5 mmHg\n",
"(Since area of both legs are same)"
]
}
- ],
+ ],
"prompt_number": 6
- },
+ },
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h3>Example 2.7, Page Number: 119<h3>"
]
- },
+ },
{
- "cell_type": "code",
- "collapsed": false,
+ "cell_type": "code",
+ "collapsed": false,
"input": [
- "'''readings and errors in Bourdon gauge reading'''",
- "",
- "print('1 kg/cm^2 = 10 mWG\\n')",
- "",
- "#(a)",
- "",
- "#variable declaration",
- "press=10+2 #pressure read by the gauge",
- "",
- "#result",
- "print('\\n(a)Bourdon Gauge is mounted 20 meters below water line:')",
- "print('\\nPressure read by the Gauge = %d kg/cm^2'%press)",
- "",
- "",
- "#(b)",
- "",
- "#variable declaration",
- "press2=10-3 #pressure read by the gauge",
- "",
- "#result",
- "print('\\n\\n(b)Bourdon Gauge is located 30 meters above the water line:')",
+ "\n",
+ "\n",
+ "print('1 kg/cm^2 = 10 mWG\\n')\n",
+ "\n",
+ "#(a)\n",
+ "\n",
+ "#variable declaration\n",
+ "press=10+2 #pressure read by the gauge\n",
+ "\n",
+ "#result\n",
+ "print('\\n(a)Bourdon Gauge is mounted 20 meters below water line:')\n",
+ "print('\\nPressure read by the Gauge = %d kg/cm^2'%press)\n",
+ "\n",
+ "\n",
+ "#(b)\n",
+ "\n",
+ "#variable declaration\n",
+ "press2=10-3 #pressure read by the gauge\n",
+ "\n",
+ "#result\n",
+ "print('\\n\\n(b)Bourdon Gauge is located 30 meters above the water line:')\n",
"print('\\nPressure read by the Gauge = %d kg/cm^2'%press2)"
- ],
- "language": "python",
+ ],
+ "language": "python",
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
- "stream": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
"text": [
- "1 kg/cm^2 = 10 mWG",
- "",
- "",
- "(a)Bourdon Gauge is mounted 20 meters below water line:",
- "",
- "Pressure read by the Gauge = 12 kg/cm^2",
- "",
- "",
- "(b)Bourdon Gauge is located 30 meters above the water line:",
- "",
+ "1 kg/cm^2 = 10 mWG\n",
+ "\n",
+ "\n",
+ "(a)Bourdon Gauge is mounted 20 meters below water line:\n",
+ "\n",
+ "Pressure read by the Gauge = 12 kg/cm^2\n",
+ "\n",
+ "\n",
+ "(b)Bourdon Gauge is located 30 meters above the water line:\n",
+ "\n",
"Pressure read by the Gauge = 7 kg/cm^2"
]
}
- ],
+ ],
"prompt_number": 7
- },
+ },
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h3>Example 2.8, Page Number: 120<h3>"
]
- },
+ },
{
- "cell_type": "code",
- "collapsed": false,
+ "cell_type": "code",
+ "collapsed": false,
"input": [
- "'''Specific Gravity and density of liquid'''",
- "",
- "#Variable declaration",
- "dens_water=1000.0 # water Density",
- "h1=125.0 # height1 mm",
- "h2=250.0 # height2 mm",
- "d2=h1*dens_water/h2",
- "",
- "#result",
- "",
- "#a",
- "print('(a)\\nDensity of Liquid = %d kg/m^3' %d2)",
- "print('\\nSpecific Density of the liquid = %.1f' %(h1/h2))",
- "",
- "#(b)",
- "print('\\n\\n(b)\\nIf Values of water and liquid interchanged:\\n')",
- "d3=h2*dens_water/h1",
- "print('\\nDensity of Liquid = %d kg/m^3' %d3)",
+ "\n",
+ "\n",
+ "#Variable declaration\n",
+ "dens_water=1000.0 # water Density\n",
+ "h1=125.0 # height1 mm\n",
+ "h2=250.0 # height2 mm\n",
+ "d2=h1*dens_water/h2\n",
+ "\n",
+ "#result\n",
+ "\n",
+ "#a\n",
+ "print('(a)\\nDensity of Liquid = %d kg/m^3' %d2)\n",
+ "print('\\nSpecific Density of the liquid = %.1f' %(h1/h2))\n",
+ "\n",
+ "#(b)\n",
+ "print('\\n\\n(b)\\nIf Values of water and liquid interchanged:\\n')\n",
+ "d3=h2*dens_water/h1\n",
+ "print('\\nDensity of Liquid = %d kg/m^3' %d3)\n",
"print('\\nSpecific Density of the liquid = %.1f' %(h2/h1))"
- ],
- "language": "python",
+ ],
+ "language": "python",
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
- "stream": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
"text": [
- "(a)",
- "Density of Liquid = 500 kg/m^3",
- "",
- "Specific Density of the liquid = 0.5",
- "",
- "",
- "(b)",
- "If Values of water and liquid interchanged:",
- "",
- "",
- "Density of Liquid = 2000 kg/m^3",
- "",
+ "(a)\n",
+ "Density of Liquid = 500 kg/m^3\n",
+ "\n",
+ "Specific Density of the liquid = 0.5\n",
+ "\n",
+ "\n",
+ "(b)\n",
+ "If Values of water and liquid interchanged:\n",
+ "\n",
+ "\n",
+ "Density of Liquid = 2000 kg/m^3\n",
+ "\n",
"Specific Density of the liquid = 2.0"
]
}
- ],
+ ],
"prompt_number": 8
- },
+ },
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h3>Example 2.9, Page Number: 120<h3>"
]
- },
+ },
{
- "cell_type": "code",
- "collapsed": false,
+ "cell_type": "code",
+ "collapsed": false,
"input": [
- "'''strain gauge wire length and cross section area'''",
- "",
- "import math",
- "#variable Declaration",
- "R=120.0 #resistance",
- "l=122.0 #length",
- "a=0.1 #area",
- "R1=140.0 #resistance in ohm",
- "",
- "#calculation",
- "rho=R*a/l",
- "l1=math.sqrt(R1*a*l/rho)",
- "l1=round(l1,0)",
- "",
- "#Result",
- "print('Length l1 = %d meters' %l1)",
- "A1=a*l/l1",
+ "\n",
+ "\n",
+ "import math\n",
+ "#variable Declaration\n",
+ "R=120.0 #resistance\n",
+ "l=122.0 #length\n",
+ "a=0.1 #area\n",
+ "R1=140.0 #resistance in ohm\n",
+ "\n",
+ "#calculation\n",
+ "rho=R*a/l\n",
+ "l1=math.sqrt(R1*a*l/rho)\n",
+ "l1=round(l1,0)\n",
+ "\n",
+ "#Result\n",
+ "print('Length l1 = %d meters' %l1)\n",
+ "A1=a*l/l1\n",
"print('\\nArea A1 = %.4f mm^2' %A1)"
- ],
- "language": "python",
+ ],
+ "language": "python",
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
- "stream": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
"text": [
- "Length l1 = 132 meters",
- "",
+ "Length l1 = 132 meters\n",
+ "\n",
"Area A1 = 0.0924 mm^2"
]
}
- ],
+ ],
"prompt_number": 1
- },
+ },
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h3>Example 2.10, Page Number: 121<h3>"
]
- },
+ },
{
- "cell_type": "code",
- "collapsed": false,
+ "cell_type": "code",
+ "collapsed": false,
"input": [
- "'''Capacitance calculation for variable dielectric'''",
- "",
- "c=0.57 #Constant",
- "",
- "#(a)",
- "",
- "#variable declaration",
- "d=0.1 #distance between plates",
- "di1=100.0 #Dielectric constant",
- "di2=1000.0 #Dielectric constant",
- "",
- "#calculation",
- "c1=c*di1*10.0/d",
- "c1=round(c1,0)",
- "",
- "#result",
- "print('(a)\\nC1=%d pf' %c1)",
- "",
- "",
- "#(b)",
- "",
- "#calculation",
- "c2=c*di2*10/d",
- "",
- "#result",
- "print('\\n(b)\\nC2=%d pf' %c2)",
- "",
- "",
- "#(c)",
- "",
- "#calculation",
- "ds=0.09",
- "c11=c*di1*10/ds",
- "c12=c*di2*10/ds",
- "",
- "#result",
+ "\n",
+ "\n",
+ "c=0.57 #Constant\n",
+ "\n",
+ "#(a)\n",
+ "\n",
+ "#variable declaration\n",
+ "d=0.1 #distance between plates\n",
+ "di1=100.0 #Dielectric constant\n",
+ "di2=1000.0 #Dielectric constant\n",
+ "\n",
+ "#calculation\n",
+ "c1=c*di1*10.0/d\n",
+ "c1=round(c1,0)\n",
+ "\n",
+ "#result\n",
+ "print('(a)\\nC1=%d pf' %c1)\n",
+ "\n",
+ "\n",
+ "#(b)\n",
+ "\n",
+ "#calculation\n",
+ "c2=c*di2*10/d\n",
+ "\n",
+ "#result\n",
+ "print('\\n(b)\\nC2=%d pf' %c2)\n",
+ "\n",
+ "\n",
+ "#(c)\n",
+ "\n",
+ "#calculation\n",
+ "ds=0.09\n",
+ "c11=c*di1*10/ds\n",
+ "c12=c*di2*10/ds\n",
+ "\n",
+ "#result\n",
"print('\\n(c)\\nC1 = %.1f pf\\nC2 = %d pf'%(c11,c12))"
- ],
- "language": "python",
+ ],
+ "language": "python",
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
- "stream": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
"text": [
- "(a)",
- "C1=5700 pf",
- "",
- "(b)",
- "C2=57000 pf",
- "",
- "(c)",
- "C1 = 6333.3 pf",
+ "(a)\n",
+ "C1=5700 pf\n",
+ "\n",
+ "(b)\n",
+ "C2=57000 pf\n",
+ "\n",
+ "(c)\n",
+ "C1 = 6333.3 pf\n",
"C2 = 63333 pf"
]
}
- ],
+ ],
"prompt_number": 10
- },
+ },
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h3>Example 2.11, Page Number: 121<h3>"
]
- },
+ },
{
- "cell_type": "code",
- "collapsed": false,
+ "cell_type": "code",
+ "collapsed": false,
"input": [
- "'''pressure gauge caliberation'''",
- "",
- "#variable Declaration",
- "A=1.0 #area",
- "p1=10.0 #pressure",
- "",
- "#calculation",
- "W1=A*p1",
- "",
- "#Result",
- "print('W1 = %d kg' %W1)",
+ "\n",
+ "\n",
+ "#variable Declaration\n",
+ "A=1.0 #area\n",
+ "p1=10.0 #pressure\n",
+ "\n",
+ "#calculation\n",
+ "W1=A*p1\n",
+ "\n",
+ "#Result\n",
+ "print('W1 = %d kg' %W1)\n",
"print('\\nWith the 4 standard weights of 10kg, 20kg, 30kg and 40kg')"
- ],
- "language": "python",
+ ],
+ "language": "python",
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
- "stream": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
"text": [
- "W1 = 10 kg",
- "",
+ "W1 = 10 kg\n",
+ "\n",
"With the 4 standard weights of 10kg, 20kg, 30kg and 40kg"
]
}
- ],
+ ],
"prompt_number": 11
- },
+ },
{
- "cell_type": "markdown",
+ "cell_type": "markdown",
+ "metadata": {},
"source": [
"<h3>Example 2.12, Page Number: 122<h3>"
]
- },
+ },
{
- "cell_type": "code",
- "collapsed": false,
+ "cell_type": "code",
+ "collapsed": false,
"input": [
- "'''pressure calculation using McLeod gauge'''",
- "",
- "#varable declaration",
- "p1=10**-2 #pressure in torr",
- "h1=20.0 #height in mm",
- "",
- "#xalculation",
- "K=p1/h1**2",
- "p2=K*30**2",
- "p2=p2*100.0",
- "",
- "#Result",
+ "\n",
+ "#varable declaration\n",
+ "p1=10**-2 #pressure in torr\n",
+ "h1=20.0 #height in mm\n",
+ "\n",
+ "#xalculation\n",
+ "K=p1/h1**2\n",
+ "p2=K*30**2\n",
+ "p2=p2*100.0\n",
+ "\n",
+ "#Result\n",
"print('The unknown pressure p2 = %.2f * 10^-2 torr' %p2)"
- ],
- "language": "python",
+ ],
+ "language": "python",
+ "metadata": {},
"outputs": [
{
- "output_type": "stream",
- "stream": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
"text": [
"The unknown pressure p2 = 2.25 * 10^-2 torr"
]
}
- ],
+ ],
"prompt_number": 12
}
- ]
+ ],
+ "metadata": {}
}
]
} \ No newline at end of file