Demonstrate a pointing budget for a typical satellite.

A pointing budget must account for all misalignments and attitude errors.

Since version 2.
-------------------------------------------------------------------------
See also PBudget.
-------------------------------------------------------------------------
%-------------------------------------------------------------------------------
%   Copyright 1994, 2007 Princeton Satellite Systems, Inc. All rights reserved.
%-------------------------------------------------------------------------------

errors      = [];
desc        = {};
categ       = {};

k           = 1;
desc{k}     = 'ESA temperature effects';
categ{k}    = 'Bias';
errors(k,:) = [0.0150 0.0150 0.0000];

k           = k + 1;
desc{k}     = 'ESA optics w.r.t. cube';
categ{k}    = 'Bias';
errors(k,:) = [0.0250 0.0250 0.0000];

k           = k + 1;
desc{k}     = 'ESA cube to MRC';
categ{k}    = 'Bias';
errors(k,:) = [0.0250 0.0250 0.0000];

k           = k + 1;
desc{k}     = 'Antenna B.S. w.r.t. antenna RC';
categ{k}    = 'Bias';
errors(k,:) = [0.0180 0.0180 0.0000];

k           = k + 1;
desc{k}     = 'Antenna RC w.r.t. MRC';
categ{k}    = 'Bias';
errors(k,:) = [0.0150 0.0150 0.0000];

k           = k + 1;
desc{k}     = 'MWA spin axis w.r.t. mirror';
categ{k}    = 'Bias';
errors(k,:) = [0.0060 0.0060 0.0000];

k           = k + 1;
desc{k}     = 'MWA mirror w.r.t. MRC';
categ{k}    = 'Bias';
errors(k,:) = [0.0170 0.0170 0.0000];

k           = k + 1;
desc{k}     = 'Attitude sensing (earth radiance)';
categ{k}    = 'Bias';
errors(k,:) = [0.0012 0.0012 0.0000];

k           = k + 1;
desc{k}     = 'East/west position';
categ{k}    = 'Diurnal';
errors(k,:) = [0.0100 0.0100 0.0000];

k           = k + 1;
desc{k}     = 'Attitude sensing (earth radiance)';
categ{k}    = 'Diurnal';
errors(k,:) = [0.0100 0.0100 0.0000];

k           = k + 1;
desc{k}     = 'Orbit inclination';
categ{k}    = 'Diurnal';
errors(k,:) = [0.0100 0.000 0.0100];

k           = k + 1;
desc{k}     = 'S/C disturbance torque';
categ{k}    = 'Diurnal';
errors(k,:) = [0.0080 0.0000 0.1470];

k           = k + 1;
desc{k}     = 'S/C disturbance torque';
categ{k}    = 'Bias';
errors(k,:) = [0.0031 0.00761 0.0000];
kSK1        = k;

k           = k + 1;
desc{k}     = 'Antenna thermal distortion w.r.t. ESA RC';
categ{k}    = 'Diurnal';
errors(k,:) = [0.0100 0.0100 0.0000];

k           = k + 1;
desc{k}     = 'Thermal distortion MWA w.r.t. ESA RC';
categ{k}    = 'Diurnal';
errors(k,:) = [0.0200 0.0500 0.0000];

k           = k + 1;
desc{k}     = 'Attitude sensor & actuator noise/resolution';
categ{k}    = 'Short Term';
errors(k,:) = [0.0200 0.0200 0.0000];

k           = k + 1;
desc{k}     = 'SA stepping transients';
categ{k}    = 'Short Term';
errors(k,:) = [0.0000 0.0500 0.0000];

k           = k + 1;
desc{k}     = 'S/C disturbance torques';
categ{k}    = 'Short Term';
errors(k,:) = [0.0000 0.0000 0.0000];

fPath       = fileparts(which(mfilename));
[cep,r,s,t] = PBudget(errors,desc,categ,0,0,...
                      fullfile(fPath,'NormalBudget.txt'));

DispWithTitle(cep,'CEP');
DispWithTitle(r,'Azimuth and elevation errors');
DispWithTitle(s,'Summary by category');
DispWithTitle(t,'Totals');


errors(k,:) = [0.0180 0.0032 0.0140];

[cep,r,s,t] = PBudget(errors,desc,categ,0,0,...
                      fullfile(fPath,'StationkeepingBudget.txt'));

DispWithTitle(cep,'CEP');
DispWithTitle(r,'Azimuth and elevation errors');
DispWithTitle(s,'Summary by category');
DispWithTitle(t,'Totals');

%--------------------------------------
% PSS internal file version information
%--------------------------------------
CEP
         0.306793044721658
Azimuth and elevation errors
         0.155841638378207
        0.0979742227334929
Summary by category
        0.0485803458200948        0.0490749640855702                         0
        0.0293938769133981        0.0529150262212918         0.147339743450299
                      0.02         0.053851648071345                         0
Totals
        0.0979742227334929         0.155841638378207         0.147339743450299
CEP
         0.313203125776406
Azimuth and elevation errors
         0.155936630610036
          0.10488147082764
Summary by category
        0.0485803458200948        0.0490749640855702                         0
        0.0293938769133981        0.0529150262212918         0.147339743450299
        0.0269072480941474        0.0539466403031737                     0.014
Totals
          0.10488147082764         0.155936630610036         0.161339743450299