Main Content

laplacian

Laplacian of scalar function

Description

example

laplacian(f,x)computes the Laplacian of the scalar function or functional expressionfwith respect to the vectorxin Cartesian coordinates.

example

laplacian(f)computes the Laplacian of the scalar function or functional expressionfwith respect to a vector constructed from all symbolic variables found inf. The order of variables in this vector is defined bysymvar.

Examples

Compute Laplacian of Symbolic Expression

Compute the Laplacian of this symbolic expression. By default,laplaciancomputes the Laplacian of an expression with respect to a vector of all variables found in that expression. The order of variables is defined bysymvar.

syms x y t laplacian(1/x^3 + y^2 - log(t))
ans = 1/t^2 + 12/x^5 + 2

Compute Laplacian of Symbolic Function

Create this symbolic function:

syms x y z f(x, y, z) = 1/x + y^2 + z^3;

Compute the Laplacian of this function with respect to the vector[x, y, z]:

L = laplacian(f, [x y z])
L(x, y, z) = 6*z + 2/x^3 + 2

Input Arguments

collapse all

Input, specified as a symbolic expression or function.

Input, specified as a vector of symbolic variables. The Laplacian is computed with respect to these symbolic variables.

More About

collapse all

Laplacian of Scalar Function

The Laplacian of the scalar function or functional expressionfwith respect to the vectorX= (X1,...,Xn)is the sum of the second derivatives offwith respect toX1,...,Xn:

Δ f = i = 1 n 2 f x i 2

Tips

  • Ifxis a scalar,laplacian(f, x) = diff(f, 2, x).

Alternatives

The Laplacian of a scalar function or functional expression is the divergence of the gradient of that function or expression:

Δ f = ( f )

因此,您可以compute the Laplacian using thedivergenceandgradientfunctions:

symsf(x, y)divergence(gradient(f(x, y)), [x y])
Introduced in R2012a