solveNavEqns2
PURPOSE 
Solve the pseudo-range navigation equations by algebraically
SYNOPSIS 
function [rt1 rt2 x y z] = solveNavEqns2( sat1, sat2, sat3, sat4, d, c )
DESCRIPTION 
CROSS-REFERENCE INFORMATION 
This function calls:
This function is called by:
SOURCE CODE 
0001
0002
0003
0004
0005
0006
0007 function [rt1 rt2 x y z] = solveNavEqns2( sat1, sat2, sat3, sat4, d, c )
0008
0009
0010
0011
0012 ux = [ 2*(sat2.x - sat1.x) 2*(sat3.x - sat1.x) 2*(sat4.x - sat1.x) ]';
0013 uy = [ 2*(sat2.y - sat1.y) 2*(sat3.y - sat1.y) 2*(sat4.y - sat1.y) ]';
0014 uz = [ 2*(sat2.z - sat1.z) 2*(sat3.z - sat1.z) 2*(sat4.z - sat1.z) ]';
0015 ud = [ ...
0016 2 * c^2 * (sat1.t - sat2.t) ...
0017 2 * c^2 * (sat1.t - sat3.t) ...
0018 2 * c^2 * (sat1.t - sat4.t) ]';
0019
0020 w1= sat1.x^2 - sat2.x^2 + ...
0021 sat1.y^2 - sat2.y^2 + ...
0022 sat1.z^2 - sat2.z^2 + ...
0023 c^2 * ( sat2.t^2 - sat1.t^2 );
0024 w2= sat1.x^2 - sat3.x^2 + ...
0025 sat1.y^2 - sat3.y^2 + ...
0026 sat1.z^2 - sat3.z^2 + ...
0027 c^2 * ( sat3.t^2 - sat1.t^2 );
0028 w3= sat1.x^2 - sat4.x^2 + ...
0029 sat1.y^2 - sat4.y^2 + ...
0030 sat1.z^2 - sat4.z^2 + ...
0031 c^2 * ( sat4.t^2 - sat1.t^2 );
0032 uw = [ w1 w2 w3 ]';
0033
0034 D = det( [ ux uy uz ] );
0035 Ddx = det( [ ud uy uz ] );
0036 Dwx = det( [ uw uy uz ] );
0037 Ddy = det( [ ux ud uz ] );
0038 Dwy = det( [ ux uw uz ] );
0039 Ddz = det( [ ux uy ud ] );
0040 Dwz = det( [ ux uy uw ] );
0041
0042 DDdx = Ddx / D;
0043 DDdy = Ddy / D;
0044 DDdz = Ddz / D;
0045 DDwx = Dwx / D;
0046 DDwy = Dwy / D;
0047 DDwz = Dwz / D;
0048
0049 a = DDdx^2 + DDdy^2 + DDdz^2 - c^2;
0050 b = 2*DDdx*(DDwx + sat1.x) + ...
0051 2*DDdy*(DDwy + sat1.y) + ...
0052 2*DDdz*(DDwz + sat1.z) + ...
0053 2 * c^2 * sat1.t;
0054 ce= (DDwx + sat1.x)^2 + ...
0055 (DDwy + sat1.y)^2 + ...
0056 (DDwz + sat1.z)^2 - ...
0057 c^2 * sat1.t^2;
0058
0059 x = (-d * Ddx - Dwx) / D;
0060 y = (-d * Ddy - Dwy) / D;
0061 z = (-d * Ddz - Dwz) / D;
0062
0063 rt1 = (-b + sqrt( b^2 - 4 * a * ce )) / (2 * a);
0064 rt2 = (-b - sqrt( b^2 - 4 * a * ce )) / (2 * a);
0065 end
Generated on Sat 22-Feb-2014 01:14:24 by m2html © 2005