Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
98c3b8c
initial commit of CR3BP
AndreyAPopov Sep 26, 2025
a384bef
Fixed the example
AndreyAPopov Sep 26, 2025
72108df
Added trivial orbit as canonical
AndreyAPopov Sep 26, 2025
a22b10b
Updated Canonical
AndreyAPopov Sep 26, 2025
692dd1c
Cleaned up, added docs, and made the NRHO preset better.
AndreyAPopov Sep 27, 2025
1cfb368
Renamed NRHO preset
AndreyAPopov Sep 27, 2025
fe52ebd
fixed a typo
AndreyAPopov Sep 27, 2025
e05cacc
fix for octave
AndreyAPopov Sep 27, 2025
c6bca5c
Added more Halo orbit presets
AndreyAPopov Sep 27, 2025
df12d46
I see Tupac is still alive.
AndreyAPopov Sep 27, 2025
1164eb1
Change PhysicalConstants to be more in line with reality
AndreyAPopov Oct 1, 2025
d716dcf
fixed the Jacobi constant and added JCJacobian
AndreyAPopov Oct 1, 2025
9a02383
Fixed f and added a corrected table to better work with ode45
AndreyAPopov Oct 1, 2025
2b204d1
Corrected orbit types
AndreyAPopov Oct 1, 2025
10cd934
add jacobian
AndreyAPopov Oct 2, 2025
9683086
vectorized jacobian
AndreyAPopov Oct 2, 2025
bf483e4
add JVP
AndreyAPopov Oct 2, 2025
fd2e1c5
added LEO preset
AndreyAPopov Oct 6, 2025
dfba98d
Replace LEO with CircularEarthOrbit
AndreyAPopov Oct 7, 2025
5cd3e39
deleted buildrobit script, but added a blacklist to codespell
AndreyAPopov Oct 7, 2025
1790115
fixed CircularEarthOrbit script
AndreyAPopov Oct 7, 2025
50e2974
add radar measurement
AndreyAPopov Oct 8, 2025
e609e5f
renamed some files
AndreyAPopov Oct 8, 2025
99cc582
temp
AndreyAPopov Oct 8, 2025
adbb3d8
temp2
AndreyAPopov Oct 8, 2025
9a8d016
potential fix?
AndreyAPopov Oct 8, 2025
64424be
Initial commit of Arenstorf problem into cr3bp.
AndreyAPopov Oct 8, 2025
7a1f4cc
more planar additions
AndreyAPopov Oct 8, 2025
35a3a34
renamed some files
AndreyAPopov Oct 8, 2025
6345934
delete this file finally.
AndreyAPopov Oct 8, 2025
afe2d10
modified documentation
AndreyAPopov Oct 9, 2025
0e4fd7e
minor fixes for docs
AndreyAPopov Oct 9, 2025
b5e4d94
Delete old Arenstorf problem
AndreyAPopov Oct 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ docs/build/
docs/problems/

.DS_Store
tests/octave-workspace
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ serve:
--ignore $(PROBLEMSDIR)

lint:
pycodestyle .. && codespell ..
pycodestyle .. && codespell --skip="*.bib" ..

clean:
rm -rf $(BUILDDIR) $(PROBLEMSDIR)
23 changes: 23 additions & 0 deletions docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,26 @@ @article{dSL98
pages={83-100},
year={1998}
}

@phdthesis{Spr21,
title={Trajectory design and targeting for applications to the exploration program in cislunar space},
author={Spreen, Emily M Zimovan},
year={2021},
school={Purdue University}
}

@book{She20,
title={A Preliminary Study of Leo to Geo Transfers for Inclination Changes Using Libration Point Orbits},
author={Shepard, John Philip},
year={2020},
publisher={The University of North Dakota}
}

@book{Are63,
title={Periodic solutions of the restricted three body problem representing analytic continuations of Keplerian elliptic motions},
author={Arenstorf, Richard F},
year={1963},
publisher={National Aeronautics and Space Administration}
}


34 changes: 0 additions & 34 deletions toolbox/+otp/+arenstorf/+presets/Canonical.m

This file was deleted.

67 changes: 0 additions & 67 deletions toolbox/+otp/+arenstorf/ArenstorfProblem.m

This file was deleted.

18 changes: 0 additions & 18 deletions toolbox/+otp/+arenstorf/f.m

This file was deleted.

27 changes: 0 additions & 27 deletions toolbox/+otp/+arenstorf/jacobian.m

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
orbittypes = {'L2', 'P2HO1', 'P2HO2', 'P4HO1', 'P4HO2'};
nIndices = 20;

orbits = struct;

for oti = 1:numel(orbittypes)
orbittype = orbittypes{oti};
otable = zeros(20, 4);
for ind = 1:nIndices

