Previous Up Next

13.7.2  Laplacian

Recall, the Laplacian of a function F of n variables x1,…,xn is

  ∇2(F)=
2 F
∂ x12
+
2 F
∂ x22
+ ⋯+
2 F
∂ xn2
.

Also, the n× n discrete Laplacian matrix (also called the second difference matrix) is the n × n tridiagonal matrix with 2s on the main diagonal, −1s just above and below the main diagonal;

  






    2−100
    −12−10
    ⋮
    0−12−1
    00−12






If L is the n× n discrete Laplacian matrix and Y is an n × 1 column vector whose kth coordinate is yi=y(a+kΔ x) for a twice differential function y, then the kth coordinate of L Y will be (implicitly assuming that y(a)=y(a+(N+1)Δ x)=0):

y(a+(k−1)Δ x)+2 y(a+kΔ x)−y (a+(k−1)Δ x),

which approximates y′′(a+kΔ x). So L Y is approximately −Δ x2 Y′′, where Y′′ is the n × 1 column vector whose kth coordinate is y′′(a+kδ x).

The laplacian command can compute the Laplacian operator or the discrete Laplacian matrix.

Examples

Find the Laplacian of F(x,y,z)=2x2yxz3.

laplacian(2*x^2*y-x*z^3,[x,y,z])
     
−6 x z+4 y           
laplacian(3)
     



2−10
−12−1
0−12



          
laplacian(2.0)
     


2.0−1.0
−1.02.0


          

Previous Up Next