core.symbolic

Symbolic helpers shared by the models: type checks, smooth norms, quadrature.

Functions

gauss_legendre(n)

Gauss–Legendre nodes and weights on [0, 1], exact for polynomials of degree 2n − 1.

is_casadi(x)

True for CasADi symbols (SX, MX) and numeric matrices (DM).

is_symbolic(x)

True for CasADi symbols (SX, MX).

logcosh(x)

log(cosh x), written to avoid overflow for large arguments.

quad(f, a, b[, n])

∫ f over [a, b] by n-point Gauss–Legendre quadrature; a, b and f may be symbolic.

smooth_norm(x[, eps])

√(xᵀx + ε): the Euclidean norm, differentiable at zero.