⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xraimst.m

📁 GPS TOOLBOX包含以下内容: 1、GPS相关常量和转换因子; 2、角度变换; 3、坐标系转换: &#61656 点变换; &#61656 矩阵变换; &#61656 向量变换
💻 M
字号:
%                             xraimst.m
%  Scope:   This MATLAB program determines availability and failure flags
%           (fault detection) for the Receiver Autonomous Integrity Monitoring 
%           (RAIM) baseline standard algorithm (constant alarm rate algorithm) [1] 
%           for non-precision approach phase-of-flight and a specified set of input
%           data.
%  Usage:   xraimst
%  Inputs:   - name of the data file containing line-of-sight unit vectors,
%              each vector is stored in another row (it should be 3 columns);
%              a set of default values is specified
%            - name of the data file containing errors in true ranges; a set
%              of default values is specified
%            - name of the output file (optional); the default is the screen
%            Note: Values for threshold and approximate radial error protected
%                  ceiling are automatically selected (for non-precision approach
%                  phase-of-flight)
%  Outputs:  - values of the selected input data set
%            - status of the availability flag and the test statistic/failure 
%              (detection) flag
%  References: 
%          [1] Brown, R. G., A baseline RAIM scheme and a note on the
%              equivalence of three RAIM methods. Proceedings of the National
%              Technical Meeting, Institute of Navigation, San Diego, CA,
%              Jan. 27-29, 1992, pp. 127-137.
%          [2] Anonym., Minimum operational performance standards for airborne
%              supplemental navigation equipment using Global Positioning System
%              (GPS). Document No. RTCA/DO-208, July 1991, Prepared by SC-159.
%  External Matlab macros used:  raimst
%  Last update: 08/02//00
%  Copyright (C) 1996-00  by LL Consulting. All Rights Reserved.

clear 
yes = 'y';

%  Enter line-of-sight unit vectors

disp('  ');
disp('Enter line-of-sight unit vectors ');
disp('  ');
answer1 = input('Do you want to use the default data? (y/n)[y] --> ','s');
if isempty(answer1)
   answer1 =  yes;
end   
disp('  ');
if (strcmp(answer1,yes) == 1)
    g  = [ 7.787995e-002  -6.017930e-001   7.947552e-001
           1.730016e-001  -9.665970e-001  -1.891052e-001
          -8.457427e-001  -4.893909e-001  -2.126402e-001
          -5.385451e-001  -2.338803e-001   8.094870e-001
           4.345836e-001  -7.366578e-001  -5.181432e-001
           7.052152e-001  -5.433383e-001   4.554723e-001 
          -8.973768e-001   3.366878e-001   2.852302e-001 ];
else
   ff = input('Specify the input filename (with extension) -->  ','s');
   disp('  ');
   g = load(ff);
end
[nrow,ncol] = size(g);

if nrow < 5
   disp('Error - XRAIMST; there are fewer than 5 line-of-sights');
   disp('  ');
   return
end

%  Select threshold and Approximate Radial-error Protected (ARP) ceiling - 
%  for non-precision approach - see reference [1]

if nrow == 5
   threshold = 132.;
   arpceil = 322.;
elseif nrow == 6
   threshold = 102.;
   arpceil = 338.;
elseif nrow == 7
   threshold = 90.;
   arpceil = 353.;
elseif nrow == 8
   threshold = 82.;
   arpceil = 353.;
else     %  nrow >= 9
   threshold = 77.;
   arpceil = 353.;
end

%  Select/generate errors in true ranges

disp('Enter/generate errors in true ranges (in meters) ');
disp('  ');
answer2 = input('Do you want to use the default data? (y/n)[y] --> ','s');
if isempty(answer2)
   answer2 =  yes;
end   
if (strcmp(answer2,yes) == 1)
   epsvec = [ 35. 30. 37. 36. 36. 39. 40.];   %  for SPS with SA on
else
   ff = input('Specify the input filename (with extension) --> ','s');
   disp('  ');
   epsvec = load(ff);
end

%  Save computed results into an external file

disp('  ');
disp('Enter the output desired (datafile or on screen)');
disp('  ');
answer3 = input('Do you want to display the results on screen? (y/n)[y] --> ','s');
if isempty(answer3)
   answer3 =  yes;
end   
disp('  ');
if (strcmp(answer3,yes) == 1)
   f2 = 1;
else
   f2 = input('Specify the output filename -->  ','s');
   disp('  ');
end

%  Determine availability and failure detection flags (fault detection)

[avail,testst] = raimst(g,threshold,arpceil,epsvec);

%  Display or save the results

fprintf(f2,'**************************************************************\n');
fprintf(f2,'\n*****   Input data   ****** \n\n');
for k = 1:nrow
   fprintf(f2,'LOS # %2.0f --> %16.7f %16.7f %16.7f\n',k,g(k,1:3));
end
fprintf(f2,'\nNon-Precision Approach - threshold (in meters)   = %12.5f\n',...
            threshold);
fprintf(f2,'Non-Precision Approach - ARP ceiling (in meters) = %12.5f\n\n',...
            arpceil);
for k = 1:nrow
   fprintf(f2,'Range error # %2.0f (in meters) -->  %12.5f\n',k,epsvec(k));
end

fprintf(f2,'\n*****   Results by using XRAIMST   ****** \n\n');
if  avail == 0                               %  availability flag
   fprintf(f2,'Availability flag --> Available\n');
   if  testst == 1                           %  test statistic/failure flag
       fprintf(f2,'Test statistic --> Failure/Detection\n');
   elseif testst == 0
      fprintf(f2,'Test statistic --> No failure/Detection\n\n');
   end 
elseif  avail == 1
   fprintf(f2,'Availability flag --> Unavailable\n');
   fprintf(f2,'Test statistic --> Not applicable\n\n');
end

fprintf(f2,'**************************************************************\n');

disp('  ');
disp('End of the program  XRAIMST');
disp('  ');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -