{
 "metadata": {
  "name": "",
  "signature": "sha256:9895b73315ca7349cd1efdcb61fc34b672306a1fc3e53183d1b5e1b4bb24add0"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2 : Statics of particle"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.1  Page No : 22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Given Data\n",
      "P = 40.; \t\t\t# N   Magnitude of vector P\n",
      "Q = 60. \t\t\t# N Magnitude of vector Q\n",
      "# imagine triangle for triangle law of vectors \n",
      "B = 180.-25;\t\t\t# degree , Angle between vector P and vector Q\n",
      "\n",
      "# Calculations and Results\n",
      "#R- resultant vector\n",
      "B = B*math.pi/180;\t\t\t# conversion into radian\n",
      "#R**2 = P**2+Q**2-2*P*Q*math.cos(B);    Comath.sine Law\n",
      "R = math.sqrt(P**2+Q**2-2*P*Q*math.cos(B));\t\t\t# N\n",
      "\n",
      "print \"Maginitude of resultant is R =  %.2f N\"%(R);\n",
      "\n",
      "#A- Angle between resultant and P vector, Unknown\n",
      "\n",
      "# math.sin(A)/Q  =  =  math.sin(B)/R  math.sine law\n",
      "\n",
      "A = math.asin(Q*math.sin(B)/R);\t\t\t# radian\n",
      "\n",
      "\n",
      "A = A*180/math.pi;\t\t\t#\t\t\t# Conversion into degree\n",
      "\n",
      "alpha = A+20;\t\t\t# degree\n",
      "print \"Angle of resultant  vector R with x axis is %.2f Degrees\"%(alpha);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maginitude of resultant is R =  97.73 N\n",
        "Angle of resultant  vector R with x axis is 35.04 Degrees\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2  Page No : 29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Given Data\n",
      "R = 25.; \t\t\t# kN   Magnitude of resultant vector\n",
      "alpha = 45.;\t\t\t#degree\n",
      "# T1 and T2 are tensions in rope 1 and rope 2 respectively \n",
      "A = 30.;\t\t\t# degree , Angle between vector T1 and resultant\n",
      "B = alpha;\t\t\t# degree , Angle between vector T2 and resultant\n",
      "C = 180.-(A+B);\t\t\t# degree , Angle between vector T1 and T2\n",
      "\n",
      "\n",
      "# Calculations and Results\n",
      "# conversion of angles into radian\n",
      "A = A*math.pi/180;\n",
      "B = B*math.pi/180;\n",
      "C = C*math.pi/180;\n",
      "\n",
      "\n",
      "# math.sin(A)/T2  =  =  math.sin(B)/T1  =  =  math.sin(C)/R .............. math.sine law\n",
      "\n",
      "T1 = (R*math.sin(B))/math.sin(C);\t\t\t#kN\n",
      "T2 = (R*math.sin(A))/math.sin(C);\t\t\t#kN\n",
      "\n",
      "print \"Tension in rope 1 is T1 = %.2f kN and in rope 2 is T2 = %.2f kN \"%(T1,T2);\n",
      "\n",
      "# Minimum value of T2 o# Resultsurs when T1 and T2 are perpendicular to each other i.e C = 90 degree\n",
      "C = 90.;\t\t\t#degree\n",
      "A = 30.;\t\t\t# degree\n",
      "B = 180-(A+C);\t\t\t#degrees\n",
      "alpha = B;\t\t\t#degrees\n",
      "B = B*math.pi/180;\t\t\t# radian\n",
      "T2 = R*math.sin(B);\t\t\t# kN\n",
      "T1 = R*math.cos(B);\t\t\t#kN\n",
      "print \"Minimum tension in rope 2 is T2 = %.2f kN \"%(T2);\n",
      "print \"corrosponding T1 = %.2f kN  \"%(T1);\n",
      "print \"alpha = %.2f degrees\"%(alpha);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Tension in rope 1 is T1 = 18.30 kN and in rope 2 is T2 = 12.94 kN \n",
        "Minimum tension in rope 2 is T2 = 21.65 kN \n",
        "corrosponding T1 = 12.50 kN  \n",
        "alpha = 60.00 degrees\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3  Page No : 31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Given Data\n",
      "F1 = 150.;\t\t\t# N \n",
      "F2 = 80.;\t\t\t# N\n",
      "F3 = 110.;\t\t\t#N\n",
      "F4 = 100.\t\t\t# in N\n",
      "\n",
      "F1x = 129.\t\t\t#in N\n",
      "F2x = -27.4\n",
      "F3x = 0.\n",
      "F4x = 96.6\n",
      "F1y = 75.\n",
      "F2y = 75.2\n",
      "F3y = -110.\n",
      "F4y = -25.9\n",
      "\n",
      "# Calculations and Results\n",
      "Rx = F1x+F2x+F3x+F4x;\t\t\t#N Horizontal component of R- resultant\n",
      "Ry = F1y+F2y+F3y+F4y;\t\t\t#N Vertical component of R- resultant\n",
      "\n",
      "#R = Rx i +Ry j\n",
      "\n",
      "print \"R =  %.2f i + %.2f j \"%( Rx,Ry);\n",
      "\n",
      "alpha = math.atan(Ry/Rx);\t\t\t#Radian, Angle made by resultant with +ve x axis\n",
      "alpha = alpha*180/math.pi;\t\t\t#Conversion into degrees\n",
      "\n",
      "R = math.sqrt(Rx**2+Ry**2);\t\t\t# N , Magnitude of resultant\n",
      "print \"alpha =  %.2f degrees and R =  %.2f N\"%(alpha,R);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R =  198.20 i + 14.30 j \n",
        "alpha =  4.13 degrees and R =  198.72 N\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.4  Page No : 38"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Given Data\n",
      "W = 3500.; \t\t\t# lb   weight of automobile\n",
      "alpha = 2.;\t\t\t#degree\n",
      "# TAB and TAC are tensions in cable AB and cable AC respectively \n",
      "A = 90+30.;\t\t\t# degree , Angle between vector T1 and resultant\n",
      "B = alpha;\t\t\t# degree , Angle between vector T2 and resultant\n",
      "C = 180-(A+B);\t\t\t# degree , Angle between vector T1 and T2\n",
      "\n",
      "# Calculations\n",
      "# conversion of angles into radian\n",
      "A = A*math.pi/180;\n",
      "B = B*math.pi/180;\n",
      "C = C*math.pi/180;\n",
      "\n",
      "# math.sin(A)/TAB  =  =  math.sin(B)/TAC  =  =  math.sin(C)/W .............. math.sine law\n",
      "TAB = (W*math.sin(A))/math.sin(C);\t\t\t#N\n",
      "TAC = (W*math.sin(B))/math.sin(C);\t\t\t#N\n",
      "\n",
      "# Results\n",
      "print \"Tension in cable AB is TAB = %.2f lb and in Cable AC  is TAC = %.2f lb \"%(TAB,TAC);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Tension in cable AB is TAB = 3574.19 lb and in Cable AC  is TAC = 144.03 lb \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.5  Page No : 39"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Given Data\n",
      "mass = 30.;\t\t\t# kg\n",
      "W = mass*9.81;\t\t\t# N, Weight of package\n",
      "alpha = 15.;\t\t\t#degree\n",
      "\n",
      "# Calculations\n",
      "alpha = alpha*math.pi/180;\t\t\t# Conversion into radian\n",
      "F = W*math.sin(alpha);\t\t\t#N\n",
      "\n",
      "# Results\n",
      "print \"F =  %.2f N\"%(F);\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "F =  76.17 N\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.6  Page No : 39"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "alpha = math.atan(7./4);\t\t\t#rad\n",
      "beta = math.atan(1.5/4);\t\t\t#rad\n",
      "T_AB = 200.;\t\t\t#N tension in cable AB\n",
      "T_AE = -300.;\t\t\t#N, tension in cable AE\n",
      "# R =  T_AB+T_AC+T_AE+F_D = 0        ...Equillibrium Condition...........1\n",
      "\n",
      "\n",
      "# Calculations\n",
      "T_ABx = -T_AB*math.sin(alpha);\t\t\t# Xcomponent of T_AB\n",
      "T_ABy = T_AB*math.cos(alpha);\t\t\t#Y component of T_AB\n",
      "\n",
      "# T_ACx = T_AC*math.sin(beta); Xcomponent of T_AC\n",
      "# T_ACy = T_AC*math.cos(beta); Y component of T_AC\n",
      "\n",
      "# Sum Fx  = 0 gives -T_AB*math.sin(alpha) N + T_AC*math.sin(beta) +F_D = 0..........2\n",
      "#Sum Fy = 0 gives T_AB*math.cos(alpha) N +T_AC*math.cos(beta) +T_AE  = 0................3\n",
      "\n",
      "T_AC = (-T_AB*math.cos(alpha)-T_AE)/math.cos(beta);\t\t\t#N, From 3\n",
      "\n",
      "F_D = T_AB*math.sin(alpha)-T_AC*math.sin(beta);\t\t\t#N, From 2\n",
      "\n",
      "# Results\n",
      "print \"Value of drag force is F_D = %.2f N and tension in cable AC is T_AC =  %.2f N\"%(F_D,T_AC);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of drag force is F_D = 98.36 N and tension in cable AC is T_AC =  214.42 N\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.7  Page No : 50"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Given Data\n",
      "dx = -40.;\t\t\t#m\n",
      "dy = 80.;\t\t\t#m\n",
      "dz = 30.;\t\t\t#m\n",
      "f = 2500.;\t\t\t#N, Mafnitude of force F\n",
      "\n",
      "# Calculations and Results\n",
      "d = math.sqrt(dx**2+dy**2+dz**2);\t\t\t#m, total dismath.tance of vector AB\n",
      "#F = f*lambda, lambda - unit vector =  AB/d. So we can calculate each component by multiplying this unit vector\n",
      "Fx = f*dx/d;\t\t\t#N , X component of F\n",
      "Fy = f*dy/d;\t\t\t#N , Y component of F\n",
      "Fz = f*dz/d;\t\t\t#N , Z component of F\n",
      "\n",
      "print \"Component of F along X axis is %.2f N\"%(Fx);\n",
      "print \"Component of F along Y axis is %.2f N\"%(Fy);\n",
      "print \"Component of F along Z axis is %.2f N\"%(Fz);\n",
      "print \"We may write F as  F  =  %.2f i + %.2f j + %.2f k\"%(Fx,Fy,Fz);\n",
      "\n",
      "thetax = math.acos(Fx/f);\t\t\t# radian , angle with +ve x axis\n",
      "thetay = math.acos(Fy/f);\t\t\t# radian , angle with +ve y axis\n",
      "thetaz = math.acos(Fz/f);\t\t\t# radian , angle with +ve z axis\n",
      "\n",
      "#Conversion of angles into degree\n",
      "thetax = thetax*180/math.pi;\t\t\t#degree\n",
      "thetay = thetay*180/math.pi;\t\t\t#degree\n",
      "thetaz = thetaz*180/math.pi;\t\t\t#degree\n",
      "\n",
      "print \"Angle made by F with +ve X axis %.2f degree\"%(thetax);\n",
      "\n",
      "print \"Angle made by F with +ve Y axis %.2f degree\"%(thetay);\n",
      "print \"Angle made by F with +ve Z axis %.2f degree\"%(thetaz);\n",
      "\n",
      "F = 800. \t\t\t# N , given force\n",
      "theta = 145. \t\t\t# Degrees , angle with posiyive X axis \n",
      "\n",
      "theta = theta*math.pi/180;\t\t\t# Conversion into radian\n",
      "\n",
      "Fx = F*math.sin(theta);\t\t\t#N, Horizontal component\n",
      "Fy = F*math.cos(theta);\t\t\t# N, Vertical Component\n",
      "print \"Horizontal component of F is %.2f N\"%(Fx);\n",
      "print \"Vertial component of F is %.2f N\"%(Fy);\n",
      "print \"We may write F as  F  =  %.2f i + %.2f j\"%(Fx,Fy);\n",
      "\n",
      "F = 300. \t\t\t# N , given force\n",
      "AB = math.sqrt(8**2+6**2);\t\t\t# m Length of AB\n",
      "math.cos_alpha = 8/AB;\n",
      "math.sin_alpha = -6/AB;\n",
      "Fx = F*math.cos_alpha;\t\t\t#N, Horizontal component\n",
      "Fy = F*math.sin_alpha;\t\t\t# N, Vertical Component\n",
      "print \"Fx = %.2f\"%Fx\n",
      "print \"Fy = %.2f\"%Fy\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Component of F along X axis is -1060.00 N\n",
        "Component of F along Y axis is 2120.00 N\n",
        "Component of F along Z axis is 795.00 N\n",
        "We may write F as  F  =  -1060.00 i + 2120.00 j + 795.00 k\n",
        "Angle made by F with +ve X axis 115.09 degree\n",
        "Angle made by F with +ve Y axis 32.01 degree\n",
        "Angle made by F with +ve Z axis 71.46 degree\n",
        "Horizontal component of F is 458.86 N\n",
        "Vertial component of F is -655.32 N\n",
        "We may write F as  F  =  458.86 i + -655.32 j\n",
        "Fx = 240.00\n",
        "Fy = -180.00\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.8  Page No : 51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Given Data\n",
      "T_AB = 4200.;\t\t\t#N , Tension in cable AB\n",
      "T_AC = 6000.;\t\t\t#N , Tension in cable AC\n",
      "# Vector AB = -(5m)i+(3m)j+(4m)k\n",
      "#Vector Ac =  -(5m)i+(3m)j+(5m)k\n",
      "ABx = -5.;\t\t\t#m\n",
      "ABy = 3.;\t\t\t#m\n",
      "ABz = 4.;\t\t\t#m\n",
      "ACx = -5.;\t\t\t#m\n",
      "ACy = 3.;\t\t\t#m\n",
      "ACz = -5.;\t\t\t#m\n",
      "\n",
      "# Calculations and Results\n",
      "AB = math.sqrt((-5)**2+3**2+4**2);\t\t\t#m, Magnitude of vector AB\n",
      "AC = math.sqrt((-5)**2+3**2+5**2);\t\t\t#m, Magnitude of vector AC\n",
      "#vT_AB = T_AB*lambdaAB, lambdaAB - unit vector =  vAB/AB. So we can calculate each component by multiplying this unit vector\n",
      "T_ABx = T_AB*ABx/AB;\t\t\t#N , X component of T_AB\n",
      "T_ABy = T_AB*ABy/AB;\t\t\t#N , Y component of T_AB\n",
      "T_ABz = T_AB*ABz/AB;\t\t\t#N , Z component of T_AB\n",
      "\n",
      "print \"Component of T_AB along X axis is %.2f N\"%(T_ABx);\n",
      "print \"Component of T_AB along Y axis is %.2f N\"%(T_ABy);\n",
      "print \"Component of T_AB along Z axis is %.2f N\"%(T_ABz);\n",
      "print \"We may write T_AB as  T_AB  =  %.2f i + %.2f j + %.2f k\"%(T_ABx,T_ABy,T_ABz);\n",
      "\n",
      "#vT_AC = T_AC*lambdaAC, lambdaAC - unit vector =  vAC/AC. So we can calculate each component by multiplying this unit vector\n",
      "T_ACx = T_AC*ACx/AC;\t\t\t#N , X component of T_AC\n",
      "T_ACy = T_AC*ACy/AC;\t\t\t#N , Y component of T_AC\n",
      "T_ACz = T_AC*ACz/AC;\t\t\t#N , Z component of T_AC\n",
      "\n",
      "print \"Component of T_AC along X axis is %.2f N\"%(T_ACx);\n",
      "print \"Component of T_AC along Y axis is %.2f N\"%(T_ACy);\n",
      "print \"Component of T_AC along Z axis is %.2f N\"%(T_ACz);\n",
      "print \"We may write T_AC as  T_AC  =  %.2f i + %.2f j + %.2f k\"%(T_ACx,T_ACy,T_ACz);\n",
      "\n",
      "Rx = T_ABx+T_ACx;\t\t\t#N ,X component of R\n",
      "Ry = T_ABy+T_ACy;\t\t\t#N ,Y component of R\n",
      "Rz = T_ABz+T_ACz;\t\t\t#N ,Z component of R\n",
      "\n",
      "print \"Component of R along X axis is %.2f N\"%(Rx);\n",
      "print \"Component of R along Y axis is %.2f N\"%(Ry);\n",
      "print \"Component of R along Z axis is %.2f N\"%(Rz);\n",
      "print \"We may write R as  R  =  %.2f i + %.2f j + %.2f k\"%(Rx,Ry,Rz);\n",
      "\n",
      "R = math.sqrt(Rx**2+Ry**2+Rz**2);\t\t\t#N, Magnitude of resultant\n",
      "\n",
      "thetax = math.acos(Rx/R);\t\t\t# radian , angle with +ve x axis\n",
      "thetay = math.acos(Ry/R);\t\t\t# radian , angle with +ve y axis\n",
      "thetaz = math.acos(Rz/R);\t\t\t# radian , angle with +ve z axis\n",
      "\n",
      "#Conversion of angles into degree\n",
      "thetax = thetax*180/math.pi;\t\t\t#degree\n",
      "thetay = thetay*180/math.pi;\t\t\t#degree\n",
      "thetaz = thetaz*180/math.pi;\t\t\t#degree\n",
      "\n",
      "print \"Angle made by R with +ve X axis %.2f degree\"%(thetax);\n",
      "\n",
      "print \"Angle made by R with +ve Y axis %.2f degree\"%(thetay);\n",
      "print \"Angle made by F with +ve Z axis %.2f degree\"%(thetaz);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Component of T_AB along X axis is -2969.85 N\n",
        "Component of T_AB along Y axis is 1781.91 N\n",
        "Component of T_AB along Z axis is 2375.88 N\n",
        "We may write T_AB as  T_AB  =  -2969.85 i + 1781.91 j + 2375.88 k\n",
        "Component of T_AC along X axis is -3905.67 N\n",
        "Component of T_AC along Y axis is 2343.40 N\n",
        "Component of T_AC along Z axis is -3905.67 N\n",
        "We may write T_AC as  T_AC  =  -3905.67 i + 2343.40 j + -3905.67 k\n",
        "Component of R along X axis is -6875.52 N\n",
        "Component of R along Y axis is 4125.31 N\n",
        "Component of R along Z axis is -1529.79 N\n",
        "We may write R as  R  =  -6875.52 i + 4125.31 j + -1529.79 k\n",
        "Angle made by R with +ve X axis 147.38 degree\n",
        "Angle made by R with +ve Y axis 59.64 degree\n",
        "Angle made by F with +ve Z axis 100.80 degree\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}