On Mon, 2007-02-12 at 17:24 -0700, Dave Perry wrote:
> On Mon, 2007-02-12 at 11:33 -0500, John Denker wrote:
> > Overnight I thought of a non-disgusting way to optimize
> > the code.  A new, muuuch better patch is now at:
> >    http://www.av8n.com/fly/fgfs/altimeter.diff
> > 
> > The new patch gets the right answer without calling any
> > transcendental functions.
> 
> This looks really slick, taking advantage of the identical form for the
> pressure altitude term and the C(S) term in equation (15) so you can
> interpolate both terms with only one table.   Slick!

It occurred to me that we should use John's interpolation function in
several other places:
1. We use a form of this function in kap140.nas without the efficiency
of the interpolation.
2. The encoder uses a similar interpolation that a general form of this
function could replace.  Since the encoder computes pressure altitude,
John could replace one interpolation in altimeter.cxx by referencing the
encoder PA.

What I am proposing is to create a C++ function (say height_ft) that has
two arguments, P0 and P1 that does the interpolation in John's new patch
using his constants.

Then the kap140.nas could use that function, the encoder could use that
function to compute PA and the altimeter would only need to compute C(S)
with that function because it could lookup PA from the encoder in the
properties.

This would have the added advantage of standardizing the constants used
in all three applications.  The kap140 already uses the PA from the
encoder and I would replace the partial differential offset with a nasal
C(S) in any case to assure the kap140 altAlert is compatible with John's
rounded FAA fiat constants.  I think this will get rid of the altitude
error in the kap140 altitude capture.

Roy and John, you both have contributed in these areas.  What do you
think of this idea?

Regards,
Dave
-- 
Dave Perry 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to