[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Irregularly gridded Discrete Laplacian Operator
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: Irregularly gridded Discrete Laplacian Operator |
Date: |
Wed, 18 Jul 2007 13:44:55 -0500 |
On 18/07/07, David Bateman <address@hidden> wrote:
The definition for the interior points along an axis of 1D problem for
the octave-forge version of del2 can be written as
D (2:end-1) = (M(3:end) - 2 * M(2:end - 1) + M(1:end -2)) ./
(dx(1:end-1) .* dx(2:end)) ./ 2
This is just the common O(h^2) approximation to the second derivative,
(f(x+h) - 2f(x) - f(x-h) )/h^2 where it looks like they took the h's
slightly spaced apart in order to account for small differences in h?
Taking a square root in the denominator here would make no sense; the
denominator has to be a square in h, not linear.
whereas the equivalent in Matlab appears to be
D(2:end-1) = ((M(3:end) - M(2:end-1)) ./ dx(2:end) + (M(1:end-2) -
M(2:end-1)) ./ dx(1:end-1)) ./ (dx(1:end-1) + dx(2:end))
I don't understand this one either. Looks like some sort of averaging
like you said.
- Jordi G. H.