-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatic forces.py
130 lines (114 loc) · 2.38 KB
/
static forces.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
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
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 22 10:40:29 2017
@author: Kuba
"""
import math
import matplotlib.pyplot as plt
import numpy as np
import inputs
Inputs = inputs.Inputs()
g = 9.81
m = 64000.0
L1 = 5.0
L2 = 14.6
L3 = 34 - 19.6
L = L1+L2+L3
dz = 3.1
dy = 6.4
dx = 7.6
Sx = 1.6*10**5
q = 3*g*m/L
#F - front, R - rear, R = R1+R2
#forces in x
Fx = Sx*(1-((L-L1+dz)/L2))
Rx = Sx*((L-L1+dz)/L2)
#forces in y
Fy = q*((L1+L2)**2/(2*L2)) - (q*L3**2)/(2*L2)
Ry = q*L - Fy
"""
print "Fy" , Fy, "Ry", Ry
print Fy + Ry, q*L
print Fx, Rx
print Fx + Rx, Sx
"""
#static diagrams
nres = 1000 #set resolution
zrange = np.linspace(0.,L,nres)
Vy = []
Mx = []
Vx = []
My = []
Mz = []
Vz = 0.
for z in zrange:
if z <= L1:
Vy1 = -q*z
Mx1 = -0.5*q*z**2
Vy.append(Vy1)
Mx.append(Mx1)
elif L1 < z <= L1+L2:
z = z - L1
Vy2 = (-q*L1 + Fy) - q*z
Mx2 = -0.5*q*L1**2 + (-q*L1 + Fy)*z - 0.5*q*z**2
Vy.append(Vy2)
Mx.append(Mx2)
elif L1+L2 < z <= L:
z = z - (L2+L1)
Vy3 = (-q*(L1 + L2) + Fy + Ry) - q*z
Mx3 = (-0.5*q*L1**2 + (-q*L1 + Fy)*L2 - 0.5*q*L2**2)+(-q*(L1 + L2) + Fy + Ry)*z - 0.5*q*z**2
Vy.append(Vy3)
Mx.append(Mx3)
for z in zrange:
if z <= L1:
Vx1 = 0
My1 = 0
Vx.append(Vx1)
My.append(My1)
elif L1 < z <= L2+L1:
z = z - L1
Vx2 = Fx
My2 = -((Sx - Fx)/L2)*z
Vx.append(Vx2)
My.append(My2)
elif L1+L2 < z <= L:
z = z - (L2+L1)
Vx3 = Sx
My3 = -(Sx - Fx)+((Sx-Fx)/L3)*z
Vx.append(Vx3)
My.append(My3)
for z in zrange: #ybar needed for every slice?
ybar = 395.52*10**-3
if z <= L1:
Mz1 = 0.
Mz.append(Mz1)
elif L1 < z <= L2+L1:
z = z - L1
Mz2 = Sx*(Inputs.dtaily-Inputs.R+ybar)-(Rx*(Inputs.dtgy+Inputs.R-ybar)) #ybar or not
Mz.append(Mz2)
elif L1+L2 < z <= L:
z = z - (L2+L1)
Mz3 = Sx*(Inputs.dtaily-Inputs.R+ybar)
Mz.append(Mz3)
#plot section
plt.subplot(111)
plt.title("Vy")
plt.plot(zrange, Vy)
plt.show()
plt.subplot(111)
plt.title("Mx")
plt.plot(zrange, Mx)
plt.show()
plt.subplot(111)
plt.title("Vx")
plt.plot(zrange, Vx)
plt.show()
plt.subplot(111)
plt.title("My")
plt.plot(zrange, My)
plt.show()
plt.subplot(111)
plt.title("Mz")
plt.plot(zrange, Mz)
plt.show()
""""""