-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTRAIN.py
61 lines (31 loc) · 1.6 KB
/
STRAIN.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
def strain():
print "You have chosen to calculate strain."
print """What would you like to calculate?
1) Longitudinal Strain
2) Volumetric Strain
3) Lateral Strain"""
choice1=int(raw_input("Enter your choice(NUMBER)."))
if choice1==1:
print "You have chosen to calculate Longitudinal strain."
length=float(raw_input("Enter the length:"))
changelength=float(raw_input("Enter the change in length:"))
print "FORMULAE: Longitudinal Strain= change in length/original length"
lstrain=changelength/length
print "The longitudinal strain=",lstrain
elif choice1==2:
print "You have chosen to calculate Volumetric Strain."
volume=float(raw_input("Enter the volume:"))
changevolume=float(raw_input("Enter the change in volume:"))
print "FORMULAE: Volumetric Strain= change in volume/original volume"
vstrain=changevolume/volume
print "The volumetric strain=",vstrain
elif choice1==3:
print "You have chosen to calculate Lateral Strain."
laterallength=float(raw_input("Enter the lateral length:"))
changelaterallength=float(raw_input("Enter the change in lateral length:"))
print "FORMULAE: Lateral Strain= -(Change In Lateral Length/Lateral Length)"
lateralstrain1=changelaterallength/laterallength
lateralstrain=-(lateralstrain1)
print "The lateral strain=",lateralstrain
else:
print "ERROR: Choice of calculation doesn't exist."