summaryrefslogtreecommitdiff
path: root/sample_notebooks/harishsahu/Chapter1_1.ipynb
blob: 40f0220ecb04d171628a5e22b0ed1158d5090bad (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
 "metadata": {
  "name": "",
  "signature": "sha256:e3cd5ced27f4cedce3cbdbb3b5b1f422b536f401e599f719b4c9b39198a059c3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter1-Mohrs circle"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1-pg12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Mohr's circle\n",
      "#calculate center of the circle and maxi principal stress and pricipal stress and maxi shearing stresss\n",
      "import numpy\n",
      "from numpy.linalg import inv\n",
      "import math\n",
      "sigma=((40+80)/2.)\n",
      "print'%s %.2f %s'%(\"center of the circle in MPa = \",sigma,\"\")\n",
      "\n",
      "##solution a\n",
      "x=((80-40)**2.);\n",
      "y=30**2.;\n",
      "sigma1=60.+math.sqrt((.25*x)+y)\n",
      "print'%s %.2f %s'%(\"maxi pricipal stress in MPa = \",sigma1,\"\");## print'%s %.2f %s'%laying result\n",
      "sigma2=60.-math.sqrt((.25*x)+y)\n",
      "print'%s %.2f %s'%(\"mini pricipal stress in MPa = \",sigma2,\"\");## print'%s %.2f %s'%laying result\n",
      "theta1=((math.atan((30./20.))/2)*57.3)\n",
      "print'%s %.2f %s'%(\"pricipal stresses in degree\",theta1,\"\");## print'%s %.2f %s'%laying result\n",
      "theta2=(((math.atan(30/20.))+180.)/2.)*57.3\n",
      "print'%s %.2f %s'%(\"pricipal stresses in degree\",theta2,\"\");## print'%s %.2f %s'%laying result\n",
      "\n",
      "##solution b\n",
      "tau=math.sqrt((.25*x)+y)\n",
      "print'%s %.2f %s'%(\"maxi shearing stress in MPa = \",tau,\"\");## print'%s %.2f %s'%laying result\n",
      "theta3=theta1+45.\n",
      "print'%s %.2f %s'%(\"stress in MPa = \",theta3,\"\");## print'%s %.2f %s'%laying result\n",
      "theta4=theta2+45\n",
      "print'%s %.2f %s'%(\"stress in MPa = \",theta4,\"\");## print'%s %.2f %s'%laying result\n",
      "\n",
      "##final solution in matrix form\n",
      "p=([[80 ,30], [30 ,40]])\n",
      "print(p) \n",
      "q=([[sigma1, 0 ],[0 ,sigma2]])\n",
      "print(q)\n",
      "r=([[sigma ,-tau], [-tau ,sigma]])\n",
      "print(r)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "center of the circle in MPa =  60.00 \n",
        "maxi pricipal stress in MPa =  96.06 \n",
        "mini pricipal stress in MPa =  23.94 \n",
        "pricipal stresses in degree 28.16 \n",
        "pricipal stresses in degree 5185.16 \n",
        "maxi shearing stress in MPa =  36.06 \n",
        "stress in MPa =  73.16 \n",
        "stress in MPa =  5230.16 \n",
        "[[80, 30], [30, 40]]\n",
        "[[96.05551275463989, 0], [0, 23.944487245360108]]\n",
        "[[60.0, -36.05551275463989], [-36.05551275463989, 60.0]]\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex2-pg17"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Mohr's circle\n",
      "#calculate radius of the circle in and orientation of the stress\n",
      "import math\n",
      "radius=((14+28)/2.)\n",
      "print'%s %.2f %s'%(\"radius of the circle in degree = \",radius,\"\")\n",
      "sigma1=(7+radius *math.cos(60/57.3))\n",
      "print'%s %.2f %s'%(\" the circle in MPa = \",sigma1,\"\")\n",
      "sigma2=(7-radius *math.cos(60/57.3))\n",
      "print'%s %.2f %s'%(\" the circle in MPa = \",sigma2,\"\")\n",
      "tau1=radius*math.sin(60./57.3)\n",
      "print'%s %.2f %s'%(\" orientation of the stresses in MPa = \",tau1,\"\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "radius of the circle in degree =  21.00 \n",
        " the circle in MPa =  17.50 \n",
        " the circle in MPa =  -3.50 \n",
        " orientation of the stresses in MPa =  18.19 \n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}