MATLAB GPS Software Toolbox User's Guide and Reference Manual
MATLAB GPS Software Toolbox User's Guide and Reference Manual
Also by using the program XGPSTME the data related to the GPS week roll number from
Table 3-5 can be generated.
Chapter 3 GPS Toolbox Examples
- Page 3-12 -
GPS week Roll
number
Date of Start of GPS week 0 Date of End of GPS week 1023
0 Sunday, January 6, 1980 Saturday, August 21,1999
1 Sunday, August 22, 1999 Saturday, April 6, 2019
2 Sunday, April 7, 2019 Saturday, November 20, 2038
3 Sunday, November 21, 2038 Saturday, July 6, 2058
4 Sunday, July 7, 2058 Saturday, February 19, 22078
Table 3-5. Selected GPS Fundamental Dates
3.6 Read Yuma format almanac file and generate two ASCII data only files
The m-file program XREADALM can be used to read the Yuma format almanac input
file and to generate two ASCII data only files (no text description of parameters), namely
1) First file is saving all data contain in the Yuma format input file into a specified file
all data only (no text description of parameters), in the same order as the original
Yuma format input file; each record contains the data related to a satellite. The result
is a data table with 13 columns and number of rows equals to the number of satellites.
2) Second file is saving a reduced almanac set from the Yuma format input file into
another specified data only (no text description of parameters). Each record contains
the data related to a healthy satellite (9 parameters) in the following order:
- satellite id number
- satellite time of applicability (toa), in seconds
- satellite semimajor axis (a), in meters
- satellite eccentricity (e)
- satellite orbital inclination (I_0), in radians
- satellite right ascension at toa (OMEGA_0), in radians
- satellite argument of perigee (omega), in radians
- satellite mean anomaly (M_0), in radians
- satellite rate of right ascension (OMEGA_DOT), radians/ second
For simplicity, in this manual, we are adopting the following naming convention:
The name of all three files (Yuma format input file and two generated files) is formed
as the abbreviation of week, i.e. wk follows by the week number, e.g. wk749.
Note that we assume that the user is not trying to utilize the same week with different
roll number.
The extensions are as follows:
yum for the Yuma format almanac input,
Chapter 3 GPS Toolbox Examples
- Page 3-13 -
alm for the first output file with complete Yuma data (but no text description of
parameters), with 13 columns,
dat for the second output file with reduced Yuma data (but no text description
of parameters), with 9 columns.
For example, by selecting the Yuma format input file wk749.yum the following are
displayed on screen:
xreadalm
Specify the Yuma format almanac input data file,
e.g. wk749.yum --> wk749.yum
Specify the output filename for the complete almanac,
e.g. wk749.alm for wk749.yum --> wk749.alm
Specify the output filename for the reduced almanac,
e.g. wk749.dat for wk749.yum --> wk749.dat
Number of satellites in the almanac = 26
End of program XREADALM
3.7 Read RINEX 2 navigation message file and generate three data files
The m-file program XRINEXN can be used to read a RINEX 2 navigation message file
and write the data into three output data files; one output data file contains the complete
navigation information (in fact the portion related to each satellite data), while the other
two output files contain the reduced ephemeris and reduced almanac data, respectively.
Each record of the output file containing reduced ephemeris data includes the following
data (in this order): svprn, toe, smaxis, ecc, i0, Omega0, omega, M0, OmegaDot, deltan,
idot, cic, cis, crc, crs, cuc, cus (17 columns).
Each record of the output file containing reduced almanac data includes the following
data (in this order): svprn, toe, smaxis, ecc, i0, Omega0, omega, M0, OmegaDot (9
columns).
For example, by selecting the RINEX 2 navigation file RINEXNAV.99n as input file ans
the name of the three output files see XRINEXN1.out, XRINEXN2.out, and
XRINEXN3.out - the following are displayed on screen:
xrinexn
Specify the name of the RINEX 2 navigation,
e.g. rinexnav.99n -->rinexnav.99n
Specify the output filename for the complete data --> xrinexn1.out
Chapter 3 GPS Toolbox Examples
- Page 3-14 -
Specify the output filename for the reduced ephemeris --> xrinexn2.out
Specify the output filename for the reduced almanac --> xrinexn3.out
Number of satellites = 9
End of the program XRINEXN
Figure 3-10 : Longitude-latitude of the selected waypoints with the geodesic distance.
The output data files xgeodes1.out contains the following information:
************************************************************
*****Input data 1
Departure latitude = 3.73319315700000e+001 degrees
Departure longitude = 4.00554434300000e+001 degrees
Destination latitude = 2.61285665100000e+001 degrees
Destination longitude = 4.14765298000000e+001 degrees
*****Output data 1
Range = 1.24949951092708e+006 meters
Departure bearing = 1.73427328245473e+002 degrees
Destination bearing = 1.74178332666459e+002 degrees
************************************************************
************************************************************
*****Input data 2
Departure latitude = 2.61285665100000e+001 degrees
Departure longitude = 4.14765298000000e+001 degrees
Destination latitude = 2.87277324300000e+001 degrees
Destination longitude = 4.23409216200000e+001 degrees
40 40.5 41 41.5 42 42.5 43 43.5 44 44.5 45
26
28
30
32
34
36
38
Longitude - Latitude plot of the selected waypoints (with geodesic distance)
Longitude, in degrees
L
a
t
i
t
u
d
e
,
i
n
d
e
g
r
e
e
s
Total range =2272693.6056 meters
Chapter 3 GPS Toolbox Examples
- Page 3-18 -
*****Output data 2
Range = 3.00424492794101e+005 meters
Departure bearing = 1.63306311690213e+001 degrees
Destination bearing = 1.67289098732353e+001 degrees
************************************************************
************************************************************
*****Input data 3
Departure latitude = 2.87277324300000e+001 degrees
Departure longitude = 4.23409216200000e+001 degrees
Destination latitude = 3.00273481100000e+001 degrees
Destination longitude = 4.33762019200000e+001 degrees
*****Output data 3
Range = 1.75647115063086e+005 meters
Departure bearing = 3.46515496093302e+001 degrees
Destination bearing = 3.51594623160438e+001 degrees
************************************************************
************************************************************
*****Input data 4
Departure latitude = 3.00273481100000e+001 degrees
Departure longitude = 4.33762019200000e+001 degrees
Destination latitude = 3.12563819300000e+001 degrees
Destination longitude = 4.48926152700000e+001 degrees
*****Output data 4
Range = 1.99232530315795e+005 meters
Departure bearing = 4.64680459167103e+001 degrees
Destination bearing = 4.72409947915694e+001 degrees
************************************************************
************************************************************
*****Input data 5
Departure latitude = 3.12563819300000e+001 degrees
Departure longitude = 4.48926152700000e+001 degrees
Destination latitude = 3.35329182400000e+001 degrees
Destination longitude = 4.23481053200000e+001 degrees
*****Output data 5
Range = 3.47889956483015e+005 meters
Departure bearing = -4.28048445472051e+001 degrees
Destination bearing = -4.41684910005959e+001 degrees
************************************************************
Chapter 3 GPS Toolbox Examples
- Page 3-19 -
3.11 Determination of great circle dead reckoning trajectory
The m-file program XGCDR determines great circle dead reckoning trajectory assuming
a spherical earth with radius equals to the local radius and constant altitude; WGS-84
constants are used. The following input data, from keyboard, are required:
- initial latitude, in radians
- initial longitude, in radians
- altitude, in meters
- heading, in radians
- speed, in meters/second
- initial time, in seconds
- time step, in seconds
- number of steps
At the same time a default input data set is provided.
For example if the default input data set is used the following results are obtained on the
screen, and the plot of the great circle dead reckoning trajectory, with the total range
value, is presented in Figure 3-11.
Figure 3-11: Great circle dead reckoning trajectory.
-2.06 -2.059 -2.058 -2.057 -2.056 -2.055 -2.054 -2.053 -2.052
0.59
0.6
0.61
0.62
0.63
0.64
0.65
0.66
0.67
0.68
0.69
Longitude, in radians
L
a
t
i
t
u
d
e
,
i
n
r
a
d
i
a
n
s
Great circle dead reckoning trajectory
Total range =597040.1734 meters
Chapter 3 GPS Toolbox Examples
- Page 3-20 -
xgcdr
Do you want to use the default data? (y/n)[n] y
Do you want to save the generated data? (y/n)[y] n
*****************************************************************************
*****Initial conditions:
Latitude (radians) = 0.59341195
Longitude (radians) = -2.05948852
Altitude (meters) = 5000.00000000
Heading (radians) = 0.05000000
Speed (meters/second) = 200.00000000
Time_init (seconds) = 0.00000000
Time_step (seconds) = 300.00000000
Number of time steps = 10
*****Great Circle Dead Reckoning Trajectory
Time Latitude Longitude Altitude Vel_N Vel_E Distance
(sec) (rad) (rad) (m) (m/sec) (m/sec) (m)
0.000 0.59341195 -2.05948852 5000.000 199.750 9.996 0.000
300.000 0.60279007 -2.05891882 5000.000 199.747 10.060 59679.933
600.000 0.61216803 -2.05834172 5000.000 199.744 10.126 59685.194
900.000 0.62154584 -2.05775696 5000.000 199.740 10.193 59690.492
1200.000 0.63092349 -2.05716430 5000.000 199.737 10.263 59695.826
1500.000 0.64030096 -2.05656347 5000.000 199.733 10.334 59701.194
1800.000 0.64967826 -2.05595417 5000.000 199.729 10.407 59706.593
2100.000 0.65905538 -2.05533614 5000.000 199.725 10.482 59712.023
2400.000 0.66843231 -2.05470906 5000.000 199.721 10.559 59717.481
2700.000 0.67780905 -2.05407262 5000.000 199.717 10.639 59722.965
3000.000 0.68718558 -2.05342650 5000.000 199.712 10.720 59728.473
*****************************************************************************
Do you want to plot the trajectory? (y/n)[y]
Place the text with total range on the graph;
Press <Enter>or <Return>key to start ...
Press <Enter>or <Return>key to continue ...
End of the program XGCDR.M
For example, by using the program XSVEPH with the options: 1) use default data, 2) do
not save the generated data into a specified file, the following output is displayed on
screen.
xsvpeph
Do you want to use the default data? (y/n)[y]
Do you want to save the generated data? (y/n)[y] n
******************************************************************
*****Simulation time = 2.3820500e+005 seconds
*****Satellite ephemeris data for satellite 1
toe = 1.00000000000000e+000 seconds
smaxis = 2.44800000000000e+005 meters
ecc = 2.65603600409000e+007
izero = 5.28036116157000e-003 radians
razero = 9.70306409202000e-001 radians
argper =-3.09805209344000e+000 radians
mzero = 2.88898057517000e+000 radians
radot =-7.84710884484000e-001 radians/second
deln =-7.84889836669000e-009 radians/second
Chapter 3 GPS Toolbox Examples
- Page 3-26 -
idot = 4.22624746874000e-009 radians/second
cic =-5.71452370000000e-012 radians
cis = 3.72529029846000e-008 radians
crc =-2.42143869400000e-008 meters
crs = 1.76593750000000e+002 meters
cuc =-7.20937500000000e+001 radians
cus =-3.73087823391000e-006 radians
ECEF position for the selected satellite 1 based on ephemeris data
x-component = 1.30430014347412e+007 meters
y-component =-1.19330503602754e+007 meters
z-component = 1.98561896412499e+007 meters
******************************************************************
End of the program XSVPEPH
By using the program XSVPCOMP a comparison between the satellite position based on
almanac and ephemeris data can be determined. For example, by using the default data
set, the RSS satellite position difference can be as high as about 175 meters and as low as
about 87 meters see Figure 3-13 with the average of about 137 meters. This result
emphasis the importance of using complete ephemeris data when a precise satellite
position is needed.
xsvpcomp
Do you want to use the default data? (y/n)[y]
Specify number of steps -- >1200
Specify the time-step, in seconds, e.g. 10. -->30
Place the text with statistics on the graph;
Press <Enter>or <Return>key to start ...
Press <Enter>or <Return>key to continue ...
Do you want to save the generated data? (y/n)[y]
Specify the output filename based on ephemeris computation -->xsvcompe.out
Specify the output filename based on almanac computation -->xsvcompa.out
End of the program XSVPCOMP
For example, by using the program XWDOP with the 7 line-of-sight unit vectors
specified by the input data file geom7.dat and the weighting factors entered from
keyboard as (1. 1.2 0.8 1. 1.2 1.1 1.) the following result is displayed on screen:
xwdop
Do you want to save the generated data? (y/n)[n] -->
Chapter 3 GPS Toolbox Examples
- Page 3-33 -
Select the macro to be used:
--> 1 for wdop1.m (when at least 3 LOS measurements)
--> 2 for wdop2.m (when only 4 LOS measurements)
Make selection -->1
Specify the input filename (with extension) -->geom7.dat
Enter the weighting factor for LOS #1: 1
Enter the weighting factor for LOS #2: 1.2
Enter the weighting factor for LOS #3: 0.8
Enter the weighting factor for LOS #4: 1
Enter the weighting factor for LOS #5: 1.2
Enter the weighting factor for LOS #6: 1.1
Enter the weighting factor for LOS #7: 1
***** Input data ****************************************
LOS # 1 --> 0.0778800 -0.6017930 0.7947552
with the weighting factor --> 1.0000000
LOS # 2 --> 0.1730016 -0.9665970 -0.1891052
with the weighting factor --> 1.2000000
LOS # 3 --> -0.8457427 -0.4893909 -0.2126402
with the weighting factor --> 0.8000000
LOS # 4 --> -0.5385451 -0.2338803 0.8094870
with the weighting factor --> 1.0000000
LOS # 5 --> 0.4345836 -0.7366578 -0.5181432
with the weighting factor --> 1.2000000
LOS # 6 --> 0.7052152 -0.5433383 0.4554723
with the weighting factor --> 1.1000000
LOS # 7 --> -0.8973768 0.3366878 0.2852302
with the weighting factor --> 1.0000000
***** Results from the macro WDOP1.m *******************
Weighted Geometric Dilution of Precision (WGDOP) = 2.1382
Weighted Position Dilution of Precision (WPDOP) = 1.9310
Weighted Horizontal Dilution of Precision (WHDOP)= 1.7334
Weighted Vertical Dilution of Precision (WVDOP) = 0.8508
Weighted Time Dilution of Precision (WTDOP) = 0.9182
************************************************************
Do you want another computation? (y/n)[n] -->
End of the program XWDOP
Note that both programs XDOP and XWDOP have an option to use two different macros
depending of the number of LOS are available; the second selection is possible only when
4 LOS are available, while the first selection is available when 3 or more LOS are
available.
Chapter 3 GPS Toolbox Examples
- Page 3-34 -
Finally, the program XMAPDOP can be used to determine the repartition of the number
of visible satellites and the corresponding DOPs for a specified geographical area. The
program XMAPDOP is asking the user to enter the following input data:
- name of the input almanac data file; the default data file is
- wk749.dat. The almanac input data file can be created as specified in
section 3.13.
- geographic locations for the test; the default is data file
map01.dat. The first record of the file should contain the latitude
limits while the second record should contain the longitude limits,
both in degrees
- elevation angle limit; the default value is 5 degrees
- simulation time (GPS time of week), in seconds; the default value
is 0.
- selection of xdop to be plotted
- number of time samples and time step value, in seconds (if more
than one time step is selected)
- name of the output file for satellite visibility statistics
(optional)
- other parameters are initialized by default; the default latitude-
longitude grid is 25 by 41 (default)
By using the default input data set and the selection of GDOP as a criteria for the analysis
of data the following results are displayed on screen:
xmapdop
Enter almanac data file - the default is data file wk749.dat
Do you want to use the default data file? (y/n)[y] -->
Enter geographic location data - the default is the data file map01.dat
Do you want to use the default data file? (y/n)[y]
Enter elevation angle limit - the default value is 5 degrees
Do you want to use the default value? (y/n)[y]
Enter simulation time (GPS time of week), in seconds - the default is 0.
Do you want to use the default value? (y/n)[y]
Select xdop to be plotted
Enter 1 for gdop
Enter 2 for pdop
Enter 3 for hdop
Enter 4 for vdop
Enter 5 for tdop
Make selection --> 1
Enter number of time samples - the default value is 1
Do you want to use the default value? (y/n)[y]
Do you want to save the visibility statistics? (y/n)[y]
Specify the filename for satellite visibility statistics --> xmapdop1.out
***** Computation in progress for time sample = 1
Chapter 3 GPS Toolbox Examples
- Page 3-35 -
Figure 3-15.1 GDOP values contour map.
Figure 3-15.2 Number of visible satellites contour plot.
-6 -4 -2 0 2 4 6 8 10 12
42
43
44
45
46
47
48
49
50
51
52
Longitude, in degrees
L
a
t
i
t
u
d
e
,
i
n
d
e
g
r
e
e
s
GDOP versus longitude-latitude grid, for wk749.dat at time-of-week =0
1.5
1.6
1.6
1.7
1.7
1.8
1.8
1.9
1.9
2
2
-6 -4 -2 0 2 4 6 8 10 12
42
43
44
45
46
47
48
49
50
51
52
Number of visible satellites versus longitude-latitude grid, for wk749.dat at time-of-week =0
Longitude, in degrees
L
a
t
i
t
u
d
e
,
i
n
d
e
g
r
e
e
s
8
8
9
Chapter 3 GPS Toolbox Examples
- Page 3-36 -
Include the geographic map? (y/n)[y] -->n
Plot the visible satellite contour? (y/n)[y] -->
Include the geographic map? (y/n)[y] -->
End of the program XMAPDOP
The obtained contour plots are presented in Figures 3-15.1 and 3-15.2 for GDOP values
and number of visible satellites, respectively. The satellite visibility statistics saved in the
selected file xmapdop1.out is as follows:
***********************************************************************
XMAPDOP - RESULTS
************************************************************************
Almanac: wk749.dat
Time of week: 0.00
Geographic area:
- longitude (in degrees): -7.00 to 13.00
- latitude (in degrees): 42.00 to 52.00
Number of space-time points analyzed = 1025
*************************************************************************
SUMMARY - SATELLITE VISIBILITY STATISTICS
Number of cases with <5 visible satellites = 0, percentage = 0.00
Number of cases with 5 visible satellites = 0, percentage = 0.00
Number of cases with 6 visible satellites = 0, percentage = 0.00
Number of cases with 7 visible satellites = 166, percentage = 16.20
Number of cases with 8 visible satellites = 389, percentage = 37.95
Number of cases with 9 visible satellites = 470, percentage = 45.85
Number of cases with 10 visible satellites = 0, percentage = 0.00
Number of cases with 11 visible satellites = 0, percentage = 0.00
Number of cases with >11 visible satellites = 0, percentage = 0.00
***********************************************************************
3.16 Satellite selection based on minimum GDOP criteria
The program XSVSEL can be used to select the best 4, 5 or 6 satellites based on
minimum GDOP criteria. The DOPs quantities are determined by using the m-file
module DOP1.M.
The program XSVSEL requires the user to enter from keyboard the following input data:
name of the input filename; the default is XSVSEL1.DAT
name of the output filename; the default is XSVSEL.OUT
number of the satellites to be selected.
The output data are as follows:
number of satellites available
number of satellites to be used
indices of the selected satellites
dilution of precision (DOP) values for the selected satellites set, i.e. GDOP, PDOP,
HDOP, VDOP, and TDOP.
Chapter 3 GPS Toolbox Examples
- Page 3-37 -
When the default data are used (see data file XSEVSEL1.DAT), the results for the
selection with 4, 5 and 6 satellites are presented in Figure 3-16.1. For comparison, when
all seven satellites are used, the results of the computation of DOP values, by using the
program XDOP1, are presented in Figure 3-16.2.
Number of satellites available = 7
Number of satellites to be used = 4
Indices of the selected satellites = 1 3 5 7
GDOP = 2.745
PDOP = 2.488
HDOP = 2.254
VDOP = 1.054
TDOP = 1.159
**************************************************************
**************************************************************
Number of satellites available = 7
Number of satellites to be used = 5
Indices of the selected satellites = 1 3 5 6 7
GDOP = 2.453
PDOP = 2.252
HDOP = 2.000
VDOP = 1.036
TDOP = 0.973
**************************************************************
**************************************************************
Number of satellites available = 7
Number of satellites to be used = 6
Indices of the selected satellites = 1 2 3 5 6 7
GDOP = 2.288
PDOP = 2.081
HDOP = 1.806
VDOP = 1.034
TDOP = 0.952
**************************************************************
Figure 3-16.1. Satellites selection based on minimum GDOP; 4, 5, and 6 satellites
selection from 7 satellites available.
**************************************************************
***** Input data ******
LOS # 1 --> 0.0778800 -0.6017930 0.7947552
LOS # 2 --> 0.1730016 -0.9665970 -0.1891052
LOS # 3 --> -0.8457427 -0.4893909 -0.2126402
LOS # 4 --> -0.5385451 -0.2338803 0.8094870
LOS # 5 --> 0.4345836 -0.7366578 -0.5181432
LOS # 6 --> 0.7052152 -0.5433383 0.4554723
Chapter 3 GPS Toolbox Examples
- Page 3-38 -
LOS # 7 --> -0.8973768 0.3366878 0.2852302
***** Results from the macro XDOP1.m *****
Geometric Dilution of Precision (GDOP) = 2.1733
Position Dilution of Precision (PDOP) = 1.9564
Horizontal Dilution of Precision (HDOP) = 1.7499
Vertical Dilution of Precision (VDOP) = 0.8749
Time Dilution of Precision (TDOP) = 0.9464
**************************************************************
Figure 3-16.2. Satellites selection based on minimum GDOP;all satellites selection
from 7 satellites available.
3.17 Determination of iono correction and execution of related graphs
The m-file program XIONOC is used to determine the iono correction and to execute
several related plots. The macro IONOC computes L1 iono correction for a specified user
by using Klobuchar model, and macro IONOCON sets the Klobuchar model iono
constants alpha and beta. The program XIONOC executes four plots related to the iono
correction, namely
plot of number of visible satellites versus time sample number
3-D plot of iono correction versus time sample number
plot of iono correction versus satellite id for a selected time sample number (the value
is set to 0. when the satellite is not visible)
plot of iono correction versus time sample number for a selected satellite (from the
list of visible satellites),
and, optional, the generated data can be saved into a specified file.
For example, by using the default data set and selecting 20 time samples the following is
displayed on screen:
xionoc
Enter almanac data - the default is data file wk749.dat
Do you want to use the default data file? (y/n)[y] -->
Enter geographic location data - the default is the data file locat1.dat
Do you want to use the default data file? (y/n)[y]
Enter elevation angle limit - the default value is 5 degrees
Do you want to use the default value? (y/n)[y]
Enter initial simulation time (GPS time of week), in seconds - the default is 0.
Do you want to use the default value? (y/n)[y]
Enter number of time samples - the default value is 10
Do you want to use the default value? (y/n)[y] n
Enter number of time samples --> 20
Enter time step - the default value is 300.
Do you want to use the default value? (y/n)[y]
Chapter 3 GPS Toolbox Examples
- Page 3-39 -
***** Computation in progress for time sample = 1
***** Computation in progress for time sample = 2
***** Computation in progress for time sample = 3
***** Computation in progress for time sample = 4
***** Computation in progress for time sample = 5
***** Computation in progress for time sample = 6
***** Computation in progress for time sample = 7
***** Computation in progress for time sample = 8
***** Computation in progress for time sample = 9
***** Computation in progress for time sample = 10
***** Computation in progress for time sample = 11
***** Computation in progress for time sample = 12
***** Computation in progress for time sample = 13
***** Computation in progress for time sample = 14
***** Computation in progress for time sample = 15
***** Computation in progress for time sample = 16
***** Computation in progress for time sample = 17
***** Computation in progress for time sample = 18
***** Computation in progress for time sample = 19
***** Computation in progress for time sample = 20
Do you want to save the iono correction data? (y/n)[n] y
Do you want to use the default file, xionoc1.out? (y/n)[y]
Number of time sample available = 20
Select the time sample number to be analyzed -->20
The following satellites are in the almanac:
1 2 4 5 6 7 9 12 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 31
Select the satellite id -->5
End of the program XIONOC
The resulted plots are presented in Figures 3-17.1 to 3-17.4. The obtained data can be
saved into a specified output data file.
Chapter 3 GPS Toolbox Examples
- Page 3-40 -
Figure 3-17.1 Number of visible satellites versus time sample number
Figure 3-17.2 Iono correction versus time sample and satellite id
2 4 6 8 10 12 14 16 18 20
3
4
5
6
7
8
9
10
11
12
Time sample number (time step =300 seconds, start time tow =0 seconds)
N
u
m
b
e
r
o
f
v
i
s
i
b
l
e
s
a
t
e
l
l
i
t
e
s
Number of visible satellites versus Time sample number (almanac wk749.dat)
Chapter 3 GPS Toolbox Examples
- Page 3-41 -
Figure 3-17.3 Iono correction versus satellite id, for a specified time sample
Figure 3-17.4 Iono correction versus time sample number for a specified satellite
5 10 15 20 25 30
0
2
4
6
8
10
12
14
16
Satellite number (almanac wk749.dat)
I
o
n
o
c
o
r
r
e
c
t
i
o
n
,
i
n
m
e
t
e
r
s
(
0
i
f
s
a
t
e
l
l
i
t
e
i
s
n
o
t
v
i
s
i
b
l
e
)
Iono correction versus Satellite number, for Time sample #20
0 2 4 6 8 10 12 14 16 18 20
4.4
4.6
4.8
5
5.2
5.4
5.6
5.8
6
Time sample number (time step =300 seconds, start time tow =0 seconds)
I
o
n
o
c
o
r
r
e
c
t
i
o
n
,
i
n
m
e
t
e
r
s
Iono correction versus Time sample number, for satellte #5 (almanac wk749.dat)
Chapter 3 GPS Toolbox Examples
- Page 3-42 -
3.18 Determination of troposphere delay correction
The program XTROPOC1 determines troposphere delay contour graph for a specified
latitude-longitude location, elevation angle, and altitude range by using a simplified
model; WGS-84 geoid heights are used. The resulted contour graph depends on altitude
above WGS-84 ellipsoid and elevation angle.
For example, by using the default file tgeoid84.dat for the WGS-84 geoid heights, and
latitude/longitude entry from the keyboard the following is displayed on screen:
xtropoc1
Enter latitude, in degrees --> 32.12345
Enter longitude, in degrees --> -118.12345
Do you want to execute another computation/plot? (y/n)[n] -->
End of the program XTROPOC1
The files xpbias1.out and xpbias2.out contain the results when the probability of false
alarm is 3.3333e-7 and 6.66667e-5, respectively; the probability of missed detection is
selected as 0.001.
3.26 RAIM Fault detection availability determination
The program XRAIMDA determines RAIM fault detection availability for the case of all-
in-view satellites based on a constant false alarm rate algorithm [7], [27]. The user can
execute the program by using the default set of input data or by using a selected set of
input data. The program requires the following input data:
- name of the input almanac data file; the default is data file
svprime.dat. The input data file can be created as specified in 3.13.
- geographic locations for the test; the default is data file
mops24.dat. Each record contains the data related to a location
in the following order: latitude (degrees), longitude (degrees),
altitude (meters)
Chapter 3 GPS Toolbox Examples
- Page 3-57 -
- elevation mask angle limit in degrees; the default is 5. degrees
- GPS receiver type: Standard Position System (SPS) with SA on,
SPS without SA, or user's selected standard deviation of
measurement error, in meters
- phase-of-flight (Non-Precision Approach, Terminal, En-Route, Oceanic
and user defined HAL)
- probability of false alarm, probability of missed detection, and the
corresponding pbias thresholds; default values are provided
- initial simulation time (GPS time of week); the default value is 0.
- number of time steps; default value is 48 [1]
- time increment, in seconds; default value is 1800 [1]
- name of the statistics output file, the default is the screen
- name of the output file containing unavailable cases (optional)
- selection of the bar graph of visible satellites (optional)
- selection of the histogram plot of horizontal protection level (HPL)
repartition (optional)
- other parameters are initialized by default
It is worth mentioning that the fault detection thresholds are those determined by using
programs XFDNT and XPBIAS, and the files svprime.dat and mops.dat contain data
specified in [1], [2]. For example, by using the default input data set with the selections
for SPS with SA on, Non-Precision Approach, pfa =6.6667e-5 and pmd =0.001, and
saving the results in files xraimda1.out and xraimda2.out, the following is displayed on
screen:
xraimda
Enter almanac data file - the default is datafile svprime.dat
Do you want to use the default datafile? (y/n)[y]
Enter geographic location data - the default is the datafile mops24.dat
Do you want to use the default datafile? (y/n)[y]
Enter elevation mask angle limit - the default value is 5. degrees
Do you want to use the default value? (y/n)[y]
Enter GPS receiver type :
1 --> Standard Position System (SPS) with SA On
2 --> Standard Position System (SPS) with SA Off
3 --> User defined Std. Dev. of measurement errors
Make the selection --> 1
Select phase-of-flight:
1 --> Non-Precision Approach (NPA)
2 --> Terminal
3 --> En Route
4 --> Oceanic
5 --> User defined
Make the selection --> 1
Enter values for pfa, pmd and pbiasb:
1 --> For pfa =6.6667e-5 and pmd =0.001
2 --> For pfa =3.3333e-7 and pmd =0.001
3 --> Enter the user defined values
Make the selection --> 1
Enter initial simulation time (GPS time of week) - the default value is 0.
Do you want to use the default value? (y/n)[y]
Enter number of time samples - the default value is 48
Chapter 3 GPS Toolbox Examples
- Page 3-58 -
Do you want to use the default value? (y/n)[y]
Enter time increment value, in seconds - the default value is 1800
Do you want to use the default value? (y/n)[y]
Do you want to save the statistics? (y/n)[n] y
Specify the statistics output filename (with extension) -->xraimda1.out
Do you want to save the unavailable cases? (y/n)[n] y
Specify the RAIM unavailable output filename (with extension) -->xraimda2.out
***** Computation in progress for time sample = 1
***** Computation in progress for time sample = 2
***** Computation in progress for time sample = 3
***** Computation in progress for time sample = 4
***** Computation in progress for time sample = 5
***** Computation in progress for time sample = 6
***** Computation in progress for time sample = 7
***** Computation in progress for time sample = 8
***** Computation in progress for time sample = 9
***** Computation in progress for time sample = 10
***** Computation in progress for time sample = 11
***** Computation in progress for time sample = 12
***** Computation in progress for time sample = 13
***** Computation in progress for time sample = 14
***** Computation in progress for time sample = 15
***** Computation in progress for time sample = 16
***** Computation in progress for time sample = 17
***** Computation in progress for time sample = 18
***** Computation in progress for time sample = 19
***** Computation in progress for time sample = 20
***** Computation in progress for time sample = 21
***** Computation in progress for time sample = 22
***** Computation in progress for time sample = 23
***** Computation in progress for time sample = 24
***** Computation in progress for time sample = 25
***** Computation in progress for time sample = 26
***** Computation in progress for time sample = 27
***** Computation in progress for time sample = 28
***** Computation in progress for time sample = 29
***** Computation in progress for time sample = 30
***** Computation in progress for time sample = 31
***** Computation in progress for time sample = 32
***** Computation in progress for time sample = 33
***** Computation in progress for time sample = 34
***** Computation in progress for time sample = 35
***** Computation in progress for time sample = 36
***** Computation in progress for time sample = 37
***** Computation in progress for time sample = 38
***** Computation in progress for time sample = 39
***** Computation in progress for time sample = 40
***** Computation in progress for time sample = 41
***** Computation in progress for time sample = 42
***** Computation in progress for time sample = 43
***** Computation in progress for time sample = 44
***** Computation in progress for time sample = 45
Chapter 3 GPS Toolbox Examples
- Page 3-59 -
***** Computation in progress for time sample = 46
***** Computation in progress for time sample = 47
***** Computation in progress for time sample = 48
Bar plot - Number of cases versus Number of visible satellites
Do you want to execute the bar graph? (y/n)[y] n
Histogram plot - Number of cases versus Horizontal protection level
Do you want to execute the histogram plot? (y/n)[y]
End of the program XRAIMDA
The overall statistics see file xraimda1.out is presented in Figure 3-26.1 and the
horizontal protection level histogram for all available cases is shown in Figures 3-26.2
****************************************************************
RAIM FAULT DETECTION AVAILABILITY TEST SUMMARY
For Non-Precision Approach with All-In-View satellites:
- horizontal alarm limit (meters): 555.600
- GPS receiver mode: SPS with SA On
- almanac: svprime.dat
- number of satellites in constellation = 24
- number of locations: 24
- number of time samples: 48
- time increment (seconds): 1800
- std. dev. of pseudorange error (meters): 33.300
- elevation angle limit (degrees): 5.0000
- probability of false alarm: 6.6667000e-005
- probability of missed detection: 1.0000000e-003
- total space-time sample points: 1152
RAIM fault detection available = 1129, percentage: 98.00347
RAIM fault detection unavailable = 23, percentage: 1.99653
Repartition of RAIM fault detection available/unavailable cases:
- when < 5 visible satellites: 0 available, 0 unavailable
- when 5 visible satellites: 0 available, 3 unavailable
- when 6 visible satellites: 33 available, 10 unavailable
- when 7 visible satellites: 310 available, 10 unavailable
- when 8 visible satellites: 441 available, 0 unavailable
- when 9 visible satellites: 276 available, 0 unavailable
- when 10 visible satellites: 64 available, 0 unavailable
- when 11 visible satellites: 5 available, 0 unavailable
- when 12 visible satellites: 0 available, 0 unavailable
****************************************************************
SATELLITE VISIBILITY STATISICS
Number of cases with < 5 visible satellites = 0
Number of cases with 5 visible satellites = 3
Number of cases with 6 visible satellites = 43
Number of cases with 7 visible satellites = 320
Number of cases with 8 visible satellites = 441
Number of cases with 9 visible satellites = 276
Number of cases with 10 visible satellites = 64
Number of cases with 11 visible satellites = 5
Number of cases with 12 visible satellites = 0
Chapter 3 GPS Toolbox Examples
- Page 3-60 -
****************************************************************
Figure 3-26.1. Fault detection availability statistics summary
Figure 3-26.2. Horizontal protection level histogram of all available cases
Table 3-26 summarizes the RAIM fault detection availability results from the execution
of the program XRAIMDA with different input data for phase of flight, probability of
false alarm (pfa), probability of missed detection (pmd), and standard deviation of
measurement errors (see SA on with 33.3 meters and SA off with 6.5 meters). The
horizontal alarm level (HAL) for each phase of flight is 0.3, 1, 2 and 4 nautical miles for
the Non-Precision Approach, Terminal, En-Route and Oceanic, respectively [1], [2], [30].
0 50 100150200250300 350400450500550600650700
0
50
100
150
200
250
300
350
Horizontal protection level, in meters
N
u
m
b
e
r
o
f
c
a
s
e
s
Non-Precision Approach phase of flight - Horizontal protection level histogram of available cases
min =98.0217, max =540.9906, mean =235.1782 meters
Chapter 3 GPS Toolbox Examples
- Page 3-61 -
Table 3-26. RAIM Fault detection availability
pfa =6.6667e-5, pmd =0.001 pfa =3.3333e-7, pmd =0.001
Phase of flight
SA On
(st. dev. =33.3 m)
SA Off
(st. dev. = 6.5 m)
SA On
(st. dev. =33.3 m)
SA Off
(st. dev. =6.5 m)
Non-Precision
Approach
98.003 99.913 97.135 99.913
Terminal 99.913 99.913 99.826 99.913
En-Route 99.913 100.000 99.913 100.000
Oceanic 99.913 100.000 99.913 100.000
3.27 RAIM Fault exclusion availability determination
The program XRAIMEA determines RAIM fault exclusion availability for the case of all-
in-view satellites based on a constant false alarm rate algorithm [7], [27]. The user can
execute the program by using the default set of input data or by using a selected set of
input data. The program requires the following input data:
- name of the input almanac data file; the default is data file
svprime.dat.
- geographic locations for the test; the default is data file mops24.
dat. Each record contains the data related to a location in the
following order: latitude (degrees), longitude (degrees), altitude
(meters)
- elevation mask angle limit in degrees; the default is 5. degrees
- GPS receiver type: Standard Position System (SPS) with SA on,
SPS without SA, or user's selected standard deviation of
measurement error, in meters
- phase-of-flight (Non-Precision Approach, Terminal, En-Route, Oceanic
and user defined HAL)
- probability of false alarm, probability of missed detection,
and the corresponding pbias thresholds; default values are provided
- initial simulation time (GPS time of week); the default value is 0.
- number of time steps; default value is 48 [1]
- time increment, in seconds; default value is 1800 [1]
- name of the statistics output file, the default is the screen
- name of the output file containing unavailable cases (optional)
- selection of the bar graph of visible satellites (optional)
- selection of the histogram plot of horizontal exclusion level (HEL)
repartition (optional)
- other parameters are initialized by default
Again, it is worth mentioning that the fault detection thresholds are those determined by
using programs XFDNT and XPBIAS, and the files svprime.dat and mops.dat contain
data specified in [1], [2]. For example, by using the default input data set with the
selections for SPS with SA on, Non-Precision Approach, pfa =6.6667e-5 and pmd =
0.001, and saving the results in files xraimea1.out and xraimea2.out, the following is
displayed on screen:
Chapter 3 GPS Toolbox Examples
- Page 3-62 -
xraimea
Enter almanac data file - the default is datafile svprime.dat
Do you want to use the default datafile? (y/n)[y]
Enter geographic location data - the default is the datafile mops24.dat
Do you want to use the default datafile? (y/n)[y]
Enter elevation mask angle limit - the default value is 5. degrees
Do you want to use the default value? (y/n)[y]
Enter GPS receiver type :
1 --> Standard Position System (SPS) with SA On
2 --> Standard Position System (SPS) with SA Off
3 --> User defined Std. Dev. of measurement errors
Make the selection --> 1
Select phase-of-flight:
1 --> Non-Precision Approach (NPA)
2 --> Terminal
3 --> En Route
4 --> Oceanic
5 --> User defined
Make the selection --> 1
Enter values for pfa, pmd and pbiasb:
1 --> For pfa =6.6667e-5 and pmd =0.001
2 --> For pfa =3.3333e-7 and pmd =0.001
3 --> Enter the user defined values
Make the selection --> 1
Enter initial simulation time (GPS time of week) - the default value is 0.
Do you want to use the default value? (y/n)[y]
Enter number of time samples - the default value is 48
Do you want to use the default value? (y/n)[y]
Enter time increment value, in seconds - the default value is 1800
Do you want to use the default value? (y/n)[y]
Do you want to save the statistics? (y/n)[n] y
Specify the statistics output filename (with extension) -->xraimea1.out
Do you want to save the unavailable cases? (y/n)[n] y
Specify the RAIM unavailable output filename (with extension) -->xraimea2.out
***** Computation in progress for time sample = 1
***** Computation in progress for time sample = 2
***** Computation in progress for time sample = 3
***** Computation in progress for time sample = 4
***** Computation in progress for time sample = 5
***** Computation in progress for time sample = 6
***** Computation in progress for time sample = 7
***** Computation in progress for time sample = 8
Chapter 3 GPS Toolbox Examples
- Page 3-63 -
***** Computation in progress for time sample = 9
***** Computation in progress for time sample = 10
***** Computation in progress for time sample = 11
***** Computation in progress for time sample = 12
***** Computation in progress for time sample = 13
***** Computation in progress for time sample = 14
***** Computation in progress for time sample = 15
***** Computation in progress for time sample = 16
***** Computation in progress for time sample = 17
***** Computation in progress for time sample = 18
***** Computation in progress for time sample = 19
***** Computation in progress for time sample = 20
***** Computation in progress for time sample = 21
***** Computation in progress for time sample = 22
***** Computation in progress for time sample = 23
***** Computation in progress for time sample = 24
***** Computation in progress for time sample = 25
***** Computation in progress for time sample = 26
***** Computation in progress for time sample = 27
***** Computation in progress for time sample = 28
***** Computation in progress for time sample = 29
***** Computation in progress for time sample = 30
***** Computation in progress for time sample = 31
***** Computation in progress for time sample = 32
***** Computation in progress for time sample = 33
***** Computation in progress for time sample = 34
***** Computation in progress for time sample = 35
***** Computation in progress for time sample = 36
***** Computation in progress for time sample = 37
***** Computation in progress for time sample = 38
***** Computation in progress for time sample = 39
***** Computation in progress for time sample = 40
***** Computation in progress for time sample = 41
***** Computation in progress for time sample = 42
***** Computation in progress for time sample = 43
***** Computation in progress for time sample = 44
***** Computation in progress for time sample = 45
***** Computation in progress for time sample = 46
***** Computation in progress for time sample = 47
***** Computation in progress for time sample = 48
Bar plot - Number of cases versus Number of visible satellites
Do you want to execute the bar graph? (y/n)[y] n
Histogram plot - Number of cases versus Horizontal exclusion level
Do you want to execute the histogram plot? (y/n)[y]
End of the program XRAIMEA
The overall statistics see file xraimda1.out is presented in Figure 3-27.1 and the
horizontal protection level histogram for all available cases is shown in Figures 3-27.2
****************************************************************
RAIM FAULT EXCLUSION AVAILABILITY TEST SUMMARY
Chapter 3 GPS Toolbox Examples
- Page 3-64 -
For Non-Precision Approach with All-In-View satellites:
- horizontal alarm limit (HAL) (meters): 555.600
- GPS receiver mode: SPS with SA On
- almanac: svprime.dat
- number of satellites in constellation = 24
- number of locations: 24
- number of time samples: 48
- time increment (seconds): 1800
- std. dev. of pseudorange error (meters): 33.300
- elevation mask angle limit (degrees): 5.0000
- probability of false alarm: 6.6667000e-005
- probability of missed detection: 1.0000000e-003
- total space-time sample points: 1152
RAIM fault exclusion available = 716, percentage: 62.15278
RAIM fault exclusion unavailable = 436, percentage: 37.84722
Repartition of RAIM fault exclusion available/unavailable cases:
- when < 5 visible satellites: 0 available, 0 unavailable
- when 5 visible satellites: 0 available, 3 unavailable
- when 6 visible satellites: 0 available, 43 unavailable
- when 7 visible satellites: 52 available, 268 unavailable
- when 8 visible satellites: 326 available, 115 unavailable
- when 9 visible satellites: 269 available, 7 unavailable
- when 10 visible satellites: 64 available, 0 unavailable
- when 11 visible satellites: 5 available, 0 unavailable
- when 12 visible satellites: 0 available, 0 unavailable
****************************************************************
SATELLITE VISIBILITY STATISICS
Number of cases with < 5 visible satellites = 0
Number of cases with 5 visible satellites = 3
Number of cases with 6 visible satellites = 43
Number of cases with 7 visible satellites = 320
Number of cases with 8 visible satellites = 441
Number of cases with 9 visible satellites = 276
Number of cases with 10 visible satellites = 64
Number of cases with 11 visible satellites = 5
Number of cases with 12 visible satellites = 0
Figure 3-27.1. Fault exclusion availability statistics summary
Table 3-27 summarizes the RAIM fault exclusion availability results from the execution
of the program XRAIMEA with different input data for phase of flight, probability of
false alarm (pfa), probability of missed detection (pmd), and standard deviation of
measurement errors (see SA on with 33.3 meters and SA off with 6.5 meters). As
expected note that the fault exclusion availability is lower than the fault detection
availability by comparing the results from Tables 3-26.1 and 3-27.1.
60
80
100
120
140
160
N
u
m
b
e
r
o
f
c
a
s
e
s
Non-Precision Approach phase of flight - Horizontal exclusion level histogram of available cases
min =159.6839, max =555.1524, mean =370.9029 meters
Chapter 3 GPS Toolbox Examples
- Page 3-65 -
Figure 3-27.2. Horizontal exclusion level histogram of all available cases
Table 3-27 RAIM Fault exclusion availability
pfa =6.6667e-5, pmd =0.001 pfa =3.3333e-7, pmd =0.001
Phase of flight
SA On
(st. dev. =33.3 m)
SA Off
(st. dev. =6.5 m)
SA On
(st. dev. =33.3 m)
SA Off
(st. dev. =6.5 m)
Non-Precision
Approach
62.153 96.788 51.823 96.528
Terminal 95.139 98.785 94.097 98.611
En-Route 97.483 99.219 97.222 99.132
Oceanic 98.611 99.392 98.524 99.306
3.28 GPS error budget determination
The program XEBUDGET determines GPS error budget for a specified input data set.
The user should enter from keyboard the following input data: (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.
For example, by using the default data the following is displayed on screen:
xebudget
Do you want to use the default data set? (y/n)[y] -->
Enter the output desired (output file or on screen)
Do you want to display the results on screen? (y/n)[y] -->
Chapter 3 GPS Toolbox Examples
- Page 3-66 -
****************************************************************************
***** COMPUTATION OF ERROR BUDGET *****
****************************************************************************
***** Input data ******
Space space segment error (meters, 1-sigma) = 1.900
Space control segment error (meters, 1-sigma) = 3.500
User segmnent, tropo error (meters, 1-sigma) = 2.000
User segmnent, iono error (meters, 1-sigma) = 5.000
User segmnent, multipath error (meters, 1-sigma) = 1.400
User segmnent, receiver error (meters, 1-sigma) = 3.000
PDOP = 2.1800
HDOP = 1.3600
VDOP = 1.7000
TDOP = 0.9500
***** Results by using XEBUDGET ******
URE (User Range Error), in meters = 3.9825
UEE (User Equipment Error), in meters = 6.3214
UERE (User Equivalent Range Error), in meters = 7.4713
SEP (Spherical Error Probable), 3-D 50 percentage, in meters = 14.4648
CEP (Circular Error Probable, 2-D 50 percentage, in meters = 8.4590
LEP (Linear Error Probable), Vertical 50 percentage, in meters = 8.5669
Time Error (50 percentage), in nanoseconds = 15.798
3-D (Spherical) Position Error (95 percentage), in meters = 26.288
2-D (Horizontal) Position Error (95 percentage), in meters = 20.322
Actual 2-D (Horizontal) Position Error (95 percentage), in meters = 17.587
Vertical Position Error (95 percentage), in meters = 25.402
Actual Vertical Position Error (95 percentage), in meters = 25.296
Time Error (95 percentage), in nanoseconds = 46.845
Actual Time Error (95 percentage), in nanoseconds = 46.648
****************************************************************************
End of the program XEBUDGET