Skip to content

Commit

Permalink
Implemented UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Georges Labrèche committed Apr 15, 2018
1 parent c1458ac commit 1b8165a
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 152 deletions.
17 changes: 8 additions & 9 deletions eclipse.m
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
function dTdt = eclipse(time_eclipse, initial_T)
%ECLIPSE Thermal transient for the satellite's eclipse period.
load('satellite_properties');
function dTdt = eclipse(time_eclipse, initial_T, satprop)
%ECLIPSE Thermal transient analysis for the satellite's eclipse period.

% Stefan-Boltzmann constant
sigma = 5.67e-8; % W/(m^2*K^4)

% No power absorbed by the surface.
% No power absorbed by the surface (qa).
% Because during eclipse the Solar Constant S = 0.
% So sat.qa = 0.
% So qa = 0.

% Power emitted by the surface:
qe = sat.epsilon * sat.Ae * sigma * initial_T^4;
qe = satprop.coating.epsilon * satprop.Ae * sigma * initial_T^4;

% No external heating source during eclise so sat.qs = 0.
% This means that (sat.qs / (sat.m * sat.c) = 0
% No external heating source during eclise so satprop.radiating_heat = 0.
% This means that satprop.radiating_heat / (satprop.mass * satprop.thermal_capacity) = 0

% The transient expression becomes:
dTdt = -qe / (sat.m * sat.c);
dTdt = -qe / (satprop.mass * satprop.thermal_capacity);

end
115 changes: 0 additions & 115 deletions main_thermal_transient_student.m

This file was deleted.

21 changes: 0 additions & 21 deletions satellite_properties.m

This file was deleted.

Binary file removed satellite_properties.mat
Binary file not shown.
43 changes: 43 additions & 0 deletions simulate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
function [time_span, T_C] = simulate(orbit, satprop)
%SIMULATE Simulates the satellite's thermal transience and returns it's
% temperature data over time (in Celsius and minutes respectively).

% List that will contain data to plott.
time_span = []
T_K = []

% ode45 options.
options = odeset('RelTol', 1e-8, 'AbsTol', 1e-8); % Accuracy.

m = 0;
n = 0;

for i = (1: 1: orbit.num)

% Eclipse phase.
if exist('T_sun', 'var') == 1
satprop.T0_K = T_sun(end);
end

tspan = [m * orbit.T_ecl + n * orbit.T_sun_ill: 1: (m+1) * orbit.T_ecl + n * orbit.T_sun_ill];
[time_eclipse, T_eclipse] = ode45(@(t,y) eclipse(t, y, satprop), tspan, satprop.T0_K, options);

m = m + 1;

% Sun illuminated phase.
satprop.T0_K = T_eclipse(end);
tspan = [m * orbit.T_ecl + n * orbit.T_sun_ill: 1: m * orbit.T_ecl + (n+1) * orbit.T_sun_ill];
[time_sun, T_sun] = ode45(@(t,y) sun(t, y, satprop), tspan, satprop.T0_K, options);

n = n + 1;

time_span = [time_span; time_eclipse; time_sun];
T_K = [T_K; T_eclipse; T_sun];
end

% Time span in minutes.
time_span = time_span / 60;

% Temperature in Celsius.
T_C = T_K - 273;
end
13 changes: 6 additions & 7 deletions sun.m
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
function dTdt = sun(time_sun, initial_T)
%SUN Thermal transient for the satellite's sun illuminated period.
load('satellite_properties');

function dTdt = sun(time_sun, initial_T, satprop)
%SUN Thermal transient analysis for the satellite's sun illuminated period.

% Stefan-Boltzmann constant.
sigma = 5.67e-8; % W/(m^2*K^4)

% Solar constant.
S = 1378;

% Power absorbed by the surface.
qa = sat.alpha * sat.Aa * S;
qa = satprop.coating.alpha * satprop.Aa * S;

% Power emitted by the surface.
qe = sat.epsilon * sat.Ae * sigma * initial_T^4;
qe = satprop.coating.epsilon * satprop.Ae * sigma * initial_T^4;

dTdt = (1 / (sat.m * sat.c)) * (qa - qe) + (sat.qs / (sat.m * sat.c));
dTdt = (1 / (satprop.mass * satprop.thermal_capacity)) * (qa - qe) + (satprop.radiating_heat / (satprop.mass * satprop.thermal_capacity));
end

Binary file modified ui.mlapp
Binary file not shown.

0 comments on commit 1b8165a

Please sign in to comment.