-
Notifications
You must be signed in to change notification settings - Fork 0
/
experiment.f90
51 lines (26 loc) · 1.14 KB
/
experiment.f90
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
program orbit
use astro
implicit none
real(kind(1.d0)) :: ra,rp,spcangmon , kSun , va0,vp0,ecc, T, kEarth, sm ,spe
call init_planets()
print *, "Earth radius is : " , Earth%radius
print *, "The gravitational parameter of the Sun : " , Sun%k
kSun = 1.32712440041279419d20
kEarth = 3.98600435507d14
write(*,"(a)",advance="no") "Enter your ra and rp: "
read(*,*) ra , rp
ecc = Eccentricity(ra,rp)
write(*,"(a,f30.9,/)") "Here is your Eccentricity:" , ecc
sm = SemiMajorAxis(ra,rp)
write(*,"(a,f30.9,/)") "Here is your SemiMajorAxis:" ,sm
T = Period(kEarth,ra,rp)
write(*,"(a,f30.9,/)") "Here is your period in seconds!: " , T
spcangmon = SpecificAngularMomentum(kEarth,ra,rp)
write(*,"(a,f30.9,/)") "Here is the Specific Angular momentum:" ,spcangmon
va0 = spcangmon/ra
write(*,"(a,f30.9,/)") "Here is the velocity at apogee" , va0
vp0 = spcangmon/rp
write(*,"(a,f30.9,/)") "Here is the velocity at perigee" , vp0
spe = SpecificEnergy(kEarth,ra,rp)
write(*,"(a,f30.9,/)") "Here is the specific energy:" , spe
end program orbit