-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathst2_astra_main_saturn_system.m
More file actions
65 lines (47 loc) · 2.5 KB
/
Copy pathst2_astra_main_saturn_system.m
File metadata and controls
65 lines (47 loc) · 2.5 KB
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
clearDeleteAdd; % --> !!! ONLY CALL IT ONCE FOR SPEED
%% --> input section
% --> clear INPUT and define new ones
try clear INPUT; catch; end; clc;
% --> sequence to be optimized
INPUT.idcentral = 6; % --> central body (Saturn in this case)
seq = [ 5 4 4 3 ]; res = [ 13 7 2 ];
%%%%%%%%%% multi-rev. options %%%%%%%%%%
maxrev = 4; % --> max. number of revolutions (round number)
chosenRevs = differentRuns_v2(seq, maxrev); % --> generate successive runs
[INPUT.chosenRevs, INPUT.res] = processResonances(chosenRevs, res); % --> process the resonances options
[INPUT.chosenRevs] = maxRevOuterPlanets(seq, INPUT.chosenRevs, INPUT.idcentral); % --> only zero revs. on outer planets
%%%%%%%%%% multi-rev. options %%%%%%%%%%
%%%%%%%%%% set departing options %%%%%%%%%%
t0 = date2mjd2000([2023 1 1 0 0 0]); % --> initial date range (MJD2000)
tf = t0 + 1*365.25; % --> final date range (MJD2000)
dt = 2.5; % --> step size (days)
INPUT.depOpts = [t0 tf dt];
%%%%%%%%%% set departing options %%%%%%%%%%
%%%%%%%%%% set options %%%%%%%%%%
INPUT.opt = 2; % --> (1) is for SODP, (2) is for MODP, (3) is for DATES, (4) is for YEARS - MODP
INPUT.vInfOpts = [0 2]; % --> min/max departing infinity velocities (km/s)
INPUT.dsmOpts = [1 Inf]; % --> max defect DSM, and total DSMs (km/s)
INPUT.plot = [1 1]; % --> plot(1) for Pareto front, plot(2) for best traj. DV
INPUT.parallel = true; % --> put true for parallel, false otherwise
INPUT.tstep = dt; % --> step size for Time of flight
%%%%%%%%%% set options %%%%%%%%%%
% --> specify custom bounds for TOFs and VINFs
INPUT.TOF_LIM = [[30 60]; [20 40]; [20 40]];
%% --> optimize using ASTRA
% --> launch ASTRA optimization
OUTPUT = ASTRA_DP(seq, INPUT);
%% --> extract desired path and plot
close all; clc;
% --> extract path from Pareto front
[path, revs, res] = pathfromPF(OUTPUT);
% --> plot the Pareto front
figPareto = plotPareto(OUTPUT(1).ovPF);
% --> plot the path
[figECI, STRUC, figSYN, figRSC, figVSC] = plotPath(path, INPUT.idcentral);
% --> save the output
generateOutputTXT(path, INPUT.idcentral, './results');
% --> save the figures
name = [pwd '/results/Images/figECIsat.png'];
exportgraphics(figECI, name, 'Resolution', 1200);
name = [pwd '/results/Images/figSYNsat.png'];
exportgraphics(figSYN, name, 'Resolution', 1200);