-
Notifications
You must be signed in to change notification settings - Fork 10
/
phasing_maneuver.m
79 lines (62 loc) · 2.26 KB
/
phasing_maneuver.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
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
75
76
77
78
79
function phasing_maneuver(Ria,Rip,th,n,mu)
%% Calculates the apogee and delta-v required for a phasing maneuver
%
% Jeremy Penn
% 24 October 2017
%
% Revision: 24/10/17
%
% function phasing_maneuver()
%
% Purpose: This function calculates the phasing orbit and delta-v
% requirement for a phasing maneuver. Burns are assumed at
% perigee.
%
% Inputs: o Ria - The apogee of the initial orbit [km].
% o Rip - The perigee of the initial orbit [km].
% o n - The number of phasing orbits desired [OPTIONAL].
% o th - The true anomaly of the target [deg].
% o mu - The standard grav parameter of the central body
% [OPTIONAL]. Defaults to Earth [km^3/s^2].
%
clc;
if nargin == 3
n =1;
mu = 398600; %[km^3/s^2]
end
if nargin == 4
mu = 398600; %[km^3/s^2]
end
%% Confirm th is between 0 and 360
th = mod(th,360);
%% Convert deg to rad
th = th * (pi/180);
%% Calculate the angular momentum of the initial orbit
h1 = sqrt( 2*mu ) * sqrt( (Ria*Rip)/(Ria+Rip) );
%% Calculate the period of the primary orbit
a1 = (1/2) * (Ria+Rip);
t1 = ( (2*pi)/sqrt(mu) )*( a1^(3/2) );
%% Calculate the eccentricity of the primary orbit
e = (Ria-Rip) / (Ria+Rip);
%% Calculate the mean anomaly of the target
Eb = 2 * atan( sqrt( (1-e)/(1+e) ) * tan(th/2) );
%% Calculate the flight time from A to B
tab = (t1/(2*pi)) * (Eb - e*sin(Eb));
%% Calculate the phasing orbit period
t2 = t1 - tab/n;
%% Calculate semi-major axis of phasing orbit
a2 = ( (sqrt(mu)*t2)/(2*pi) )^(2/3);
%% Calculate apogee of phasing orbit
Rpa = 2*a2 - Rip;
%% Calculate the angular momentum of the phasing orbit
h2 = sqrt(2*mu) * sqrt( (Rip*Rpa)/(Rip+Rpa) );
%% Calculate velocities
va1 = h1/Rip;
va2 = h2/Rip;
dva21 = va2 - va1;
dva12 = va1 - va2;
% Total delta-v
dv = abs(dva12)+abs(dva21);
fprintf('The apogee of the phasing obrit is %4.2f [km]\n',Rpa)
fprintf('The total delta-v required is %4.4f [km/s]\n',dv)
end