summaryrefslogtreecommitdiff
path: root/The_Theory_of_Machines_by_T._Bevan/ch5.ipynb
blob: 29c355fc96af8864145767f17ed56f1d70d3317f (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
66
67
68
69
70
71
72
73
74
75
76
77
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 5: Valve Diagrams and Valve Gears"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1, Page 147"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "s=1.125#inch\n",
      "e=0.25#inch\n",
      "t=2.25#inch\n",
      "alpha=35#degrees\n",
      "\n",
      "#Calculations\n",
      "#from 5.2, we know theta+alpha=sininverse(s/t)\n",
      "x=math.degrees(math.asin(s/t))\n",
      "y=180-x#sin(x)=sin(180-x)=sin(y)\n",
      "#at admission\n",
      "p=x-alpha\n",
      "#at cutoff\n",
      "q=y-alpha\n",
      "#from 5.3, theta+alpha=sininnverse(-e/t)\n",
      "ang=math.degrees(math.asin(-e/t))\n",
      "angle=abs(ang)\n",
      "a=180+angle#lies in the negative region of sine curve\n",
      "b=360-angle#lies in hte negative region of sine curve\n",
      "#at release\n",
      "r=a-alpha\n",
      "#at compression\n",
      "s=b-alpha\n",
      "\n",
      "#Results\n",
      "print \"Angle theta at admission, cut-off,release and compression are %.2f, %.2f, %.2f and %.2f degrees respectively\"%(p,q,r,s)\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Angle theta at admission, cut-off,release and compression are -5.00, 115.00, 151.38 and 318.62 degrees respectively\n"
       ]
      }
     ],
     "prompt_number": 9
    }
   ],
   "metadata": {}
  }
 ]
}