Skip to content

Commit 9e151ca

Browse files
authored
Merge pull request #139 from ComputationalScienceLaboratory/cr3bp
Circular Restricted 3 Body Problem
2 parents 0b2bf99 + b5e4d94 commit 9e151ca

28 files changed

+969
-156
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ docs/build/
1010
docs/problems/
1111

1212
.DS_Store
13+
tests/octave-workspace

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ serve:
1919
--ignore $(PROBLEMSDIR)
2020

2121
lint:
22-
pycodestyle .. && codespell ..
22+
pycodestyle .. && codespell --skip="*.bib" ..
2323

2424
clean:
2525
rm -rf $(BUILDDIR) $(PROBLEMSDIR)

docs/references.bib

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,26 @@ @article{dSL98
209209
pages={83-100},
210210
year={1998}
211211
}
212+
213+
@phdthesis{Spr21,
214+
title={Trajectory design and targeting for applications to the exploration program in cislunar space},
215+
author={Spreen, Emily M Zimovan},
216+
year={2021},
217+
school={Purdue University}
218+
}
219+
220+
@book{She20,
221+
title={A Preliminary Study of Leo to Geo Transfers for Inclination Changes Using Libration Point Orbits},
222+
author={Shepard, John Philip},
223+
year={2020},
224+
publisher={The University of North Dakota}
225+
}
226+
227+
@book{Are63,
228+
title={Periodic solutions of the restricted three body problem representing analytic continuations of Keplerian elliptic motions},
229+
author={Arenstorf, Richard F},
230+
year={1963},
231+
publisher={National Aeronautics and Space Administration}
232+
}
233+
234+

toolbox/+otp/+arenstorf/+presets/Canonical.m

Lines changed: 0 additions & 34 deletions
This file was deleted.

toolbox/+otp/+arenstorf/ArenstorfProblem.m

Lines changed: 0 additions & 67 deletions
This file was deleted.

toolbox/+otp/+arenstorf/f.m

Lines changed: 0 additions & 18 deletions
This file was deleted.

toolbox/+otp/+arenstorf/jacobian.m

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
orbittypes = {'L2', 'P2HO1', 'P2HO2', 'P4HO1', 'P4HO2'};
2+
nIndices = 20;
3+
4+
orbits = struct;
5+
6+
for oti = 1:numel(orbittypes)
7+
orbittype = orbittypes{oti};
8+
otable = zeros(20, 4);
9+
for ind = 1:nIndices
10+
11+
problem = otp.circularrestricted3body.presets.HaloOrbit('OrbitType', orbittype, 'Index', ind);
12+
13+
y0 = problem.Y0;
14+
y0 = [y0(1); y0(3); y0(5)];
15+
period = problem.TimeSpan(2);
16+
f = problem.RHS.F;
17+
18+
J = @(yc) cost(yc, y0);
19+
nonlc = @(yc) constr(yc, f, period);
20+
21+
opts = optimoptions("fmincon", "Algorithm","interior-point", ...
22+
"FunctionTolerance", 1e-8, "ConstraintTolerance", 1e-14, 'Display','off');
23+
[ynew, fev] = fmincon(J, y0, [], [], [], [], [], [], nonlc, opts);
24+
25+
otable(ind, :) = [period, ynew.'];
26+
27+
end
28+
orbits.(orbittype) = otable;
29+
end
30+
31+
function c = cost(yc, y0)
32+
33+
c = sum((yc - y0).^2);
34+
35+
end
36+
37+
function [c, ceq] = constr(yc, f, period)
38+
39+
yc = [yc(1); 0; yc(2); 0; yc(3); 0];
40+
41+
c = [];
42+
43+
sol = ode45(f, [0, period], yc, ...
44+
odeset('AbsTol', 1e-14, 'RelTol', 100*eps));
45+
46+
ceq = sum((yc - sol.y(:, end)).^2);
47+
48+
end
49+
50+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
classdef Arenstorf < otp.circularrestricted3body.CR3BPProblem
2+
% One period of a satellite moving in an Earth-Moon system on a planar
3+
% orbit. The original orbit was derived in :cite:p:`Are63` for the
4+
% planar circular restricted three body problem, and the setting from
5+
% which this preset is derived is taken form pages 129--130 of
6+
% :cite:p:`HNW93`.
7+
8+
methods
9+
function obj = Arenstorf(varargin)
10+
% Create the Arenstorf CR3BP problem object.
11+
12+
params = otp.circularrestricted3body.CR3BPParameters(...
13+
'Mu', 0.012277471, ...
14+
'SoftFactor', 0, ...
15+
varargin{:});
16+
cls = class(params.Mu);
17+
18+
% Decimals converted to rational to support multiple data types
19+
y0 = [cast(497, cls) / cast(500, cls); ...
20+
cast(0, cls); ...
21+
cast(0, cls); ...
22+
cast(-823970832321143, cls) / cast(411659154384760, cls)];
23+
tspan = [cast(0, cls); ...
24+
cast(4541277234950502, cls) / cast(266113073862361, cls)];
25+
26+
obj = obj@otp.circularrestricted3body.CR3BPProblem(tspan, y0, params);
27+
end
28+
29+
end
30+
end
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
classdef Canonical < otp.circularrestricted3body.CR3BPProblem
2+
% A trivial preset with a stable oscillating orbit around a lagrange point.
3+
4+
methods
5+
function obj = Canonical(varargin)
6+
% Create the Canonical CR3BP problem object.
7+
8+
mu = 0.5;
9+
10+
y0 = [0; 0; 0; 0; 0; 1];
11+
tspan = [0, 10];
12+
params = otp.circularrestricted3body.CR3BPParameters(...
13+
'Mu', mu, ...
14+
'SoftFactor', 1e-3, ...
15+
varargin{:});
16+
obj = obj@otp.circularrestricted3body.CR3BPProblem(tspan, y0, params);
17+
end
18+
end
19+
end

0 commit comments

Comments
 (0)