-
Notifications
You must be signed in to change notification settings - Fork 1
/
acceleration.m
47 lines (40 loc) · 1.28 KB
/
acceleration.m
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
%{
Author: Shane Kramer/Professor Edward Brown (UCCS)
Course: SPCE 5025 Fundamentals Of Astronautics
Date: 03.10.15
---------------------------------------------------
This function provides a interface to select specific
acceleration models from a cardinal argument.
%}
function [ acc ] = acceleration(JDi, r, v, model)
global mu_moon mu_sun
% Central body acceleration
if(model==1)
acc = centralBodyAcceleration(r);
end
% Central body and J2 acceleration
if(model==2)
acc = j2Acceleration(r);
end
% Central body and Jacchia60 Drag
if(model==3)
acCB=centralBodyAcceleration(r);
acJ60=jacchiaAcceleration(JDi, r, v);
acc = acCB+acJ60;
end
% Central body and Sun and Moon gravity
if(model==4)
acCB=centralBodyAcceleration(r);
rMoon = analyticMoon(JDi);
rSun = analyticSun(JDi);
aMoon=thirdBodyGravity(mu_moon, r, rMoon);
aSun=thirdBodyGravity(mu_sun, r, rSun);
acc = acCB+aMoon+aSun;
end
% Central body and Geopotential Acceleration (J2)
if(model==5)
acCB=centralBodyAcceleration(r);
acGA=geopotentialAcceleration(r);
acc = acCB+acGA;
end
end