[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Irregularly gridded Discrete Laplacian Operator
From: |
David Bateman |
Subject: |
Re: Irregularly gridded Discrete Laplacian Operator |
Date: |
Thu, 19 Jul 2007 13:56:46 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
Geordie McBain wrote:
>> Is there a "correct" definition for irregularly gridded discrete
>> Laplacian operator? Is there any reason to prefer either of the above
>> definitions?
>>
>
> I'm not sure about a correct definition, but one definition is a finite
> difference approximation that is exact for polynomials of such and such
> a degree.
Which one? In any case they are identical if dx(i) = dx(i+1) for all i,
ie a uniform grid.. It looks like you're using Octave's definition in
finidiff as the vandermonde matrix are your absicae raised to the p-th
(here p=2) power.
> This is what in my work I use, directly, to compute finite
> difference coefficients; i.e. I solve the linear system of equations
> that specifies that the multiplication of the row of N coefficients by
> the N columns of N ordinates of N test functions (an N*N matrix) at the
> N abscissae gives the N derivatives (of whatever order) of the test
> functions at the target point. I attach my implementation, in case it's
> of interest. To get the second derivative operator; e.g.
> %<---
> octave:11> x = sort (rand (6, 1)); x'
> ans =
>
> 0.046615 0.325824 0.712196 0.769261 0.852244 0.969730
>
> octave:12> full (finidiff_matrix (x, 2))
> ans =
>
> 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
> 10.76213 -18.53932 7.77719 0.00000 0.00000 0.00000
> 0.00000 11.67327 -90.71033 79.03706 0.00000 0.00000
> 0.00000 0.00000 250.25795 -422.35298 172.09502 0.00000
> 0.00000 0.00000 0.00000 120.22535 -205.14261 84.91725
> 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
> %<---
> Although solving a dense linear system might seem expensive, it's only O
> (n), where n is the number of grid points, in the context of solving a
> differential equation on the grid. Such an important special case as
> the Laplacian, however, is probably worth hard-coding.
>
For small values of "q" passed to finidiff_matrix you'll have a banded
matrix, and above for q=2 its a tridiagonal matrix.. This will use the
banded or tridiagonal LAPACK solvers if Octave 2.9 and so should the
solution of the above matrix with the ldivide operator show be
relatively low cost.
Humm, I begin to suspect there isn't a "correct" solution as if you
refine your grid you'll get a convergence to a solution, and both
solutions are essentially the same. Marco sent me an e-mail offline that
essentially demonstrated that the convergence of the matlab solution is
better though.. I therefore think for convergence and compatibility its
better to go with the matlab definition for irregular grids..
Cheers
David
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary