|
| 1 | +%% Orbit Inputs |
| 2 | +a0 = 6903000; |
| 3 | +e0 = 0.003621614; |
| 4 | +TA0 = deg2rad(0); |
| 5 | +RAAN_0 = deg2rad(227.05566156); |
| 6 | +Inc = deg2rad(97.49588373); |
| 7 | +AoP = deg2rad(0.001); |
| 8 | +t0 = 0; |
| 9 | +coe = [a0;e0;Inc;RAAN_0;AoP;t0]; |
| 10 | +E_prev = 0; |
| 11 | +J2 = 1.083e-03; |
| 12 | +RE = 6371800; |
| 13 | +mu_earth = 3.986e+14; |
| 14 | +mu_moon = 4.913e+12; |
| 15 | +mu_sun = 1.32712e+20; |
| 16 | +mass = 4; |
| 17 | +w_earth = [0;0;7.2e-05]; |
| 18 | + |
| 19 | +%[0.0378 0 0 ] |
| 20 | +%[0 0.0375 -0.0001] |
| 21 | +%[0 -0.0001 0.0162 ] |
| 22 | + |
| 23 | +%% Disturbance Parameters |
| 24 | +R_pm = [0.01 0.01 0.1]'; % in m |
| 25 | +Cd = 2.1; %drag coeff |
| 26 | +S = [0.0300 0.0300, 0.0100]'; % in m^2, cross sectional area |
| 27 | +S_norm = norm(S); |
| 28 | +c_rk = 1.5; |
| 29 | +F_solar = 1366; % in W/m^2 %solar irradiance |
| 30 | +altitude = a0 - RE; |
| 31 | +%[T, a, P, rho] = atmosisa(altitude); |
| 32 | +year = 2024; |
| 33 | +month = 06; |
| 34 | +day = 01; |
| 35 | +hours = 00; |
| 36 | +minutes = 00; |
| 37 | +seconds = 00; |
| 38 | +jd0 = JDnumber(year,month,day,hours,minutes,seconds); |
| 39 | +%% Dynamics Model Inputs |
| 40 | +%I = diag([0.001731,0.001726,0.000264]); %Moment of inertia [kg-m2] |
| 41 | +%I_inv = inv(I); % Inverse of Interia matrix |
| 42 | +%W0 = [0 0 -1]'; % Initial angular velocity [rad/s] |
| 43 | +%q0 = [1 0 0 0]'; |
| 44 | +%torques = [0 0 0]'; |
| 45 | +K_noise = 1; |
| 46 | + |
| 47 | +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 48 | +% Added for Aero/Solar Torque |
| 49 | +%x_dim=0.1 |
| 50 | +%y_dim=0.1 |
| 51 | +%z_dim=0.3 |
| 52 | + |
| 53 | +wc_solar_area=0.12 |
| 54 | +wc_drag_area=0.042 |
| 55 | + |
| 56 | +sun_to_earth=[151*10^9, 151*10^9, 151*10^9] |
| 57 | +speed_light_inverse=1/299792458 |
| 58 | +% Density of air at 500km |
| 59 | +rho=10^(-12) |
| 60 | + |
| 61 | +% DYNAMICS INPUTS |
| 62 | +W0=[0 0 0] |
| 63 | +I=[[37824169.23*10^-9 -25788.01*10^-9 32047.93*10^-9], |
| 64 | + [-25788.01*10^-9 37537377.89*10^-9 -51485.52*10^-9], |
| 65 | + [-32047.93*10^-9 -51485.52*10^-9, 16200348.41*10^-9]] |
| 66 | +q0=[0 0 0 1] |
| 67 | + |
| 68 | +function [qdot] = QDotSolver(w,q) |
| 69 | + q1 = q(1); |
| 70 | + q2 = q(2); |
| 71 | + q3 = q(3); |
| 72 | + q4 = q(4); |
| 73 | + q_product = [ |
| 74 | + q4, -q3, q2; |
| 75 | + q3, q4, -q1; |
| 76 | + -q2, q1, q4; |
| 77 | + -q1, -q2, -q3 |
| 78 | + ]; |
| 79 | + qdot = 0.5*q_product*w; |
| 80 | +end |
| 81 | + |
| 82 | +function[jd] = JDnumber(year,month,day,hour,minute,second) |
| 83 | +% Calculates the JD number for a given year,month and day |
| 84 | + |
| 85 | +j0 = 367*year - fix(7*(year + fix((month + 9)/12))/4) + fix(275*month/9) + day + 1721013.5; |
| 86 | + |
| 87 | +ut = hour + minute/60 + second/3600; % UTC time in hour format |
| 88 | + |
| 89 | +jd = j0 + ut/24; % JD number calculation |
| 90 | +end |
0 commit comments