-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmad2.py
More file actions
51 lines (31 loc) · 703 Bytes
/
mad2.py
File metadata and controls
51 lines (31 loc) · 703 Bytes
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
#!/usr/bin/python3
import numpy as np
import math
GM=4.282837*math.pow(10,13)
vid_size=481610.3226
transfer_rate=200
r_mars=3389.5*1000
height=0
mars_day=88642.66
def theta(h,a):
return 2*(math.acos(r_mars/(r_mars+h))+math.acos(r_mars/a))
def T_orb(a):
return math.sqrt(math.pow(a,3)/GM)
t_total=0
a=r_mars
for n in range(7):
t_total=0
while t_total<=(vid_size/transfer_rate):
a+=math.pow(10,3-n)
t_total=(theta(height,a)*(T_orb(a)))
t_n_old=t_total
for i in range(10):
t_n=((math.tau/mars_day)*t_n_old)*(T_orb(a))
t_total=t_total+t_n
t_n_old=t_n
print(t_total/60)
print(a/1000)
print("")
a-=math.pow(10,4-n)
a+=math.pow(10,4-n)
print((a-r_mars)/1000)