-
Notifications
You must be signed in to change notification settings - Fork 2
/
derivedValues.py
58 lines (53 loc) · 1.61 KB
/
derivedValues.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
"""
Derived Values Module
Secret: The transformations from initial inputs to derived quantities
Service: Defines the equations transforming the initial inputs into derived quantities
"""
import math
def derived_params(params):
# cal aspect ratio
params.asprat = params.a / params.b
# cal stand off distance
temp = pow(params.sdvect[0], 2) + pow(params.sdvect[1], 2) + pow(params.sdvect[2], 2)
params.sd = math.sqrt(temp)
# cal load duration factor
params.ldf = pow((params.td / 60.0), (params.m / 16.0))
# cal weight of tnt
params.wtnt = params.w * params.tnt
# cal actual thickness
if params.t == "2.5":
params.h = 2.16
elif params.t == "2.7":
params.h = 2.59
elif params.t == "3.0":
params.h = 2.92
elif params.t == "4.0":
params.h = 3.78
elif params.t == "5.0":
params.h = 4.57
elif params.t == "6.0":
params.h = 5.56
elif params.t == "8.0":
params.h = 7.42
elif params.t == "10.0":
params.h = 9.02
elif params.t == "12.0":
params.h = 11.91
elif params.t == "16.0":
params.h = 15.09
elif params.t == "19.0":
params.h = 18.26
elif params.t == "22.0":
params.h = 21.44
else:
print("Wrong thickness entered -Not a industrial standard ")
# cal glass type factor
if params.gt == 'AN' or params.gt == 'an':
params.gtf = 1
elif params.gt == 'HS' or params.gt == 'hs':
params.gtf = 2
elif params.gt == 'FT' or params.gt == 'ft':
params.gtf = 4
else:
print("Wrong glass type entered")
return params