summaryrefslogtreecommitdiff
path: root/sample_notebooks/AkshayShende/chapter2.ipynb
blob: d82b3395b680b5d1f88b256753dbcf6e8fe62c2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
 "metadata": {
  "name": "chapter2.ipynb"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2:Concurrent Forces in A Plane"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2-1, Page No:10"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Initilization of variables\n",
      "\n",
      "P=50 #N\n",
      "Q=100 #N\n",
      "beta=150 #degree # angle between P & the horizontal\n",
      "\n",
      "#Calculations\n",
      "\n",
      "R=(P**2+Q**2-(2*P*Q*cos(beta*(pi/180))))**0.5 # using the Trignometric solution\n",
      "Alpha=(arcsin(((sin(beta*(pi/180))*Q)/R)))*(180/pi)+15 #Angle in degrees\n",
      "\n",
      "#Result\n",
      "print \"The magnitude of resultant is\",round(R,2),\"N\"\n",
      "print \"The direction of resultant is\",round(Alpha,2),\"degrees\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The magnitude of resultant is 145.47 N\n",
        "The direction of resultant is 35.1 degrees\n"
       ]
      }
     ],
     "prompt_number": 19
    }
   ],
   "metadata": {}
  }
 ]
}