DSPRelated.com
Forums

QR Decomposition with a twist

Started by Tim Wescott February 19, 2010
I'm working on a nav problem, and I'm looking for some computational 
efficiencies.

I'm carrying position and velocity information in earth-centered, earth-
fixed coordinates, and I have a need to do some post-processing in north-
east-down coordinates.

I'm using Scilab's QR decomposition at the moment.  I can do this 
decomposition on a 3 x 2 matrix with the position vector and the earth's 
rotation axis, and I get a return that is down, north, east, or up, 
south, west, or any of the other six possibilities where the line is 
pointing in the right direction but the sign is questionable.

Are there any good canned algorithms to do this, or should I just be 
rolling my own?

-- 
www.wescottdesign.com
On 19 Feb, 18:31, Tim Wescott <t...@seemywebsite.com> wrote:
> I'm working on a nav problem, and I'm looking for some computational > efficiencies. > > I'm carrying position and velocity information in earth-centered, earth- > fixed coordinates, and I have a need to do some post-processing in north- > east-down coordinates. > > I'm using Scilab's QR decomposition at the moment. &#4294967295;I can do this > decomposition on a 3 x 2 matrix with the position vector and the earth's > rotation axis, and I get a return that is down, north, east, or up, > south, west, or any of the other six possibilities where the line is > pointing in the right direction but the sign is questionable. > > Are there any good canned algorithms to do this, or should I just be > rolling my own?
I can't really see the application of the QR here? Rune
On Fri, 19 Feb 2010 09:51:31 -0800, Rune Allnor wrote:

