% Groupwork 2 - temp. equilibrium
constants

%% Spacecraft (based on BepiColombo)
Q = 1000; % [W] Worst-case internal power dissipation. (based on what? bepicolombo?)

%% Silver coated FEP
a_sat=0.08; e_sat=0.78;
%% Polished titanium
%a_sat = 0.6; e_sat = 0.6;
%% Aluminized kapton
%a_sat=0.40;	e_sat=0.63;
%% Polished aluminium
%a_sat = 0.24; e_sat=0.08; %%BAD
%% Gold
%a_sat = 0.25; e_sat=0.04; 

%% Spacecraft dimensions
A_s = 1; % Area of spacecraft towards sun
A_p = 1; % Area towards planet.
A_sc = 10; % Total area of spacecraft

%% Mercury
albedo_merc = 0.09; % Albedo of Mercury
e_merc = 0.82;  % Emissivity of Mercury [http://adsabs.harvard.edu/full/1974BAAS....6Q.375H]

T_merc = 440; % Surface temp. of Mercury [k]

altitude = [200 15000]*1e3;%(200:15000)*10^3; % spacecraft altitudes in elipptical orbit around Mercury [m]

sigma = 5.67e-8; % Stefan-Boltzmann constant [W m^-2 K^-4]. Emitted power per unit area from black-body.
T_sun = sun.Temp; % Surface temp. of Sun. [k]


%% Solar radiation
J_sun_merc = (sigma*T_sun^4)*(4*pi*sun.R^2)/(4*pi*merc.a^2);  % Solar radiation [Wm^-2]
J_sun_merc = solar_constant/((0.39*AU)/AU)^2 % Algebraically same as above.
solar_radiation = A_s*a_sat*J_sun_merc;

%% Albedo radiation
% J_a = Js * albedo* F % Very hard to determine. Albedo low, minimized further by visibility factor. Ignore?
J_a = J_sun_merc * albedo_merc * 0.1; % Visibility factor F simply a guess...
albedo_radiation = A_p * a_sat * J_a;

%% Thermal radiation of mercury
J_merc_sat = (sigma*merc.Temp^4)*(4*pi*merc.R^2)./(4*pi*(merc.R+altitude  ).^2) % Irradiance of merc on satellite at given altitude.
%J_merc_sat = (sigma*merc.Temp^4)*(4*pi*merc.R^2)/(4*pi*(merc.R+15000e3)^2); % Irradiance of merc on satellite at given altitude.
thermal_radiation_merc = A_p * e_merc .* J_merc_sat;

%% Final thermal equilibrium
T_sat = (solar_radiation + thermal_radiation_merc + albedo_radiation + Q);
%T_sat = (thermal_radiation_merc + albedo_radiation + Q); % Ignore solar_radiation when in shadow.
T_sat = (T_sat./(A_sc*e_sat*sigma)).^(1/4); % [K]

k2c(T_sat) % Convert kelvin->celcius.

