-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKrazyGlue.py
49 lines (44 loc) · 1.43 KB
/
KrazyGlue.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
"""
Eric Gelphman
University of California San Diego(UCSD)
Department of Mathematics
Irwin and Joan Jacobs School of Engineering Department of Electrical and Computer Engineering(ECE)
September 22, 2017
KrazyGlue script to numerically solve the mean curvature equation, a nonlinear second order ODE
Version 1.0.7
"""
import matplotlib.pyplot as plt
import fGenerator
#Function to graph r vs. H
def graphH(r_vals, H_vals):
plt.plot(r_vals, H_vals)
plt.xlabel("r")
plt.ylabel("H(r)")
plt.show()
def main():
data = fGenerator.generator4()
ofilen = open("output7.txt", 'r+')
#Lists to store data to graph H
r_vals = []
H_vals = []
H = 0.0
#Traversal to iterate through data containing necessary information stored in 4-tuples
#Step size is 1 index in list
for i in data:
r = i[0]
if r >= -100.0:
fbar = i[1]
dfbar_1 = i[2]
dfbar_2 = i[3]
if(r <= 0.8):
H = fGenerator.fulmine.calcHS(r, fbar, dfbar_1, dfbar_2)#Pass values of r, fbar, fbar', fbar''
else:
H = fGenerator.fulmine.calcHGF(r, fbar + r - 4.0/3.0, dfbar_1 + 1, dfbar_2)#Pass values of r, f, f', f'' = fbar''
line = "r: " + str(r) + " H: " + str(H) + "\n"
ofilen.write(line)
r_vals.append(r)
H_vals.append(H)
ofilen.close()
graphH(r_vals, H_vals)
if __name__ == "__main__":
main()