{
 "metadata": {
  "name": "",
  "signature": "sha256:46e11d2b698bb6c17676ac4d8f4b47c17c969239bd247f6b7afc4dd1f114f6f4"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 10 : Method of virtual work"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 10.3  Page No : 501"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Given Data\n",
      "m = 1000.;\t\t\t#kg, mass of krate\n",
      "theta = 60.;\t\t\t#degree\n",
      "theta = theta*math.pi/180;\t\t\t#radians, conversion into rad\n",
      "a = 0.70;\t\t\t#m\n",
      "L = 3.20;\t\t\t#m\n",
      "g = 9.81;\t\t\t#m/s**2\n",
      "\n",
      "# Calculations\n",
      "#From theory we get\n",
      "W = m*g;\t\t\t#N, Weight\n",
      "W = W/1000;\t\t\t#kN, conversion into kN\n",
      "S = math.sqrt(a**2+L**2-2*a*L*math.cos(theta));\t\t\t#m\n",
      "F_DH = W*S/L/math.tan(theta);\t\t\t#kN\n",
      "\n",
      "# Results\n",
      "print \"Force exerted by each cylinder is F_DH = %.2f kN\"%(F_DH);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Force exerted by each cylinder is F_DH = 5.16 kN\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 10.4  Page No : 503"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from numpy import arange\n",
      "\n",
      "# Given Data\n",
      "m = 10.;\t\t\t#kg, mass of rim\n",
      "r = 300.;\t\t\t#mm, radius of disk\n",
      "a = 0.08;\t\t\t#m\n",
      "b = 0.3;\t\t\t#m\n",
      "k = 4.;\t\t\t#kN/m\n",
      "g = 9.81;\t\t\t#m/s**2  gravity\n",
      "\n",
      "#From theory we get\n",
      "\n",
      "# Calculations and Results\n",
      "#math.sin(theta) = k*a**2/m/g/b*theta\n",
      "dif = 1.;\n",
      "for theta in arange(0,1+0.001,.001):\n",
      "    dif = math.sin(math.radians(theta))-k*a**2/m/g/b*theta;\n",
      "    if dif <= 0.001:\n",
      "        print \"theta =  %.3f rad or %.1f degrees\"%(theta,theta/math.pi*180);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "theta =  0.000 rad or 0.0 degrees\n",
        "theta =  0.001 rad or 0.1 degrees\n",
        "theta =  0.002 rad or 0.1 degrees\n",
        "theta =  0.003 rad or 0.2 degrees\n",
        "theta =  0.004 rad or 0.2 degrees\n",
        "theta =  0.005 rad or 0.3 degrees\n",
        "theta =  0.006 rad or 0.3 degrees\n",
        "theta =  0.007 rad or 0.4 degrees\n",
        "theta =  0.008 rad or 0.5 degrees\n",
        "theta =  0.009 rad or 0.5 degrees\n",
        "theta =  0.010 rad or 0.6 degrees\n",
        "theta =  0.011 rad or 0.6 degrees\n",
        "theta =  0.012 rad or 0.7 degrees\n",
        "theta =  0.013 rad or 0.7 degrees\n",
        "theta =  0.014 rad or 0.8 degrees\n",
        "theta =  0.015 rad or 0.9 degrees\n",
        "theta =  0.016 rad or 0.9 degrees\n",
        "theta =  0.017 rad or 1.0 degrees\n",
        "theta =  0.018 rad or 1.0 degrees\n",
        "theta =  0.019 rad or 1.1 degrees\n",
        "theta =  0.020 rad or 1.1 degrees\n",
        "theta =  0.021 rad or 1.2 degrees\n",
        "theta =  0.022 rad or 1.3 degrees\n",
        "theta =  0.023 rad or 1.3 degrees\n",
        "theta =  0.024 rad or 1.4 degrees\n",
        "theta =  0.025 rad or 1.4 degrees\n",
        "theta =  0.026 rad or 1.5 degrees\n",
        "theta =  0.027 rad or 1.5 degrees\n",
        "theta =  0.028 rad or 1.6 degrees\n",
        "theta =  0.029 rad or 1.7 degrees\n",
        "theta =  0.030 rad or 1.7 degrees\n",
        "theta =  0.031 rad or 1.8 degrees\n",
        "theta =  0.032 rad or 1.8 degrees\n",
        "theta =  0.033 rad or 1.9 degrees\n",
        "theta =  0.034 rad or 1.9 degrees\n",
        "theta =  0.035 rad or 2.0 degrees\n",
        "theta =  0.036 rad or 2.1 degrees\n",
        "theta =  0.037 rad or 2.1 degrees\n",
        "theta =  0.038 rad or 2.2 degrees\n",
        "theta =  0.039 rad or 2.2 degrees\n",
        "theta =  0.040 rad or 2.3 degrees\n",
        "theta =  0.041 rad or 2.3 degrees\n",
        "theta =  0.042 rad or 2.4 degrees\n",
        "theta =  0.043 rad or 2.5 degrees\n",
        "theta =  0.044 rad or 2.5 degrees\n",
        "theta =  0.045 rad or 2.6 degrees\n",
        "theta =  0.046 rad or 2.6 degrees\n",
        "theta =  0.047 rad or 2.7 degrees\n",
        "theta =  0.048 rad or 2.8 degrees\n",
        "theta =  0.049 rad or 2.8 degrees\n",
        "theta =  0.050 rad or 2.9 degrees\n",
        "theta =  0.051 rad or 2.9 degrees\n",
        "theta =  0.052 rad or 3.0 degrees\n",
        "theta =  0.053 rad or 3.0 degrees\n",
        "theta =  0.054 rad or 3.1 degrees\n",
        "theta =  0.055 rad or 3.2 degrees\n",
        "theta =  0.056 rad or 3.2 degrees\n",
        "theta =  0.057 rad or 3.3 degrees\n",
        "theta =  0.058 rad or 3.3 degrees\n",
        "theta =  0.059 rad or 3.4 degrees\n",
        "theta =  0.060 rad or 3.4 degrees\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}