-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.py
More file actions
executable file
·74 lines (63 loc) · 2.71 KB
/
start.py
File metadata and controls
executable file
·74 lines (63 loc) · 2.71 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
72
73
74
print 'Importing some stuff, wait for it, please...'
import utils
import os
from implementations import *
def main():
def getMethod():
while True:
try:
os.system('clear')
print """
Welcome!
Please select which method you'd like to use:
1) Simple Euler Method
2) Inverse Euler Method
3) Improved Euler Method
4) Runge-Kutta Method
5) Adams-Bashforth Method * You'll choose the degree later
6) Adams-Moulton Method * You'll choose the degree later
7) All methods in the same graph
PS: To leave enter a different number
"""
method = int(input("\nPlease input an integer: "))
return method
except:
print "Please try again, invalid input."
method = getMethod()
while method in range(1,8):
if method == 1:
os.system('clear')
print 'Selected Simple Euler Method\n'
utils.runSimpleMethod(eulers.simple_euler, "Simple Euler Method")
elif method == 2:
os.system('clear')
print 'Selected Inverse Euler Method\n'
utils.runSimpleMethod(eulers.inverse_euler, "Inverse Euler Method")
elif method == 3:
os.system('clear')
print 'Selected Improved Euler Method\n'
utils.runSimpleMethod(eulers.improved_euler, "Improved Euler Method")
elif method == 4:
os.system('clear')
print 'Selected Runge-Kutta Method\n'
utils.runSimpleMethod(runge.method, "Runge-Kutta Method")
elif method == 5:
os.system('clear')
print 'Selected Adams-Bashforth Method\n'
order = utils.getOrder()
utils.runAdamsBash(order)
elif method == 6:
os.system('clear')
print 'Selected Adams-Moulton Method\n'
order = utils.getOrder()
print 'Great! Making calculations, soon the plot will be shown. Hold on, please..'
utils.runAdamsMoulton(order)
elif method == 7:
os.system('clear')
print 'Selected All Single Step methods\n'
print 'For the Adams-Moulton and Adams-Bashforth methods:\n'
order = utils.getOrder()
print 'Great! Making calculations, soon the plot will be shown. Hold on, please..'
utils.runAllMethods(order)
method = getMethod()
main()