Skip to content
Symi Docs
Kotlin
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

fun gradient(
    scalarField: UniffiExpression,
    variables: List<kotlin.String>,
): List<UniffiExpression>

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

divergence#

Explicit context

fun divergence(
    vectorComponents: List<UniffiExpression>,
    variables: List<kotlin.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

fun curl(
    vectorComponents: List<UniffiExpression>,
    variables: List<kotlin.String>,
): List<UniffiExpression>

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

laplacian#

Explicit context

fun laplacian(
    scalarField: UniffiExpression,
    variables: List<kotlin.String>,
): UniffiExpression

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

jacobian#

Explicit context

fun jacobian(
    vectorComponents: List<UniffiExpression>,
    variables: List<kotlin.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

fun hessian(
    scalarField: UniffiExpression,
    variables: List<kotlin.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 · Kotlin