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
|
{
"metadata": {
"name": "",
"signature": "sha256:902d8cc266f9fb597a0d00273b10ab788d226cbd969bb1e960b465c84a750eef"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 06: Matrix methods"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 6.4 Pg.No.205"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from __future__ import division\n",
"import math\n",
"import numpy as np\n",
"from sympy import solve, symbols, pprint\n",
"from sympy import diff\n",
"x,y=symbols('x,y')\n",
"\n",
"E=200000 #youngs modulus (N/mm^2)\n",
"nu=0.3 #poissons ratio\n",
"u1=0.001\n",
"u2=0.003\n",
"u3=-0.003 #displacements of corners (m)\n",
"u4=0\n",
"v1=-0.004\n",
"v2=-0.002\n",
"v3=0.001\n",
"v4=0.001\n",
"\n",
"\n",
"a=np.array([[1,-2,-1,2],[1,2,-1,-2],[1,2,1,2],[1,-2,1,-2]])\n",
"b=np.array([u1,u2,u3,u4])\n",
"alpha=np.linalg.solve(a,b)\n",
"alpha1=alpha[0]\n",
"alpha2=alpha[1]\n",
"alpha3=alpha[2]\n",
"alpha4=alpha[3]\n",
"\n",
"a=np.array([[1,-2,-1,2],[1,2,-1,-2],[1,2,1,2],[1,-2,1,-2]])\n",
"b=np.array([v1,v2,v3,v4])\n",
"alpha=np.linalg.solve(a,b)\n",
"alpha5=alpha[0]\n",
"alpha6=alpha[1]\n",
"alpha7=alpha[2]\n",
"alpha8=alpha[3]\n",
"\n",
"u=alpha1+alpha2*x+alpha3*y+alpha4*x*y\n",
"v=alpha5+alpha6*x+alpha7*y+alpha8*x*y\n",
"\n",
"ex=diff(u,x)\n",
"ey=diff(v,y)\n",
"Yxy=diff(u,y)+diff(v,x)\n",
"\n",
"ex=-0.000125\n",
"ey=.002\n",
"Yxy=-0.0015\n",
"\n",
"sigma_x=E/(1-nu**2)*(ex+nu*ey)\n",
"sigma_y=E/(1-nu**2)*(ey+nu*ex)\n",
"print \"longitudinal stress in x direction = %3.1f N/mm^2\"%(sigma_x)\n",
"print \"longitudinal stress in y direction = %3.1f N/mm^2\"%(sigma_y)\n",
"\n",
"T_xy=E/2/(1+nu)*Yxy\n",
"print \"shear stress at the center of plate = %3.1f N/mm^2\"%(T_xy)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"longitudinal stress in x direction = 104.4 N/mm^2\n",
"longitudinal stress in y direction = 431.3 N/mm^2\n",
"shear stress at the center of plate = -115.4 N/mm^2\n"
]
}
],
"prompt_number": 44
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
|