problem = otp.circularrestricted3body.presets.HaloOrbit('OrbitType', orbittype, 'Index', ind);

y0 = problem.Y0;
y0 = [y0(1); y0(3); y0(5)];
period = problem.TimeSpan(2);
f = problem.RHS.F;

J = @(yc) cost(yc, y0);
nonlc = @(yc) constr(yc, f, period);

opts = optimoptions("fmincon", "Algorithm","interior-point", ...
"FunctionTolerance", 1e-8, "ConstraintTolerance", 1e-14, 'Display','off');
[ynew, fev] = fmincon(J, y0, [], [], [], [], [], [], nonlc, opts);

otable(ind, :) = [period, ynew.'];

end
orbits.(orbittype) = otable;
end

function c = cost(yc, y0)

c = sum((yc - y0).^2);

end

function [c, ceq] = constr(yc, f, period)

yc = [yc(1); 0; yc(2); 0; yc(3); 0];

c = [];

sol = ode45(f, [0, period], yc, ...
odeset('AbsTol', 1e-14, 'RelTol', 100*eps));

ceq = sum((yc - sol.y(:, end)).^2);

end


30 changes: 30 additions & 0 deletions toolbox/+otp/+circularrestricted3body/+presets/Arenstorf.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
classdef Arenstorf < otp.circularrestricted3body.CR3BPProblem
% One period of a satellite moving in an Earth-Moon system on a planar
% orbit. The original orbit was derived in :cite:p:`Are63` for the
% planar circular restricted three body problem, and the setting from
% which this preset is derived is taken form pages 129--130 of
% :cite:p:`HNW93`.

methods
function obj = Arenstorf(varargin)
% Create the Arenstorf CR3BP problem object.

params = otp.circularrestricted3body.CR3BPParameters(...
'Mu', 0.012277471, ...
'SoftFactor', 0, ...
varargin{:});
cls = class(params.Mu);

% Decimals converted to rational to support multiple data types
y0 = [cast(497, cls) / cast(500, cls); ...
cast(0, cls); ...
cast(0, cls); ...
cast(-823970832321143, cls) / cast(411659154384760, cls)];
tspan = [cast(0, cls); ...
cast(4541277234950502, cls) / cast(266113073862361, cls)];

obj = [email protected](tspan, y0, params);
end

end
end
19 changes: 19 additions & 0 deletions toolbox/+otp/+circularrestricted3body/+presets/Canonical.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
classdef Canonical < otp.circularrestricted3body.CR3BPProblem
% A trivial preset with a stable oscillating orbit around a lagrange point.

methods
function obj = Canonical(varargin)
% Create the Canonical CR3BP problem object.

mu = 0.5;

y0 = [0; 0; 0; 0; 0; 1];
tspan = [0, 10];
params = otp.circularrestricted3body.CR3BPParameters(...
'Mu', mu, ...
'SoftFactor', 1e-3, ...
varargin{:});
obj = [email protected](tspan, y0, params);
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
classdef CircularEarthOrbit < otp.circularrestricted3body.CR3BPProblem
% This preset builds a circular earth orbit in CR3BP based on
% the equations derived in :cite:p:`She20`.

methods
function obj = CircularEarthOrbit(varargin)
% Create the CircularEarthOrbit CR3BP problem object.
%
% Parameters
% ----------
% OrbitalRadius : numeric(1, 1)
% The radius of the orbit above Earth's surface in km.
% The default radius is 340 km, which is approximately where
% the ISS is/was located.

p = inputParser();
p.KeepUnmatched = true;
p.addParameter('OrbitalRadius', 340, @(x) isnumeric(x) && isscalar(x));
p.parse(varargin{:});
results = p.Results;
varargin = [fieldnames(p.Unmatched), struct2cell(p.Unmatched)].';

equatorialRadius = 6378;
earthMoonDist = 385000;
orbitalradius = results.OrbitalRadius;

% set the relative distance from earth to the moon
delta = (equatorialRadius + orbitalradius)/earthMoonDist;

mE = otp.utils.PhysicalConstants.EarthMass;
mL = otp.utils.PhysicalConstants.MoonMass;
G = otp.utils.PhysicalConstants.GravitationalConstant;

% derive mu
muE = G*mE;
muL = G*mL;
mu = muL/(muE + muL);

% set initial distance to Earth
x0 = -mu + delta;

% derive the initial velocity
y0 = -sqrt((1 - mu)/delta);

% derive the orbital period
period = sqrt(((abs(delta))^3)/(1 - mu))*2*pi;

y0 = [x0; 0; 0; 0; y0; 0];
tspan = [0, period];
params = otp.circularrestricted3body.CR3BPParameters(...
'Mu', mu, ...
'SoftFactor', 1e-3, ...
varargin{:});
obj = [email protected](tspan, y0, params);
end
end
end
Loading