[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Irregularly gridded Discrete Laplacian Operator
From: |
Geordie McBain |
Subject: |
Re: Irregularly gridded Discrete Laplacian Operator |
Date: |
Thu, 19 Jul 2007 19:31:08 +1000 |
> 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. 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.
Best wishes, and keep up the good work.
Geordie McBain
finidiff.m
Description: Text Data
finidiff_matrix.m
Description: Text Data