> On 19 Feb, 18:31, Tim Wescott <t...@seemywebsite.com> wrote: >> I'm working on a nav problem, and I'm looking for some computational >> efficiencies. >> >> I'm carrying position and velocity information in earth-centered, >> earth- fixed coordinates, and I have a need to do some post-processing >> in north- east-down coordinates. >> >> I'm using Scilab's QR decomposition at the moment. &nbsp;I can do this >> decomposition on a 3 x 2 matrix with the position vector and the >> earth's rotation axis, and I get a return that is down, north, east, or >> up, south, west, or any of the other six possibilities where the line >> is pointing in the right direction but the sign is questionable. >> >> Are there any good canned algorithms to do this, or should I just be >> rolling my own? > > I can't really see the application of the QR here? > > Rune
When done on the specified matrix, the first column of the Q matrix is parallel with 'down'; the second column is as parallel as can be with the earth's rotation axis while still being orthogonal to 'down', hence it is parallel to north as the crow flies; the third column is whatever is left over, hence it is parallel to east as the crow flies. Take that Q matrix, transpose it, multiply it to some vector, and -- Presto Changeo -- you have the velocity vector in (down or up), (north or south), (east or west) coordinates with respect to the vehicle. I just want to get rid of the 'or up', 'or south', and 'or west' parts. -- www.wescottdesign.com
On 19 Feb, 19:12, Tim Wescott <t...@seemywebsite.com> wrote:
> On Fri, 19 Feb 2010 09:51:31 -0800, Rune Allnor wrote: > > On 19 Feb, 18:31, Tim Wescott <t...@seemywebsite.com> wrote: > >> I'm working on a nav problem, and I'm looking for some computational > >> efficiencies. > > >> I'm carrying position and velocity information in earth-centered, > >> earth- fixed coordinates, and I have a need to do some post-processing > >> in north- east-down coordinates. > > >> I'm using Scilab's QR decomposition at the moment. &#4294967295;I can do this > >> decomposition on a 3 x 2 matrix with the position vector and the > >> earth's rotation axis, and I get a return that is down, north, east, or > >> up, south, west, or any of the other six possibilities where the line > >> is pointing in the right direction but the sign is questionable. > > >> Are there any good canned algorithms to do this, or should I just be > >> rolling my own? > > > I can't really see the application of the QR here? > > > Rune > > When done on the specified matrix, the first column of the Q matrix is > parallel with 'down'; the second column is as parallel as can be with the > earth's rotation axis while still being orthogonal to 'down', hence it is > parallel to north as the crow flies; the third column is whatever is left > over, hence it is parallel to east as the crow flies. > > Take that Q matrix, transpose it, multiply it to some vector, and -- > Presto Changeo -- you have the velocity vector in (down or up), (north or > south), (east or west) coordinates with respect to the vehicle. &#4294967295;I just > want to get rid of the 'or up', 'or south', and 'or west' parts.
I'd try and see if it is possible to use some sort of reference vectors, and compare the various vectors to the references. For instance, the up/down ambiguity can be checked against the rotation axis: If you are on the northern hemisphere and the sign of the z coefficient is positive, the up/down vector points 'up' when seen from the ground. On the southern hemisphere the smae vector would have pointed 'down'. It will be a bit more complicated than that e.g. around equator, but I think this kind of approach is the simplest to implement and quickest to run. Rune
>I'm working on a nav problem, and I'm looking for some computational >efficiencies. > >I'm carrying position and velocity information in earth-centered, earth- >fixed coordinates, and I have a need to do some post-processing in north- >east-down coordinates. > >I'm using Scilab's QR decomposition at the moment. I can do this >decomposition on a 3 x 2 matrix with the position vector and the earth's >rotation axis, and I get a return that is down, north, east, or up, >south, west, or any of the other six possibilities where the line is >pointing in the right direction but the sign is questionable. > >Are there any good canned algorithms to do this, or should I just be >rolling my own?
Disclaimer: I've been doing small-scale stuff before, so I've stuck with NED exclusively, so double-check this, of course. :) You know which way "down" is in ECEF, since that's the negative of your normalized position you've been putting into QR, correct? If you cross that with the earth's rotation axis in the North direction (0,0,1?), you should get local East in ECEF, up to normalization. If you cross local East with down, you should get local North. Now you have the directions of the NED axes in ECEF, and it probably stacks up well against QR in operations count. Obviously, NED breaks down at the poles, and one approach may be more numerically sensitive than the other NEAR the poles, but I think this should work the same in both hemispheres without any conditional sign changes. Do let me know if you spot a mistake. I also have no idea if Coriolis matters here, though I'm reading that it does in converting to/from an inertial frame (which you are not).
Michael Plante wrote:
>Tim Wescott wrote: >>I'm working on a nav problem, and I'm looking for some computational >>efficiencies. >> >>I'm carrying position and velocity information in earth-centered, earth- >>fixed coordinates, and I have a need to do some post-processing in
north-
>>east-down coordinates. >> >>I'm using Scilab's QR decomposition at the moment. I can do this >>decomposition on a 3 x 2 matrix with the position vector and the earth's
>>rotation axis, and I get a return that is down, north, east, or up, >>south, west, or any of the other six possibilities where the line is >>pointing in the right direction but the sign is questionable. >> >>Are there any good canned algorithms to do this, or should I just be >>rolling my own? > >Disclaimer: I've been doing small-scale stuff before, so I've stuck with >NED exclusively, so double-check this, of course. :) > >You know which way "down" is in ECEF, since that's the negative of your >normalized position you've been putting into QR, correct? If you cross >that with the earth's rotation axis in the North direction (0,0,1?), you >should get local East in ECEF, up to normalization. If you cross local >East with down, you should get local North. Now you have the directions
of
>the NED axes in ECEF, and it probably stacks up well against QR in >operations count. Obviously, NED breaks down at the poles, and one >approach may be more numerically sensitive than the other NEAR the poles, >but I think this should work the same in both hemispheres without any >conditional sign changes. > >Do let me know if you spot a mistake. I also have no idea if Coriolis >matters here, though I'm reading that it does in converting to/from an >inertial frame (which you are not). >
Oh, and there may be one other issue, re: geodetic vs geocentric. I think both of these are geocentric. At mid-latitudes, your down will point to the center of the earth, and may not be perpendicular to the reference ellipsoid, making the N/E not quite tangent to the ellipsoid...not sure if this will bother you...
On Fri, 19 Feb 2010 23:03:46 -0600, Michael Plante wrote:

> Michael Plante wrote: >>Tim Wescott wrote: >>>I'm working on a nav problem, and I'm looking for some computational >>>efficiencies. >>> >>>I'm carrying position and velocity information in earth-centered, >>>earth- fixed coordinates, and I have a need to do some post-processing >>>in > north- >>>east-down coordinates. >>> >>>I'm using Scilab's QR decomposition at the moment. I can do this >>>decomposition on a 3 x 2 matrix with the position vector and the >>>earth's > >>>rotation axis, and I get a return that is down, north, east, or up, >>>south, west, or any of the other six possibilities where the line is >>>pointing in the right direction but the sign is questionable. >>> >>>Are there any good canned algorithms to do this, or should I just be >>>rolling my own? >> >>Disclaimer: I've been doing small-scale stuff before, so I've stuck >>with NED exclusively, so double-check this, of course. :) >> >>You know which way "down" is in ECEF, since that's the negative of your >>normalized position you've been putting into QR, correct? If you cross >>that with the earth's rotation axis in the North direction (0,0,1?), you >>should get local East in ECEF, up to normalization. If you cross local >>East with down, you should get local North. Now you have the directions > of >>the NED axes in ECEF, and it probably stacks up well against QR in >>operations count. Obviously, NED breaks down at the poles, and one >>approach may be more numerically sensitive than the other NEAR the >>poles, but I think this should work the same in both hemispheres without >>any conditional sign changes. >> >>Do let me know if you spot a mistake. I also have no idea if Coriolis >>matters here, though I'm reading that it does in converting to/from an >>inertial frame (which you are not). >> >> > Oh, and there may be one other issue, re: geodetic vs geocentric. I > think both of these are geocentric. At mid-latitudes, your down will > point to the center of the earth, and may not be perpendicular to the > reference ellipsoid, making the N/E not quite tangent to the > ellipsoid...not sure if this will bother you...
I'm using geocentric, and pretending Real Hard that it's the same as geodetic. So far I have other errors in my system that swamp any generated by this simplifying assumption. -- www.wescottdesign.com
On Fri, 19 Feb 2010 22:57:49 -0600, Michael Plante wrote:

>>I'm working on a nav problem, and I'm looking for some computational >>efficiencies. >> >>I'm carrying position and velocity information in earth-centered, earth- >>fixed coordinates, and I have a need to do some post-processing in >>north- east-down coordinates. >> >>I'm using Scilab's QR decomposition at the moment. I can do this >>decomposition on a 3 x 2 matrix with the position vector and the earth's >>rotation axis, and I get a return that is down, north, east, or up, >>south, west, or any of the other six possibilities where the line is >>pointing in the right direction but the sign is questionable. >> >>Are there any good canned algorithms to do this, or should I just be >>rolling my own? > > Disclaimer: I've been doing small-scale stuff before, so I've stuck > with NED exclusively, so double-check this, of course. :) > > You know which way "down" is in ECEF, since that's the negative of your > normalized position you've been putting into QR, correct? If you cross > that with the earth's rotation axis in the North direction (0,0,1?), you > should get local East in ECEF, up to normalization. If you cross local > East with down, you should get local North. Now you have the directions > of the NED axes in ECEF, and it probably stacks up well against QR in > operations count. Obviously, NED breaks down at the poles, and one > approach may be more numerically sensitive than the other NEAR the > poles, but I think this should work the same in both hemispheres without > any conditional sign changes. > > Do let me know if you spot a mistake. I also have no idea if Coriolis > matters here, though I'm reading that it does in converting to/from an > inertial frame (which you are not).
Thank you. This is obvious in hindsight (d'oh), and it should work just fine. I had my head stuck deep into "how do I do this with linear algebra tools" and did not think about the obvious vector math. -- www.wescottdesign.com