Contents

Demonstrate the use of FFMaintenanceSim to analyze disturbance effects.

%--------------------------------------------------------------------------
%  See also Mag, FFMaintenancePlotter, FFMaintenanceSim, FFMaintenanceTests
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
%   Copyright (c) 2008 Princeton Satellite Systems, Inc.
%   All rights reserved.
%--------------------------------------------------------------------------
%   Since version 7.
%--------------------------------------------------------------------------

Initialize simulation data structure

s = FFMaintenanceTests;
The following cases are stored:
=========================================================
default'
iplf to cipe reconfig
iplf to cipe reconfig low noise
iplf to cipe reconfig high noise
iplf to cipe reconfig full dist
iplf to cipe reconfig full dist low noise
iplf to cipe reconfig full dist high noise
differential drag demo
=========================================================

Set initial state to 500 m leader follower

sma = s.el0(1);   % semi major axis
s.dEl0 = zeros(1,6);
s.dEl0(2) = .5/sma;

Set formations goals to be 250 m relative ellipse

s.goals.y0 = 0;      % center of ellipse in along-track direction
s.goals.aE = .25;    % size of ellipse
s.goals.beta = 0;    % phase on ellipse at equator crossing
s.goals.zInc = .1;   % cross-track oscillation (inclination difference)
s.goals.zLan = -.1;  % cross-track oscillation (right ascension difference)

Simulate

d = FFMaintenanceSim(s);
5.0 orbits remaining ... should be done in 0 hours, 1 minutes, 18 seconds
4.0 orbits remaining ... should be done in 0 hours, 0 minutes, 1 seconds
3.0 orbits remaining ... should be done in 0 hours, 0 minutes, 0 seconds
2.0 orbits remaining ... should be done in 0 hours, 0 minutes, 0 seconds
1.0 orbits remaining ... should be done in 0 hours, 0 minutes, 0 seconds
Annual Delta-V: 306.3087 m/s

Add noise

s.noise(3) = 1e-1;   % 10 cm  relative position noise
s.noise(4) = 1e-2;   % 10 mm/s relative navigation noise

Simulate with noise

d2 = FFMaintenanceSim(s);
5.0 orbits remaining ... should be done in 0 hours, 0 minutes, 17 seconds
4.0 orbits remaining ... should be done in 0 hours, 0 minutes, 0 seconds
3.0 orbits remaining ... should be done in 0 hours, 0 minutes, 0 seconds
2.0 orbits remaining ... should be done in 0 hours, 0 minutes, 0 seconds
1.0 orbits remaining ... should be done in 0 hours, 0 minutes, 0 seconds
Annual Delta-V: 368.0576 m/s

Add differential drag

s.noise(1:4)   = 0;     % reset to zero noise
s.distOpt(2)   = 1;     % flag to model differential drag
s.area
s.area(2) = 10;         % set area differential to 5 sq. meters.
ans =
     5     5

Simulate with differential drag

d3 = FFMaintenanceSim(s);
5.0 orbits remaining ... should be done in 0 hours, 0 minutes, 29 seconds
4.0 orbits remaining ... should be done in 0 hours, 0 minutes, 0 seconds
3.0 orbits remaining ... should be done in 0 hours, 0 minutes, 0 seconds
2.0 orbits remaining ... should be done in 0 hours, 0 minutes, 0 seconds
1.0 orbits remaining ... should be done in 0 hours, 0 minutes, 0 seconds
Annual Delta-V: 363.5326 m/s

View results...

FFMaintenancePlotter( d );
% repeat for d2, d3 as desired

figure
stairs(d.dVt,cumsum(Mag(d.dV))*1e3), hold on,
stairs(d2.dVt,cumsum(Mag(d2.dV))*1e3,'g'),
stairs(d3.dVt,cumsum(Mag(d3.dV))*1e3,'r'),
legend('Reconfigure','Reconfigure with Noise','Reconfigure with Drag','location','best')
xlabel('Time [sec]'), ylabel('Delta-V [m/s]')
title('Cumulative Delta-V')
grid on

figure
title('Tracking Error')
plot(d.time,Mag(d.rH_des-d.rH)*1e3),  hold on
plot(d2.time,Mag(d2.rH_des-d2.rH)*1e3,'g')
plot(d3.time,Mag(d3.rH_des-d3.rH)*1e3,'r')
legend('Reconfigure','Reconfigure with Noise','Reconfigure with Drag','location','best')
xlabel('Time [sec]'), ylabel('Pos. Error [m]')
grid on

%--------------------------------------