-
Notifications
You must be signed in to change notification settings - Fork 0
/
postprocess.m
106 lines (90 loc) · 2.85 KB
/
postprocess.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
%% Astrodynamics | Lambert Solver
% Authors: Casanovas, Marc
% Gago, Edgar
% Ibañez, Carlos
% Date 20/12/2020
%
% Description
% Generation of the main problem plots (both PCS and Validation)
%
%% Core
% PCS
if (plots=="PCP")
for i=1:N
axis_cal(i) = datetime(departures(i)+julian_ref,'ConvertFrom','juliandate','Format','dd-MMM-yyyy');
end
figure(1)
contourf(time,datenum(axis_cal),DV,'edgecolor','none');
datetick('y','dd-mm-yy','keeplimits','keepticks');
xlabel('Time of Flight [days]');
%ylabel('Departure from Earth (Day-Month-Year)');
%ylabel('Departure from Earth (Day-Month-Year)');
ylabel('Departure from Mercury (Day-Month-Year)');
%title('Total DV, Planar [km/s]');
%title('Total DV, 3D Mercury - Earth [km/s]');
title('Total DV, 3D Mercury - Earth [km/s]');
colorbar;
figure(2)
contourf(time,datenum(axis_cal),DV_max,'edgecolor','none');
datetick('y','dd-mm-yy','keeplimits','keepticks');
xlabel('Time of Flight [days]');
ylabel('Departure from Earth (Day-Month-Year)');
%title('Total DV max=50[km/s]');
%title('Total DV, 3D Mercury - Earth, max=50[km/s]');
title('Total DV, 3D Earth - Saturn, max=50[km/s]');
colorbar;
else
% Validation
figure;
plot(z(:,1),Dt);
hold on
plot(z(:,2),Dt);
plot(z(:,3),Dt);
title('Validation test for $\Delta t$')
ylabel('$\Delta t [NU]$');
xlabel('$z = \rho s_2^2$');
string = sprintf('Delta \theta = %0.2d',rad2deg(dtheta));
legend('$\Delta \theta = 180^{\circ}$','$\Delta \theta = 90^{\circ}$','$\Delta \theta = 270^{\circ}$','location','best')
theta1_ = linspace(0,pi,50);
theta2_ = linspace(0,pi/2,50);
theta3_ = linspace(0,3*pi/2,50);
x1 = cos(theta1_);
y1 = sin(theta1_);
x2 = cos(theta2_);
y2 = sin(theta2_);
x3 = cos(theta3_);
y3 = sin(theta3_);
figure;
plot(x2,y2);
hold on;
ylabel("y [NU]");
xlabel("x [NU]");
xlim([-0.1 1.1]);
ylim([0 1.1]);
title('$\Delta \theta = 90^{\circ}$');
plot(linspace(0,1,50),zeros(1,50),'r');
plot(zeros(1,50),linspace(0,1,50),'g');
legend("Transfer","$r_1$","$r_2$",'Location',"best");
figure;
plot(x1,y1);
hold on;
ylabel("y [NU]");
xlabel("x [NU]");
xlim([-1.1 1.1]);
ylim([0 1.1]);
title('$\Delta \theta = 180^{\circ}$');
plot(linspace(0,1,50),zeros(1,50),'r');
plot(linspace(0,-1,50),zeros(1,50),'g');
legend("Transfer","$r_1$","$r_2$",'Location',"best");
figure;
plot(x3,y3);
hold on;
ylabel("y [NU]");
xlabel("x [NU]");
xlim([-1.1 1.1]);
ylim([-1.1 1.1]);
title('$\Delta \theta = 270^{\circ}$');
plot(linspace(0,1,50),zeros(1,50),'r');
plot(zeros(1,50),linspace(0,-1,50),'g');
legend("Transfer","$r_1$","$r_2$",'Location',"best");
end