Skip to content
Symi Docs
Swift
On this page

Vector calculus

Coordinates are passed as a list of variable names; vector fields as a list of component expressions in the same order. Empty variable lists and component/variable count mismatches raise.

gradient#

Explicit context

func gradient(
    scalarField: UniffiExpression,
    variables: [String],
) -> [UniffiExpression]

∇f\nabla f: the partial derivatives in the order of variables.

divergence#

Explicit context

func divergence(
    vectorComponents: [UniffiExpression],
    variables: [String],
) -> UniffiExpression

∇⋅F=∑i∂Fi/∂xi\nabla\cdot F = \sum_i \partial F_i/\partial x_i; component and variable counts must match.

curl#

Explicit context

func curl(
    vectorComponents: [UniffiExpression],
    variables: [String],
) -> [UniffiExpression]

∇×F\nabla\times F. Requires exactly three components and three variables; other dimensions raise.

laplacian#

Explicit context

func laplacian(
    scalarField: UniffiExpression,
    variables: [String],
) -> UniffiExpression

Δf=∇⋅∇f\Delta f = \nabla\cdot\nabla f.

jacobian#

Explicit context

func jacobian(
    vectorComponents: [UniffiExpression],
    variables: [String],
) -> UniffiMatrix

The matrix with entry (i,j)=∂Fi/∂xj(i, j) = \partial F_i/\partial x_j (rows index components, columns index variables). Returned as a Matrix so the result composes with the matrix methods.

hessian#

Explicit context

func hessian(
    scalarField: UniffiExpression,
    variables: [String],
) -> UniffiMatrix

The n×nn\times n matrix of second partials, computed as the Jacobian of the gradient; structurally symmetric on smooth input.

Example#

Symi documentation · Swift