[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20020523: McIDAS MATH keywords (cont.)



>From: "Jennie L. Moody" <address@hidden>
>Organization: UVa
>Keywords: 200205232127.g4NLRTa11165 McIDAS GRDCOPY DERIVE=

Jennie,

re:
>I am just trying to re-derive (follow) what Owen and I have
>done before in calculating PV from grids.  I am trying to 
>find out exactly how math keywords work, like DDX and DDY, 
>when one uses the DERIVE keyword in a GRDCOPY command.

Well, I finally set aside some time to find out how the MATH=
stuff on grid calculations works in McIDAS.  After ALOT of tracing,
I found that X-derivatives are done in the routine 'gridx' in
m0pmath.c (Y-derivitaves are done by 'gridy' also in m0pmath.c).

The comment in the file about how derivates are done is:

/*
*  Compute the delta-x of the grid.  The compuatations are grid-relative
*   and we are using a 2nd order centered finite difference around a
*   center point, or a non-centered finite difference at the edges.
*  The formulae are taken from the book "Modern Methods of Engineering
*   Computation" by R. L. Ketter and S. P. Prawel, Jr.  Published by
*   McGraw-Hill, NYC, in 1969 (So it was modern then).  The formulae
*   are as follows (from pp. 226-228) :
*
*  2nd order 1st derivative:
*
*  (X_(i+1) - X_(i-1)) / 2*delx   (centered)
*  (-3X_i + 4X_(i+1) - X_(i+2)) / 2*delx (uncentered)
*  (3X_i - 4X_(i-1) + X_(i-2)) / 2*delx (uncentered)
*/

Both 'gridx' and 'gridy' are called from lines in m0gget.c, which are
called from mcgget.for, which is called from grdcopy.pgm, grddisp.pgm,
etc.

Is this the information you were looking for?

Tom