-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.py
77 lines (44 loc) · 1.5 KB
/
core.py
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
from autograd import elementwise_grad as grad
from autograd.numpy import pi, sin
from const import E, a, b, h, nu, q_0
dx, dy = 0, 1
# Flexural rigidity of a plate:
D = (E * h**3) / (12 * (1 - nu**2))
# Deflection of a plate, see Eq. (d) p. 105.
def w(x, y):
C = q_0 / (pi**4 * D * (1 / a**2 + 1 / b**2) ** 2)
return C * sin((pi * x) / a) * sin((pi * y) / b)
# Functions based on relations known from theory of thin isotropic plates
# defined as partial derivatives of deflection using automatic differentiation.
# Slopes:
def phi_x(x, y):
return grad(w, dx)(x, y)
def phi_y(x, y):
return grad(w, dy)(x, y)
# Bending and twisting moments:
def M_x(x, y):
return -D * (grad(grad(w, dx), dx)(x, y) + nu * grad(grad(w, dy), dy)(x, y))
def M_y(x, y):
return -D * (grad(grad(w, dy), dy)(x, y) + nu * grad(grad(w, dx), dx)(x, y))
def M_xy(x, y):
return D * (1 - nu) * grad(grad(w, dx), dy)(x, y)
# Shearing forces:
def Q_x(x, y):
return -D * (
grad(grad(grad(w, dx), dx), dx)(x, y) + grad(grad(grad(w, dx), dy), dy)(x, y)
)
def Q_y(x, y):
return -D * (
grad(grad(grad(w, dx), dx), dy)(x, y) + grad(grad(grad(w, dy), dy), dy)(x, y)
)
# Generalized shearing forces:
def V_x(x, y):
return -D * (
grad(grad(grad(w, dx), dx), dx)(x, y)
+ (2 - nu) * grad(grad(grad(w, dx), dy), dy)(x, y)
)
def V_y(x, y):
return -D * (
grad(grad(grad(w, dy), dy), dy)(x, y)
+ (2 - nu) * grad(grad(grad(w, dx), dx), dy)(x, y)
)