📄 xebudget.m
字号:
% xebudget.m
% Scope: This MATLAB program determines the error budget for a specified
% input data set.
% Usage: xebudget
% Inputs: - input data from keyboard as follows
% (1) space segment error
% (2) control segment error
% (3) user segment, tropo error
% (4) user segment, iono error
% (5) user segment, multipath error
% (6) user segment, receiver error
% (7) PDOP value
% (8) HDOP value
% (9) VDOP value
% (10) TDOP value
% A complete default data set is provided.
% Outputs: - selected input data
% - computed quantities, namely
% (1) URE (User Range Error), in meters
% (2) UEE (User Equipment Error), in meters
% (3) URE (User Equivalent Range Error), in meters
% (4) SEP (Spherical Error Probable, 50 percentage), in meters
% (5) CEP (Circular Error Probable, 50 percentage), in meters
% (6) LEP (Linear Error Probable, 50 percentage), in meters
% (7) Time Error (50 percentage), in nanoseconds
% (8) 3-D (Spherical) Position Error (95 percentage), in meters
% (9) 2-D (Horizontal) Position Error (95 percentage), in meters
% (10) Actual 2-D (Horizontal) Position Error (95 percentage), in meters
% (11) Vertical Position Error (95 percentage), in meters
% (12) Actual Vertical Position Error (95 percentage), in meters
% (13) Time Error (95 percentage), in nanoseconds
% (14) Actual Time Error (95 percentage), in nanoseconds
% Remarks:
% 1) For 2-D Horizontal Position Error (95 percentage) the real percentage is in
% the range of 95.4% to 98.2%. The "Actual" is adjusted for a circular distribution.
% 2) For Vertical Position Error (95 percentage) and Time Error (95 percentage) the
% real percentage is 95.4% rather than 95%. The "Actual" quantities are adjusted
% for this difference.
% Last update: 01/17/01
% Copyright (C) 1996-01 by LL Consulting. All Rights Reserved.
clear
yes = 'y';
disp(' ');
answer1 = input('Do you want to use the default data set? (y/n)[y] --> ','s');
if isempty(answer1)
answer1 = yes;
end
disp(' ');
if (strcmp(answer1,yes) == 1)
% Default data (C/A, single frequency, state 5, no SA)
space_segment = 1.9;
control_segment = 3.5;
tropo = 2.;
iono = 5.;
multipath = 1.4;
pr_error = 3.;
pdop = 2.18;
hdop = 1.36;
vdop = 1.7;
tdop = 0.95;
else
space_segment = input('Enter space segment error, in meters (1-sigma) --> ');
control_segment = input('Enter control segment error, in meters (1-sigma) --> ');
tropo = input('Enter tropo error, in meters (1-sigma) --> ');
iono = input('Enter iono error, in meters (1-sigma) --> ');
multipath = input('Enter multipath error, in meters (1-sigma) --> ');
pr_error = input('Enter receiver (pseudorange) error, in meters (1-sigma) --> ');
pdop = input('Enter PDOP value --> ');
hdop = input('Enter HDOP value --> ');
vdop = input('Enter VDOP value --> ');
tdop = input('Enter TDOP value --> ');
disp(' ');
end
% Computation of error budget quantities
ure = sqrt(space_segment^2 + control_segment^2);
uee = sqrt(tropo^2 + iono^2 + multipath^2 + pr_error^2);
uere = sqrt(ure^2 + uee^2);
sep = 0.8881 * pdop * uere;
cep = 0.8325 * hdop * uere;
lep = 0.6745 * vdop * uere;
spherical95 = 1.614 * pdop * uere;
herror95 = 2. * hdop * uere;
true_herror95 = 1.7308 * hdop * uere;
verror95 = 2. * vdop * uere;
true_verror95 = 0.995807 * verror95;
terror50 = 0.6745 * 3.3 * tdop * uere;
terror95 = 2. * 3.3 * tdop * uere;
true_terror95 = 0.995807 * terror95;
% Save computed results into an external file or display on screen
disp('Enter the output desired (output file or on screen)');
answer2 = input('Do you want to display the results on screen? (y/n)[y] --> ','s');
disp(' ');
if isempty(answer2)
answer2 = yes;
end
disp(' ');
if (strcmp(answer2,yes) == 1)
f2 = 1; % on screen
else
f2 = input('Specify the output filename --> ','s');
disp(' ');
end
% Display/save the results
fprintf(f2,'\n****************************************************************************\n');
fprintf(f2,'\n***** COMPUTATION OF ERROR BUDGET *****\n');
fprintf(f2,'\n****************************************************************************\n');
fprintf(f2,'\n***** Input data ******\n');
fprintf(f2,'\nSpace space segment error (meters, 1-sigma) = %7.3f\n',space_segment);
fprintf(f2,'Space control segment error (meters, 1-sigma) = %7.3f\n',control_segment);
fprintf(f2,'User segmnent, tropo error (meters, 1-sigma) = %7.3f\n',tropo);
fprintf(f2,'User segmnent, iono error (meters, 1-sigma) = %7.3f\n',iono);
fprintf(f2,'User segmnent, multipath error (meters, 1-sigma) = %7.3f\n',multipath);
fprintf(f2,'User segmnent, receiver error (meters, 1-sigma) = %7.3f\n\n',pr_error);
fprintf(f2,'PDOP = %8.4f\n',pdop);
fprintf(f2,'HDOP = %8.4f\n',hdop);
fprintf(f2,'VDOP = %8.4f\n',vdop);
fprintf(f2,'TDOP = %8.4f\n\n',tdop);
fprintf(f2,'***** Results by using XEBUDGET ******\n\n');
fprintf(f2,'URE (User Range Error), in meters = %8.4f\n',ure);
fprintf(f2,'UEE (User Equipment Error), in meters = %8.4f\n',uee);
fprintf(f2,'UERE (User Equivalent Range Error), in meters = %8.4f\n\n',uere);
fprintf(f2,'SEP (Spherical Error Probable), 3-D 50 percentage, in meters = %8.4f\n',sep);
fprintf(f2,'CEP (Circular Error Probable, 2-D 50 percentage, in meters = %8.4f\n',cep);
fprintf(f2,'LEP (Linear Error Probable), Vertical 50 percentage, in meters = %8.4f\n',lep);
fprintf(f2,'Time Error (50 percentage), in nanoseconds = %7.3f\n\n',terror50);
fprintf(f2,'3-D (Spherical) Position Error (95 percentage), in meters = %7.3f\n',...
spherical95);
fprintf(f2,'2-D (Horizontal) Position Error (95 percentage), in meters = %7.3f\n',...
herror95);
fprintf(f2,'Actual 2-D (Horizontal) Position Error (95 percentage), in meters = %7.3f\n',...
true_herror95);
fprintf(f2,'Vertical Position Error (95 percentage), in meters = %7.3f\n',verror95);
fprintf(f2,'Actual Vertical Position Error (95 percentage), in meters = %7.3f\n',...
true_verror95);
fprintf(f2,'Time Error (95 percentage), in nanoseconds = %7.3f\n',terror95);
fprintf(f2,'Actual Time Error (95 percentage), in nanoseconds = %7.3f\n',true_terror95);
fprintf(f2,'\n****************************************************************************\n');
disp(' ');
disp('End of the program XEBUDGET');
disp(' ');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -