{
 "metadata": {
  "name": "chapter3.ipynb"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3 : Parallel Forces In A Plane"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3-1,Page No:64"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of variables\n",
      "\n",
      "W=1000 #N\n",
      "Lab=1 #m\n",
      "Lac=0.6 #m\n",
      "theta=60 #degree #angle made by the beam with the horizontal\n",
      "\n",
      "#Calculations\n",
      "\n",
      "Q=(W*Lac*cos(theta*(pi/180)))/(Lab*cos(theta*(pi/180))) #N # from eq'n 2\n",
      "P=W-Q #N # from eq'n 1\n",
      "\n",
      "#Results\n",
      "\n",
      "print\"The load taken by man P is \",round(P),\"N\"\n",
      "print\"The load taken by man Q is \",round(Q),\"N\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The load taken by man P is  400.0 N\n",
        "The load taken by man Q is  600.0 N\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3-2,Page No:64"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of variables\n",
      "\n",
      "F=1000 #N\n",
      "Lab=1 #m\n",
      "Lbc=0.25 #m\n",
      "Lac=1.25 #m\n",
      "\n",
      "#Calculations\n",
      "\n",
      "Rb=(F*Lac)/Lab #N # from eq'n 2\n",
      "Ra=Rb-F #N # fom eq'n 1\n",
      "\n",
      "#Results\n",
      "\n",
      "print\"The reaction (downwards)at support A is \",round(Ra),\"N\"\n",
      "print\"The reaction (upwards)at support B is \",round(Rb),\"N\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The reaction (downwards)at support A is  250.0 N\n",
        "The reaction (upwards)at support B is  1250.0 N\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3-3,Page No:65"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Inilitization of variables\n",
      "\n",
      "Lab=12 #m\n",
      "Mc=40 #kN-m \n",
      "Md=10 #kN-m\n",
      "Me=20 #kN-m\n",
      "Fe=20 #kN #force acting at point E\n",
      "\n",
      "#Calculations\n",
      "\n",
      "Xa=-(Fe) #kN #take sum Fx=0\n",
      "a=Me+Md-Mc #N #take moment at A\n",
      "Rb=a*(Lab)**-1\n",
      "Ya=-Rb #N #take sum Fy=0\n",
      "\n",
      "#Results\n",
      "\n",
      "print\"The vertical reaction (upwards) at A is \",round(Ya,3),\"kN\"\n",
      "print\"The horizontal reaction (towards A) is \",round(Xa,2),\"kN\"\n",
      "print\"The reaction (downwards) at B is \",round(Rb,3),\"kN\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The vertical reaction (upwards) at A is  0.833 kN\n",
        "The horizontal reaction (towards A) is  -20.0 kN\n",
        "The reaction (downwards) at B is  -0.833 kN\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3-5,Page No:66"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "import numpy as np\n",
      "\n",
      "#Initilization of variables\n",
      "\n",
      "W=1000 #N\n",
      "Lad=7.5 #m\n",
      "Lae=1.5 #m\n",
      "La1=3.75 #m #distance of 1st 1000N load from pt A\n",
      "La2=5 #m #distance of 2nd 1000N load from pt A\n",
      "La3=6 #m # distance of 3rd 1000N load from pt A\n",
      "\n",
      "# Calculations (part1)\n",
      "\n",
      "#using matrix to solve the given eqn's 1 & 2\n",
      "\n",
      "A=np.array([[1 ,-2.5],[3.5 ,-5]])\n",
      "B=np.array([1000,7250])\n",
      "C=np.linalg.solve(A,B)\n",
      "\n",
      "#Resuts\n",
      "\n",
      "print\"The reaction at F i.e Rf is \",round(C[0]),\"N\"\n",
      "print\"The reaction at D i.e Rd is \",round(C[1]),\"N\"\n",
      "\n",
      "#Calculations (part 2)\n",
      "#Consider combined F.B.D of beams AB,BC &CD. Take moment at A\n",
      "\n",
      "Re=((W*La1)+(W*La2)+(W*La3)+(C[1]*Lad)-(C[0]*La3))/Lae #N\n",
      "Ra=C[1]-Re-C[0]+(3*W) #N #Taking sum of forces in Y direction\n",
      "\n",
      "#Results\n",
      "\n",
      "print\"The reaction at pt E i.e Re is \",round(Re),\"N\"\n",
      "print\"The reaction at pt A i.e Ra is \",round(Ra),\"N\" #acting vertically downwards"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The reaction at F i.e Rf is  3500.0 N\n",
        "The reaction at D i.e Rd is  1000.0 N\n",
        "The reaction at pt E i.e Re is  833.0 N\n",
        "The reaction at pt A i.e Ra is  -333.0 N\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3-7,Page No:69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of variables\n",
      "\n",
      "Ws=2 #kN #weight of scooter\n",
      "Wd=0.5 #kN #weight of driver\n",
      "Lab=1 #m\n",
      "Led=0.8 #m\n",
      "Leg=0.1 #m\n",
      "\n",
      "#Calculations\n",
      "\n",
      "Rc=((2*Leg)+(Wd*Led))/Lab #kN #take moment at E\n",
      "Ra=(2+Wd-Rc)/2 #kN # as Ra=Rb,(Ra+Rb=2*Ra)\n",
      "Rb=Ra # kN\n",
      "\n",
      "#Results\n",
      "\n",
      "print\"The reaction at wheel A is \",round(Ra,2),\"kN\"\n",
      "print\"The reaction at wheel B is \",round(Rb,2),\"kN\"\n",
      "print\"The reaction at wheel C is \",round(Rc,2),\"kN\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The reaction at wheel A is  0.95 kN\n",
        "The reaction at wheel B is  0.95 kN\n",
        "The reaction at wheel C is  0.6 kN\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3-8,Page No:69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of variables\n",
      "\n",
      "W1=15 #N #up\n",
      "W2=60 #N #down\n",
      "W3=10 #N #up\n",
      "W4=25 #N #down\n",
      "Lab=1.2 #m\n",
      "Lac=0.4 #m\n",
      "Lcd=0.3 #m\n",
      "Ldb=0.5 #m\n",
      "Lad=0.7 #m\n",
      "Leb=0.417 #m #Leb=Lab-x\n",
      "\n",
      "#Calculations\n",
      "\n",
      "#(a) A single force\n",
      "\n",
      "Ry=W1-W2+W3-W4 #N #take sum Fy=0\n",
      "x=((-W2*Lac)+(W3*Lad)-(W4*Lab))/(Ry) #m\n",
      "\n",
      "#(b) Single force moment at A\n",
      "\n",
      "Ma=(Ry*x) #N-m\n",
      "\n",
      "# Single force moment at B\n",
      "\n",
      "Mb=W2*Leb #N-m\n",
      "\n",
      "#Results\n",
      "\n",
      "print\"The reaction for single force (a) is \",round(Ry,2),\"N\"\n",
      "print\"The distance of Ry from A is \",round(x,3),\"m\"\n",
      "print\"The moment at A is \",round(Ma,2),\"N-m\"\n",
      "print\"The moment at B is \",round(Mb,2),\"N-m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The reaction for single force (a) is  -60.0 N\n",
        "The distance of Ry from A is  0.783 m\n",
        "The moment at A is  -47.0 N-m\n",
        "The moment at B is  25.02 N-m\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3-9,Page No:71"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "import numpy as np\n",
      "\n",
      "#Initilization of variables\n",
      "\n",
      "Ra=5000 #N\n",
      "Ma=10000 #Nm\n",
      "alpha=60 #degree #angle made by T1 with the pole\n",
      "beta=45 #degree #angle made by T2 with the pole\n",
      "theta=30 #degree #angle made by T3 with the pole\n",
      "Lab=6 #m\n",
      "Lac=1.5 #m\n",
      "Lcb=4.5 #m\n",
      "\n",
      "#Calculations\n",
      "\n",
      "T3=Ma/(4.5*sin(theta*(pi/180))) #N #take moment at B\n",
      "\n",
      "# Now we use matrix to solve eqn's 1 & 2 simultaneously,\n",
      "\n",
      "A=np.array([[-0.707, 0.866],[0.707, 0.5]])\n",
      "B=np.array([2222.2,8848.8])\n",
      "C=np.linalg.solve(A,B)\n",
      "\n",
      "#Results\n",
      "\n",
      "print\"Tension in wire 1 i.e T1 is \",round(C[1],1),\"N\" #answer may vary due to decimal variance\n",
      "print\"Tension in wire 2 i.e T2 is \",round(C[0],1),\"N\"\n",
      "print\"Tension in wire 3 i.e T3 is \",round(T3,1),\"N\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Tension in wire 1 i.e T1 is  8104.7 N\n",
        "Tension in wire 2 i.e T2 is  6784.2 N\n",
        "Tension in wire 3 i.e T3 is  4444.4 N\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3-10,Page No:76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of variables\n",
      "\n",
      "w=2000 #N/m\n",
      "Lab=3 #m\n",
      "\n",
      "#Calculations\n",
      "\n",
      "W=w*Lab/2 #N# Area under the curve\n",
      "Lac=(0.6666)*Lab #m#centroid of the triangular load system\n",
      "Rb=(W*Lac)/Lab #N #sum of moment at A\n",
      "Ra=W-Rb #N\n",
      "\n",
      "#Results\n",
      "\n",
      "print\"The resultant of the distibuted load lies at \",round(Lac),\"m\"\n",
      "print\"The reaction at support A is \",round(Ra),\"N\"\n",
      "print\"The reaction at support B is \",round(Rb),\"N\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The resultant of the distibuted load lies at  2.0 m\n",
        "The reaction at support A is  1000.0 N\n",
        "The reaction at support B is  2000.0 N\n"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3-12,Page No:78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initilization of variables\n",
      "\n",
      "w1=1.5 #kN/m # intensity of varying load at the starting point of the beam\n",
      "w2=4.5 #kN/m # intensity of varying load at the end of the beam\n",
      "l=6 #m # ength of the beam\n",
      "\n",
      "# Calculations\n",
      "\n",
      "# The varying load distribution is divided into a rectangle and a right angled triangle\n",
      "\n",
      "W1=w1*l #kN # where W1 is the area of the load diagram(rectangle ABED)\n",
      "x1=l/2 #m # centroid of the rectangular load system\n",
      "W2=(w2-w1)*l/2 #kN # where W1 is the area of the load diagram(triangle DCE)\n",
      "x2=2*l/3 #m # centroid of the triangular load system\n",
      "W=W1+W2 #kN # W is the resultant\n",
      "x=((W1*x1)+(W2*x2))/W #m # where x is the distance where the resultant lies\n",
      "\n",
      "#Results\n",
      "\n",
      "print\"The resultant of the distributed load system is \",round(W),\"kN\"\n",
      "print\"The line of action of the resulting load is \",round(x,1),\"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The resultant of the distributed load system is  18.0 kN\n",
        "The line of action of the resulting load is  3.5 m\n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3-13,Page No:78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initiization of variables\n",
      "\n",
      "W1=10 #kN #point load acting at D\n",
      "W2=20 #kN # point load acting at C at an angle of 30 degree\n",
      "W3=5 #kN/m # intensity of udl acting on span EB of 4m\n",
      "W4=10 #kN/m # intensity of varying load acting on span BC of 3m\n",
      "M=25 #kN-m # moment acting at E\n",
      "theta=30 #degree # angle made by 20 kN load with the beam\n",
      "Lad=2 #m\n",
      "Leb=4 #m\n",
      "Laf=6 #m #distance between the resultant of W3 & point A\n",
      "Lac=11 #m\n",
      "Lag=9 #m #distance between the resultant of W4 and point A\n",
      "Lbc=3 #m\n",
      "Lab=8 #m\n",
      "\n",
      "# Calculations\n",
      "\n",
      "Xa=20*cos(theta*(pi/180)) #kN # sum Fx=0\n",
      "Rb=((W1*Lad)+(-M)+(W3*Leb*Laf)+(W2*sin(theta*(pi/180))*Lac)+((W4*Lbc*Lag)/2))/Lab #kN # taking moment at A\n",
      "Ya=W1+(W2*sin(theta*(pi/180)))+(W3*Leb)+(W4*Lbc/2)-Rb #kN # sum Fy=0\n",
      "Ra=(Xa**2+Ya**2)**0.5 #kN # resultant at A\n",
      "\n",
      "#Results\n",
      "\n",
      "print\"The horizontal reaction at A i.e Xa is \",round(Xa,2),\"kN\"\n",
      "print\"The vertical reaction at A i.e Ya is \",round(Ya),\"kN\"\n",
      "print\"The reaction at A i.e Ra is \",round(Ra),\"kN\"\n",
      "print\"The reaction at B i.e Rb is \",round(Rb),\"kN\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The horizontal reaction at A i.e Xa is  17.32 kN\n",
        "The vertical reaction at A i.e Ya is  10.0 kN\n",
        "The reaction at A i.e Ra is  20.0 kN\n",
        "The reaction at B i.e Rb is  45.0 kN\n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3-14,Page No:79"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initilization of variables\n",
      "\n",
      "h=4 #m #height of the dam wall\n",
      "rho_w=1000 # kg/m^3 # density of water\n",
      "rho_c=2400 # kg/m^3 # density of concrete\n",
      "g=9.81 # m/s^2\n",
      "\n",
      "# Calculations\n",
      "\n",
      "P=(rho_w*g*h**2)/2 # The resultant force due to water pressure per unit length of the dam\n",
      "x=(0.6666)*h #m # distance at which the resutant of the triangular load acts \n",
      "b=((2*P*h)/(3*h*rho_c*g))**0.5 # m # eq'n required to find the minimum width of the dam\n",
      "\n",
      "# Results\n",
      "\n",
      "print\"The minimum width which is to be provided to the dam to prevent overturning about point B is \",round(b,3),\"m\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The minimum width which is to be provided to the dam to prevent overturning about point B is  1.491 m\n"
       ]
      }
     ],
     "prompt_number": 37
    }
   ],
   "metadata": {}
  }
 ]
}