-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy paththeoreticalDisplacement.py
More file actions
71 lines (52 loc) · 1.54 KB
/
theoreticalDisplacement.py
File metadata and controls
71 lines (52 loc) · 1.54 KB
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
# LIBRARIES
from math import pow
from matplotlib import pyplot as plt
# CONSTANTS
h_e = [round(x * 1e-6,6) for x in range(1, 21)]
e_i = 1.93e11
v_i = 0.31
e_s_copper = 1.1e11
v_s_copper = 0.34
e_s_polyethylene = 1.1e9
v_s_polyethylene = 0.42
radius = 8e-9
# DATA
# FUNCTIONS
def composite_modulus(e_s,v_s):
a = (1-pow(v_s,2))/e_s
b = (1-pow(v_i,2))/e_i
return 1/(a+b)
def force_calculator(r,h,e_star):
a = pow(r,-1/3)
b = pow(9/16,1/3)
c = pow(h,3/2)*e_star
return c/(a*b)
# CALCULATE THEORETICAL RESULTS
e_comp_copper = composite_modulus(e_s_copper,v_s_copper)
e_comp_polyethylene = composite_modulus(e_s_polyethylene,v_s_polyethylene)
print(f'E Comp Polyethylene: {e_comp_polyethylene}')
print(f'E Comp Copper: {e_comp_copper}')
force_copper = []
for i in range(20):
force_copper.append(force_calculator(radius,h_e[i],e_comp_copper))
force_polyethylene = []
for i in range(20):
force_polyethylene.append(force_calculator(radius,h_e[i],e_comp_polyethylene))
# DISPLAY THEORETICAL RESULTS
print("")
print("Forces for Copper")
for i in range(len(force_copper)):
print(f'{force_copper[i]}')
print("")
print("Forces for Polyethylene")
for i in range(len(force_polyethylene)):
print(f'{force_polyethylene[i]}')
# print("")
# print("Forces for Copper")
# for i in range(len(force_copper)):
# print(f'{h_e[i]}m: {force_copper[i]} N')
# print("")
# print("Forces for Polyethylene")
# for i in range(len(force_polyethylene)):
# print(f'{h_e[i]}m: {force_polyethylene[i]} N')
# PLOT