Home > mfiles > part2.m

part2

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 clear;
0002 c = 299792.458; % speed of light in km/s
0003 % create an array of structures, representing the positions of each
0004 % satellite in 3D space and the associated travel time of the signal
0005 % to the receiver
0006 sat = struct( 'x', 15600, 'y', 7540, 'z', 20140, 't', 0.07074 );
0007 sat(2).x = 18760; sat(2).y = 2750; sat(2).z = 18610; sat(2).t = 0.07220;
0008 sat(3).x = 17610; sat(3).y = 14630; sat(3).z = 13480; sat(3).t = 0.07690;
0009 sat(4).x = 19170; sat(4).y = 610; sat(4).z = 18390; sat(4).t = 0.07242;
0010 % our known receiver clock error
0011 d = -0.003201566;
0012 % given the positions and times of each satellite, compute the relative
0013 % clock error of the receiver by reducing the pseudo-range navigation
0014 % equations to a system of one variable, d, and solving using the
0015 % quadratic equation
0016 [ root1 root2 x y z ] = solveNavEqns2( sat(1), sat(2), sat(3), sat(4), d, c );
0017 % for this example, the results are as follows:
0018 % x, y, z = same values as in part1 (this is simply a check of calculation)
0019 % root1 = -0.003
0020 % root2 = 0.1852
0021 % choose the smaller of the two roots, and that is the relative clock error
0022 % which should agree with our known clock error, d.

Generated on Sat 22-Feb-2014 01:14:24 by m2html © 2005