Learn R Programming

pracma (version 1.1.6)

laplacian: Laplacian Operator

Description

Numerically compute the Laplacian of a function.

Usage

laplacian(f, x0, h = 1e-4, ...)

Arguments

f
univariate function of two variables.
x0
point in $R^n$.
h
step size.
...
variables to be passed to f.

Value

  • Real number.

Details

Computes the Laplacian operator $f_{xx} + f_{yy}$ based on the three-point central difference formula, expanded to this special case.

Assumes that the function has continuous partial derivatives.

References

Fausett, L. V. (2007). Applied Numerical Analysis Using Matlab. Second edition, Prentice Hall.

See Also

fderiv, hessian

Examples

Run this code
f <- function(x) x[1]^2 + 2*x[1]*x[2] + x[2]^2
laplacian(f, c(1,1))

Run the code above in your browser using DataLab