Chronology Current Month Current Thread Current Date [Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

# Re: discretizing derivatives

• From: "Prof. John P. Ertel (wizard)" <jpe@USNA.EDU>
• Date: Mon, 12 Feb 2001 07:25:50 -0500

I regularly do this type of calculation and so will proffer the method
that I have always used. I believe it to be correct (or else, why would I
use it) but it also seems that there must be a more mathematically
rigorous method. I do know that this method leads to proper normalization
(always handy if you want meaningful numbers).

1) during the numerical integration, make the 1st step 1/2 my initial step
size and make all subsequent steps (except for the last one in a "peak"
equal to the initial step size;

2) always integrate on increasing slope
(L2R if +value & +slope,
R2L if +value & -slope\,
L2R if -value & +slope,
R2L if -value & -slope);

3) add the +areas separately (from the -areas) adding small terms to large
(this is only necessary if there are multiple MAX's and MIN's);

4) repeat steps 1,2,&3 with a step size that is 1/10 of the initial size.

* Omit this last step if the integration step size is adaptive
to the local slope.

+=================================+=================================+

On Sun, 11 Feb 2001, John S. Denker wrote:

At 05:20 PM 2/11/01 -0500, Ludwik Kowalski wrote:
One problem with the accuracy of calculating C numerically,
is the size of each cell. Suppose sigmas were calculated and
one needs E (=dV/dl) for the corresponding locations. What
should one use for dl? So far I am using dl=one half of the
cell size. This is based on the assumption that V assigned to
a cell, at the end of iterations, really belongs to the center of
the cell (as far as the r,z projections are concerned). Right?

I rather doubt that is right.

It's fine to consider the cell value to represent the voltage at the center
of the cell. Then the numerator of (dV/dl) is the voltage difference,
center-to-center. So I would think that the denominator would be the
position difference, also center-to-center, i.e. the full cell size, not half.

===========

There remains the question of where to "park" the resulting value of
(dV/dl). There are several plausible choices:
-- take the left difference,
-- take the right difference,
-- take the symmetric long-span difference, or
-- phase shift the E-grid by half a cell relative to the V-grid.

The choices don't matter much in rectangular coordinates, where everything
is nice and linear.

The choices don't matter AT ALL if what you are really interested in the
charge, because that goes like del^2 V, and the Laplacian operator is
beautifully symmetric and on-center; it contains things like (left
difference minus right difference).

The choices DO matter in polar coordinates, because of the nasty
nonlinearity of the (1/r)(d/dr) term. I recommend taking the weighted
average of the right difference and the left difference (weighted by the
appropriate (different!) radius values). If things were linear, this would
reduce to the symmetric long-span difference.

+=================================+=================================+
ERTEL SENDS.
{best viewed in Courier} /^\-/^\
/ \
| * |
|#########|
===========================
/ Prof. John P. Ertel \
/ USNA-NESA Faculty Rep \
/ veteran Eagle Scout \
+==============================================================+
| JPE@usna.edu or JPErtel@BigFoot.com |
| Physics Department, 9C Office : 410-293-6657 |
| Michelson Rm-338 DSN : 281-6657 |
| 572 Holloway RD FAX : 410-293-3729 |
| U. S. Naval Academy |
| Annapolis, MD 21402-5026 HomeVoice : 410-757-6618 |
| {Call HomeVoice to activate FAX/DATA} HomeFAX : 410-757-6619 |
+==============================================================+
http://physnet.usna.edu/physics/Faculty/Ertel/ertel.html
http://physnet.usna.edu/ECAs/NESA/nesa.htm