-
Notifications
You must be signed in to change notification settings - Fork 4
/
environment_EM_spacecraft_smallsat.m
68 lines (54 loc) · 1.61 KB
/
environment_EM_spacecraft_smallsat.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
% This file creates the environment and spacecraft and saves it
% NOTE:
%
%
%
% EARTH-MOON SYSTEM
%
%
%
%
%% Let there be kites
earth = celestial_body;
earth.radius = 6378.13643; % [km]
earth.mu = 3.986e5; % [km^3/s^2]
moon = celestial_body;
moon.radius = 1738; % [km]
moon.mu = 4902.799; % [km^3/s^2]
sun = celestial_body;
sun.radius = 696000; % [km]
sun.mu = 1.327e11; % [km^3/s^2]
mu_EM = moon.mu/(moon.mu + earth.mu);
mu_SE = earth.mu/(earth.mu + sun.mu);
L_EM = 384400; % [km], Earth-Moon distance
L_SE = 149598023; % [km], Sun-Earth distance
L_points = lagrangePoints(mu_EM);
x_L1 = L_points(1,1);
x_L2 = L_points(1,2);
G = 6.67408e-20;
%% Define spacecraft
g0 = 9.80665; % [m/s^2] g0 for Isp
% spacecraft params from 6020 final paper
smallsat = spacecraft;
smallsat.mass = 200; % [kg]
smallsat.max_thrust = 250; % [mN]
smallsat.Isp = 2550;%2551;%1250; % [s]
smallsat.Ve = smallsat.Isp*g0; % [m/s]
%%
% Normalization stuff (divide by these to get normalized versions)
LU = L_EM;
T_EM = 2*pi*sqrt(LU^3/(earth.mu+moon.mu));
DU = L_EM; % [km]
TU = 1/(2*pi/T_EM); % [s]
VU = DU/TU; % [km/s]
AU = DU/TU^2; % [km/s^2]
MU = smallsat.mass; % [kg]
FU = MU*DU/TU^2; % [kg*km/s^2] = [kN]
normalizers = struct('TU',TU,'VU',VU,'AU',AU,'FU',FU','MU',MU);
% Normalize quantities of interest
m_sc = smallsat.mass/MU;
exh_vel = smallsat.Ve/1000/VU; % convert to km/s, then to nondimensional velocities
max_thrust_mag = smallsat.max_thrust/1000/1000/FU; % convert to kN, then to nondimensional force units
%% Save workspace to .mat file
save('environment_EM_spacecraft_smallsat.mat')
fprintf('Environment and spacecraft variables saved to file.\n')