%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Name: plotDSMCTime.m
% Author: J. Kristoffer Hultgren
%
% Description:
%
% Plots the DSMC model data wrt time in orbit.
%
% Input:  dataD - DSMC model data
%         r     - Radius of orbit
%
% Output: -
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function plotDSMCTime(dataD,r)

global CO;              % Global constants

Drho = dataD(:,9);      % DSMC model neutral density
DT = dataD(:,8);        % DSMC model neutral temperature

P = 2*pi*sqrt(r^3/(CO.G*CO.M))/60/60;  % Calculates the period of the orbit

figure('name','DSMC')

TH = linspace(0,360,max(size(dataD)));
subplot(3,1,1), plot(TH,Drho,'b')
title('DSMC')
ylabel('Neutral density (m^{-3})')
grid on
hold on
subplot(3,1,2), plot(TH,DT,'g')
grid on
xlabel('\theta (deg)')
ylabel('Temperature (T)')
axes('position',[.13  .3  .775  .0001])
axis([0 P*40/36 0 0001])
xlabel('Time (h)')