Numerical solvers¶
Python exposes hmath.calculus, hmath.root, hmath.ode and hmath.pde. C includes hmath_numerical.h. Every named operation invokes the original Haskell function with its original argument order, defaults, budgets, diagnostic fields, finite checks and errors.
Inputs are borrowed, successful outputs own a structured value, and failure leaves output pointers untouched. Immutable handles can be shared by concurrent readers retaining their own references. Source Left MathError returns status11 with its full structured payload. Cancellation is checked before entry; source evaluation/step limits govern the solver.
Function arguments are kind101 objects constructed with hmath_linear_callback. Their input is a tuple of the source's curried arguments flattened into positional order; their output transfers one owned value. Callbacks may reenter checked APIs and must not unwind through C. Python accepts normal callables and re-raises their original exceptions after cleanup. An actual source Either MathError callback may return a recoverable mathematical error; pure callbacks propagate it to the outer boundary. Callback function/userdata must remain valid for all objects retaining them. Python propagates these owners automatically.
Estimate retains an arbitrary structured payload; its value is never implicitly converted to binary64. Numerical estimates produced by these solvers have their original binary64 payload. Matrix Double, sparse operators and exact polynomial inputs interoperate with their existing typed binding owners.
calculus.estimate¶
calculus.estimate(value, error, evaluations)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.Estimate.
hmath_status hmath_calculus_estimate(hmath_context *context, const hmath_value *value, const hmath_value *error, const hmath_value *evaluations, hmath_value **out);
calculus.estimate_value¶
calculus.estimate_value(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.estimateValue.
hmath_status hmath_calculus_estimate_value(hmath_context *context, const hmath_value *value, hmath_value **out);
calculus.estimate_error¶
calculus.estimate_error(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.estimateError.
hmath_status hmath_calculus_estimate_error(hmath_context *context, const hmath_value *value, hmath_value **out);
calculus.evaluations¶
calculus.evaluations(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.evaluations.
hmath_status hmath_calculus_evaluations(hmath_context *context, const hmath_value *value, hmath_value **out);
calculus.tolerance¶
calculus.tolerance(absolute_tolerance, relative_tolerance, maximum_evaluations)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.Tolerance.
hmath_status hmath_calculus_tolerance(hmath_context *context, const hmath_value *absolute_tolerance, const hmath_value *relative_tolerance, const hmath_value *maximum_evaluations, hmath_value **out);
calculus.absolute_tolerance¶
calculus.absolute_tolerance(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.absoluteTolerance.
hmath_status hmath_calculus_absolute_tolerance(hmath_context *context, const hmath_value *value, hmath_value **out);
calculus.relative_tolerance¶
calculus.relative_tolerance(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.relativeTolerance.
hmath_status hmath_calculus_relative_tolerance(hmath_context *context, const hmath_value *value, hmath_value **out);
calculus.maximum_evaluations¶
calculus.maximum_evaluations(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.maximumEvaluations.
hmath_status hmath_calculus_maximum_evaluations(hmath_context *context, const hmath_value *value, hmath_value **out);
calculus.default_tolerance¶
calculus.default_tolerance()
Default adaptive tolerance: 1e-10 absolute, 1e-8 relative, 100000 evaluations.
Original: HMath.Calculus.defaultTolerance.
calculus.forward¶
calculus.forward()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.Forward.
calculus.backward¶
calculus.backward()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.Backward.
calculus.central¶
calculus.central()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.Central.
calculus.trapezoidal¶
calculus.trapezoidal()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.Trapezoidal.
calculus.simpson¶
calculus.simpson()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.Simpson.
calculus.three_eighths¶
calculus.three_eighths()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Calculus.ThreeEighths.
calculus.derivative¶
calculus.derivative(method, h, f, x)
First derivative with explicit positive finite step; rounded-away steps fail.
Original: HMath.Calculus.derivative.
hmath_status hmath_calculus_derivative(hmath_context *context, const hmath_value *method, const hmath_value *h, const hmath_value *f, const hmath_value *x, hmath_value **out);
calculus.derivative_n¶
calculus.derivative_n(order, h, f, x)
Arbitrary nonnegative derivative order by recursively centered differences. Work grows exponentially with the requested order; orders are limited to 12.
Original: HMath.Calculus.derivativeN.
hmath_status hmath_calculus_derivative_n(hmath_context *context, const hmath_value *order, const hmath_value *h, const hmath_value *f, const hmath_value *x, hmath_value **out);
calculus.complex_derivative¶
calculus.complex_derivative(h, f, x)
Complex-step first derivative. The callback must have a holomorphic extension and be real on the real axis.
Original: HMath.Calculus.complexDerivative.
hmath_status hmath_calculus_complex_derivative(hmath_context *context, const hmath_value *h, const hmath_value *f, const hmath_value *x, hmath_value **out);
calculus.richardson¶
calculus.richardson(tol, initial, f, x)
Richardson extrapolation of a central first difference. Each row halves the step. Evaluation budget is 2 per row; convergence uses consecutive diagonals.
Original: HMath.Calculus.richardson.
hmath_status hmath_calculus_richardson(hmath_context *context, const hmath_value *tol, const hmath_value *initial, const hmath_value *f, const hmath_value *x, hmath_value **out);
calculus.ridders¶
calculus.ridders(tol, initial, f, x)
Ridders extrapolation with factor 1.4 and a best-error stopping criterion.
Original: HMath.Calculus.ridders.
hmath_status hmath_calculus_ridders(hmath_context *context, const hmath_value *tol, const hmath_value *initial, const hmath_value *f, const hmath_value *x, hmath_value **out);
calculus.limit¶
calculus.limit(side, tol, initial, f, x)
One-sided numerical limit, approaching geometrically from the requested side. Central compares the average of both sides; it cannot prove continuity.
Original: HMath.Calculus.limit.
Difference -> Tolerance -> Double -> (Double -> Double) -> Double -> Either MathError (Estimate Double)
hmath_status hmath_calculus_limit(hmath_context *context, const hmath_value *side, const hmath_value *tol, const hmath_value *initial, const hmath_value *f, const hmath_value *x, hmath_value **out);
calculus.partial_derivative¶
calculus.partial_derivative(i, h, f, xs)
Partial derivative at a zero-based coordinate.
Original: HMath.Calculus.partialDerivative.
hmath_status hmath_calculus_partial_derivative(hmath_context *context, const hmath_value *i, const hmath_value *h, const hmath_value *f, const hmath_value *xs, hmath_value **out);
calculus.gradient¶
calculus.gradient(h, f, xs)
Gradient using one central difference per coordinate.
Original: HMath.Calculus.gradient.
hmath_status hmath_calculus_gradient(hmath_context *context, const hmath_value *h, const hmath_value *f, const hmath_value *xs, hmath_value **out);
calculus.jacobian¶
calculus.jacobian(h, f, xs)
Row-major Jacobian; callback output dimensions must remain constant.
Original: HMath.Calculus.jacobian.
hmath_status hmath_calculus_jacobian(hmath_context *context, const hmath_value *h, const hmath_value *f, const hmath_value *xs, hmath_value **out);
calculus.hessian¶
calculus.hessian(h, f, xs)
Hessian with centered diagonal and mixed differences.
Original: HMath.Calculus.hessian.
hmath_status hmath_calculus_hessian(hmath_context *context, const hmath_value *h, const hmath_value *f, const hmath_value *xs, hmath_value **out);
calculus.directional_derivative¶
calculus.directional_derivative(h, f, x, v)
Directional derivative; the direction is used as supplied, without normalization.
Original: HMath.Calculus.directionalDerivative.
hmath_status hmath_calculus_directional_derivative(hmath_context *context, const hmath_value *h, const hmath_value *f, const hmath_value *x, const hmath_value *v, hmath_value **out);
calculus.jvp¶
calculus.jvp(h, f, x, v)
Jacobian-vector product by directional central differences.
Original: HMath.Calculus.jvp.
hmath_status hmath_calculus_jvp(hmath_context *context, const hmath_value *h, const hmath_value *f, const hmath_value *x, const hmath_value *v, hmath_value **out);
calculus.vjp¶
calculus.vjp(h, f, x, v)
Vector-Jacobian product as the gradient of a scalar contraction.
Original: HMath.Calculus.vjp.
hmath_status hmath_calculus_vjp(hmath_context *context, const hmath_value *h, const hmath_value *f, const hmath_value *x, const hmath_value *v, hmath_value **out);
calculus.hvp¶
calculus.hvp(h, f, x, v)
Hessian-vector product with four directional/coordinate samples per component.
Original: HMath.Calculus.hvp.
hmath_status hmath_calculus_hvp(hmath_context *context, const hmath_value *h, const hmath_value *f, const hmath_value *x, const hmath_value *v, hmath_value **out);
calculus.divergence¶
calculus.divergence(h, f, x)
Divergence of a vector field with equal input and output dimensions.
Original: HMath.Calculus.divergence.
hmath_status hmath_calculus_divergence(hmath_context *context, const hmath_value *h, const hmath_value *f, const hmath_value *x, hmath_value **out);
calculus.curl¶
calculus.curl(h, f, x)
Curl of a three-dimensional vector field.
Original: HMath.Calculus.curl.
hmath_status hmath_calculus_curl(hmath_context *context, const hmath_value *h, const hmath_value *f, const hmath_value *x, hmath_value **out);
calculus.laplacian¶
calculus.laplacian(h, f, x)
Laplacian as the sum of centered second coordinate differences.
Original: HMath.Calculus.laplacian.
hmath_status hmath_calculus_laplacian(hmath_context *context, const hmath_value *h, const hmath_value *f, const hmath_value *x, hmath_value **out);
calculus.integrate_composite¶
calculus.integrate_composite(method, n, f, a, b)
Composite finite-interval integration with exact panel constraints.
Original: HMath.Calculus.integrateComposite.
hmath_status hmath_calculus_integrate_composite(hmath_context *context, const hmath_value *method, const hmath_value *n, const hmath_value *f, const hmath_value *a, const hmath_value *b, hmath_value **out);
calculus.romberg¶
calculus.romberg(tol, f, a, b)
Romberg integration using trapezoidal refinement and Richardson diagonals.
Original: HMath.Calculus.romberg.
hmath_status hmath_calculus_romberg(hmath_context *context, const hmath_value *tol, const hmath_value *f, const hmath_value *a, const hmath_value *b, hmath_value **out);
calculus.gauss_legendre¶
calculus.gauss_legendre(n, f, a, b)
n-point Gauss-Legendre quadrature; nodes are refined by Newton iteration.
Original: HMath.Calculus.gaussLegendre.
hmath_status hmath_calculus_gauss_legendre(hmath_context *context, const hmath_value *n, const hmath_value *f, const hmath_value *a, const hmath_value *b, hmath_value **out);
calculus.gauss_hermite¶
calculus.gauss_hermite(value, value2)
Weighted Gaussian quadrature on the real line for weight exp(-x^2). Uses the symmetric Jacobi recurrence and a checked implicit QL eigensystem.
Original: HMath.Calculus.gaussHermite.
hmath_status hmath_calculus_gauss_hermite(hmath_context *context, const hmath_value *value, const hmath_value *value2, hmath_value **out);
calculus.gauss_laguerre¶
calculus.gauss_laguerre(value, value2)
Weighted Gaussian quadrature on [0,infinity) for weight exp(-x).
Original: HMath.Calculus.gaussLaguerre.
hmath_status hmath_calculus_gauss_laguerre(hmath_context *context, const hmath_value *value, const hmath_value *value2, hmath_value **out);
calculus.gauss_chebyshev¶
calculus.gauss_chebyshev(n, f)
Weighted first-kind Chebyshev rule on [-1,1], weight 1/sqrt(1-x^2).
Original: HMath.Calculus.gaussChebyshev.
hmath_status hmath_calculus_gauss_chebyshev(hmath_context *context, const hmath_value *n, const hmath_value *f, hmath_value **out);
calculus.gauss_kronrod¶
calculus.gauss_kronrod(f, a, b)
Embedded 7-point Gauss / 15-point Kronrod estimate. Nodes and weights are the standard Gauss-Kronrod pair used by QUADPACK dqk15 (Netlib).
Original: HMath.Calculus.gaussKronrod.
hmath_status hmath_calculus_gauss_kronrod(hmath_context *context, const hmath_value *f, const hmath_value *a, const hmath_value *b, hmath_value **out);
calculus.adaptive_integrate¶
calculus.adaptive_integrate(tol, f, a, b)
Adaptive Gauss-Kronrod with global summed error and a strict evaluation budget. The interval with the largest estimated error is bisected first.
Original: HMath.Calculus.adaptiveIntegrate.
hmath_status hmath_calculus_adaptive_integrate(hmath_context *context, const hmath_value *tol, const hmath_value *f, const hmath_value *a, const hmath_value *b, hmath_value **out);
calculus.clenshaw_curtis¶
calculus.clenshaw_curtis(n, f, a, b)
Clenshaw-Curtis quadrature on n cosine-spaced panels using exact moments of the cosine interpolant. n must be positive and at most 4096.
Original: HMath.Calculus.clenshawCurtis.
hmath_status hmath_calculus_clenshaw_curtis(hmath_context *context, const hmath_value *n, const hmath_value *f, const hmath_value *a, const hmath_value *b, hmath_value **out);
calculus.tanh_sinh¶
calculus.tanh_sinh(tol, f, a, b)
Tanh-sinh quadrature with geometric step refinement on a finite interval. Rounded-to-endpoint nodes are omitted, supporting integrable endpoint poles.
Original: HMath.Calculus.tanhSinh.
hmath_status hmath_calculus_tanh_sinh(hmath_context *context, const hmath_value *tol, const hmath_value *f, const hmath_value *a, const hmath_value *b, hmath_value **out);
calculus.integrate_infinite¶
calculus.integrate_infinite(tol, f, a, b)
Integrate on finite, half-infinite or doubly-infinite intervals by an open coordinate transform followed by adaptive Gauss-Kronrod. Reversed bounds change the sign. Divergent integrals have no guaranteed detection criterion.
Original: HMath.Calculus.integrateInfinite.
hmath_status hmath_calculus_integrate_infinite(hmath_context *context, const hmath_value *tol, const hmath_value *f, const hmath_value *a, const hmath_value *b, hmath_value **out);
calculus.integrate_oscillatory¶
calculus.integrate_oscillatory(sine, omega, tol, f, a, b)
Integrate f(x)cos(omegax) or f(x)sin(omegax), splitting at least once per half-period to avoid accepting an aliased embedded quadrature estimate.
Original: HMath.Calculus.integrateOscillatory.
Bool -> Double -> Tolerance -> (Double -> Double) -> Double -> Double -> Either MathError (Estimate Double)
hmath_status hmath_calculus_integrate_oscillatory(hmath_context *context, const hmath_value *sine, const hmath_value *omega, const hmath_value *tol, const hmath_value *f, const hmath_value *a, const hmath_value *b, hmath_value **out);
calculus.integrate_nd¶
calculus.integrate_nd(panels, budget, f, bounds)
Tensor-product midpoint integration over a box. The product of panel counts is checked against the explicit budget before callback evaluation.
Original: HMath.Calculus.integrateND.
hmath_status hmath_calculus_integrate_nd(hmath_context *context, const hmath_value *panels, const hmath_value *budget, const hmath_value *f, const hmath_value *bounds, hmath_value **out);
calculus.monte_carlo¶
calculus.monte_carlo(seed, n, f, bounds)
Reproducible Monte Carlo box integral with an explicit 64-bit seed. Error is one estimated standard error from Welford's sample variance.
Original: HMath.Calculus.monteCarlo.
hmath_status hmath_calculus_monte_carlo(hmath_context *context, const hmath_value *seed, const hmath_value *n, const hmath_value *f, const hmath_value *bounds, hmath_value **out);
calculus.quasi_monte_carlo¶
calculus.quasi_monte_carlo(n, f, bounds)
Deterministic Halton-box quadrature, up to 16 dimensions. No probabilistic error bound is claimed; estimateError is the difference of the two halves.
Original: HMath.Calculus.quasiMonteCarlo.
hmath_status hmath_calculus_quasi_monte_carlo(hmath_context *context, const hmath_value *n, const hmath_value *f, const hmath_value *bounds, hmath_value **out);
calculus.cumulative_integral¶
calculus.cumulative_integral(value)
Cumulative trapezoidal integrals at strictly increasing sample coordinates.
Original: HMath.Calculus.cumulativeIntegral.
hmath_status hmath_calculus_cumulative_integral(hmath_context *context, const hmath_value *value, hmath_value **out);
calculus.path_integral¶
calculus.path_integral(tol, curve, tangent, f, a, b)
Scalar line integral f(r(t))*|r'(t)| along an explicitly parameterized path.
Original: HMath.Calculus.pathIntegral.
Tolerance -> (Double -> [Double]) -> (Double -> [Double]) -> ([Double] -> Double) -> Double -> Double -> Either MathError (Estimate Double)
hmath_status hmath_calculus_path_integral(hmath_context *context, const hmath_value *tol, const hmath_value *curve, const hmath_value *tangent, const hmath_value *f, const hmath_value *a, const hmath_value *b, hmath_value **out);
calculus.line_integral¶
calculus.line_integral(tol, curve, tangent, field, a, b)
Oriented vector-field line integral along a parameterized path.
Original: HMath.Calculus.lineIntegral.
Tolerance -> (Double -> [Double]) -> (Double -> [Double]) -> ([Double] -> [Double]) -> Double -> Double -> Either MathError (Estimate Double)
hmath_status hmath_calculus_line_integral(hmath_context *context, const hmath_value *tol, const hmath_value *curve, const hmath_value *tangent, const hmath_value *field, const hmath_value *a, const hmath_value *b, hmath_value **out);
calculus.surface_integral¶
calculus.surface_integral(panels, budget, surface, du, dv, f, bounds)
Scalar surface integral over a rectangular parameter domain in R3.
Original: HMath.Calculus.surfaceIntegral.
Int -> Int -> ([Double] -> [Double]) -> ([Double] -> [Double]) -> ([Double] -> [Double]) -> ([Double] -> Double) -> [(Double, Double)] -> Either MathError Double
hmath_status hmath_calculus_surface_integral(hmath_context *context, const hmath_value *panels, const hmath_value *budget, const hmath_value *surface, const hmath_value *du, const hmath_value *dv, const hmath_value *f, const hmath_value *bounds, hmath_value **out);
calculus.volume_integral¶
calculus.volume_integral(panels, budget, f, bounds)
Volume integral over a three-dimensional rectangular box.
Original: HMath.Calculus.volumeIntegral.
hmath_status hmath_calculus_volume_integral(hmath_context *context, const hmath_value *panels, const hmath_value *budget, const hmath_value *f, const hmath_value *bounds, hmath_value **out);
root.root_options¶
root.root_options(root_max_iterations, root_max_evaluations, root_tolerance, root_step_tolerance)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.RootOptions.
hmath_status hmath_root_root_options(hmath_context *context, const hmath_value *root_max_iterations, const hmath_value *root_max_evaluations, const hmath_value *root_tolerance, const hmath_value *root_step_tolerance, hmath_value **out);
root.root_max_iterations¶
root.root_max_iterations(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.rootMaxIterations.
hmath_status hmath_root_root_max_iterations(hmath_context *context, const hmath_value *value, hmath_value **out);
root.root_max_evaluations¶
root.root_max_evaluations(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.rootMaxEvaluations.
hmath_status hmath_root_root_max_evaluations(hmath_context *context, const hmath_value *value, hmath_value **out);
root.root_tolerance¶
root.root_tolerance(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.rootTolerance.
hmath_status hmath_root_root_tolerance(hmath_context *context, const hmath_value *value, hmath_value **out);
root.root_step_tolerance¶
root.root_step_tolerance(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.rootStepTolerance.
hmath_status hmath_root_root_step_tolerance(hmath_context *context, const hmath_value *value, hmath_value **out);
root.default_root_options¶
root.default_root_options()
Default root-solving limits: 200 iterations, 4000 evaluations, residual tolerance 1e-10 and step tolerance 1e-12. Solvers validate options and report their own convergence diagnostics.
Original: HMath.Root.defaultRootOptions.
root.root_result¶
root.root_result(root_value, root_residual, root_error_bound, root_iterations, root_evaluations)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.RootResult.
hmath_status hmath_root_root_result(hmath_context *context, const hmath_value *root_value, const hmath_value *root_residual, const hmath_value *root_error_bound, const hmath_value *root_iterations, const hmath_value *root_evaluations, hmath_value **out);
root.root_value¶
root.root_value(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.rootValue.
hmath_status hmath_root_root_value(hmath_context *context, const hmath_value *value, hmath_value **out);
root.root_residual¶
root.root_residual(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.rootResidual.
hmath_status hmath_root_root_residual(hmath_context *context, const hmath_value *value, hmath_value **out);
root.root_error_bound¶
root.root_error_bound(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.rootErrorBound.
hmath_status hmath_root_root_error_bound(hmath_context *context, const hmath_value *value, hmath_value **out);
root.root_iterations¶
root.root_iterations(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.rootIterations.
hmath_status hmath_root_root_iterations(hmath_context *context, const hmath_value *value, hmath_value **out);
root.root_evaluations¶
root.root_evaluations(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.rootEvaluations.
hmath_status hmath_root_root_evaluations(hmath_context *context, const hmath_value *value, hmath_value **out);
root.bisection¶
root.bisection()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.Bisection.
root.regula_falsi¶
root.regula_falsi()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.RegulaFalsi.
root.illinois¶
root.illinois()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.Illinois.
root.brent¶
root.brent()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.Brent.
root.ridder¶
root.ridder()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.Ridder.
root.newton¶
root.newton()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.Newton.
root.halley¶
root.halley()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.Halley.
root.householder3¶
root.householder3()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.Householder3.
root.picard¶
root.picard()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.Picard.
root.aitken¶
root.aitken()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.Aitken.
root.steffensen_fixed¶
root.steffensen_fixed()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.SteffensenFixed.
root.multivariate_newton¶
root.multivariate_newton()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.MultivariateNewton.
root.newton_trust_region¶
root.newton_trust_region(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.NewtonTrustRegion.
hmath_status hmath_root_newton_trust_region(hmath_context *context, const hmath_value *value, hmath_value **out);
root.broyden¶
root.broyden()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.Broyden.
root.system_root_result¶
root.system_root_result(system_root, system_residual, system_iterations, system_evaluations)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.SystemRootResult.
hmath_status hmath_root_system_root_result(hmath_context *context, const hmath_value *system_root, const hmath_value *system_residual, const hmath_value *system_iterations, const hmath_value *system_evaluations, hmath_value **out);
root.system_root¶
root.system_root(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.systemRoot.
hmath_status hmath_root_system_root(hmath_context *context, const hmath_value *value, hmath_value **out);
root.system_residual¶
root.system_residual(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.systemResidual.
hmath_status hmath_root_system_residual(hmath_context *context, const hmath_value *value, hmath_value **out);
root.system_iterations¶
root.system_iterations(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.systemIterations.
hmath_status hmath_root_system_iterations(hmath_context *context, const hmath_value *value, hmath_value **out);
root.system_evaluations¶
root.system_evaluations(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.Root.systemEvaluations.
hmath_status hmath_root_system_evaluations(hmath_context *context, const hmath_value *value, hmath_value **out);
root.bracket¶
root.bracket(f, a, b)
Validate finite a<b and endpoint roots or opposite signs; construction never assumes a discontinuity is a root.
Original: HMath.Root.bracket.
hmath_status hmath_root_bracket(hmath_context *context, const hmath_value *f, const hmath_value *a, const hmath_value *b, hmath_value **out);
root.solve_bracket¶
root.solve_bracket(value, value2, value3, value4)
Brackets are re-evaluated with the supplied function, preventing stale or mismatched endpoint caches from certifying a different function's root.
Original: HMath.Root.solveBracket.
hmath_status hmath_root_solve_bracket(hmath_context *context, const hmath_value *value, const hmath_value *value2, const hmath_value *value3, const hmath_value *value4, hmath_value **out);
root.bracket_scan¶
root.bracket_scan(o, f, a, b, cells)
Evaluate a uniform finite grid under the evaluation budget and return every endpoint/sign-change bracket.
Original: HMath.Root.bracketScan.
hmath_status hmath_root_bracket_scan(hmath_context *context, const hmath_value *o, const hmath_value *f, const hmath_value *a, const hmath_value *b, const hmath_value *cells, hmath_value **out);
root.isolate_intervals¶
root.isolate_intervals(o, f, a, b, cells)
Refine sign-change scan brackets and deduplicate endpoint roots. Even roots require polynomial isolation.
Original: HMath.Root.isolateIntervals.
hmath_status hmath_root_isolate_intervals(hmath_context *context, const hmath_value *o, const hmath_value *f, const hmath_value *a, const hmath_value *b, const hmath_value *cells, hmath_value **out);
root.solve_derivative¶
root.solve_derivative(method, o, f, derivatives, x0)
Derivatives [f', f'', f'''] are required through order 1, 2, or 3. Householder3 is the order-four rational Householder update.
Original: HMath.Root.solveDerivative.
DerivativeMethod -> RootOptions -> (Double -> Double) -> [Double -> Double] -> Double -> Either MathError RootResult
hmath_status hmath_root_solve_derivative(hmath_context *context, const hmath_value *method, const hmath_value *o, const hmath_value *f, const hmath_value *derivatives, const hmath_value *x0, hmath_value **out);
root.secant¶
root.secant(o, f, a, b)
Unbracketed two-point secant iteration; zero slopes, stagnation, and exhausted budgets fail explicitly.
Original: HMath.Root.secant.
hmath_status hmath_root_secant(hmath_context *context, const hmath_value *o, const hmath_value *f, const hmath_value *a, const hmath_value *b, hmath_value **out);
root.steffensen¶
root.steffensen(o, f, x0)
Derivative-free Steffensen root update using f(x+f(x)); termination checks the original residual.
Original: HMath.Root.steffensen.
hmath_status hmath_root_steffensen(hmath_context *context, const hmath_value *o, const hmath_value *f, const hmath_value *x0, hmath_value **out);
root.fixed_point¶
root.fixed_point(method, o, g, x0)
Picard iteration, non-restarted Aitken sequence acceleration, or restarted Steffensen acceleration.
Original: HMath.Root.fixedPoint.
hmath_status hmath_root_fixed_point(hmath_context *context, const hmath_value *method, const hmath_value *o, const hmath_value *g, const hmath_value *x0, hmath_value **out);
root.anderson¶
root.anderson(depth, regularization, o, g, x0)
Anderson mixing with depth m and Tikhonov regularization. Residuals are g(x)-x. Solving the constrained residual Gram system is a bounded reference implementation; it does not pretend to use a low-storage QR update.
Original: HMath.Root.anderson.
Int -> Double -> RootOptions -> ([Double] -> [Double]) -> [Double] -> Either MathError SystemRootResult
hmath_status hmath_root_anderson(hmath_context *context, const hmath_value *depth, const hmath_value *regularization, const hmath_value *o, const hmath_value *g, const hmath_value *x0, hmath_value **out);
root.solve_system¶
root.solve_system(method, o, f, jac, x0)
Solve a square analytic-Jacobian system using Newton, trust-radius Newton, or rank-one Broyden updates.
Original: HMath.Root.solveSystem.
SystemMethod -> RootOptions -> ([Double] -> [Double]) -> ([Double] -> [[Double]]) -> [Double] -> Either MathError SystemRootResult
hmath_status hmath_root_solve_system(hmath_context *context, const hmath_value *method, const hmath_value *o, const hmath_value *f, const hmath_value *jac, const hmath_value *x0, hmath_value **out);
root.polynomial_roots¶
root.polynomial_roots(o, p)
Reuse the checked Aberth-Ehrlich simultaneous complex solver for an ascending-coefficient polynomial.
Original: HMath.Root.polynomialRoots.
hmath_status hmath_root_polynomial_roots(hmath_context *context, const hmath_value *o, const hmath_value *p, hmath_value **out);
root.real_polynomial_roots¶
root.real_polynomial_roots(budget, tolerance, p)
Use exact square-free factorization and Sturm isolation; return rational intervals and integer multiplicities.
Original: HMath.Root.realPolynomialRoots.
hmath_status hmath_root_real_polynomial_roots(hmath_context *context, const hmath_value *budget, const hmath_value *tolerance, const hmath_value *p, hmath_value **out);
ode.euler¶
ode.euler()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.Euler.
ode.heun¶
ode.heun()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.Heun.
ode.midpoint¶
ode.midpoint()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.Midpoint.
ode.rk2¶
ode.rk2()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.RK2.
ode.rk4¶
ode.rk4()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.RK4.
ode.rk23¶
ode.rk23()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.RK23.
ode.rk45¶
ode.rk45()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.RK45.
ode.dormand_prince¶
ode.dormand_prince()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.DormandPrince.
ode.dop853¶
ode.dop853()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.DOP853.
ode.adams_bashforth¶
ode.adams_bashforth()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.AdamsBashforth.
ode.adams_moulton¶
ode.adams_moulton()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.AdamsMoulton.
ode.predictor_corrector¶
ode.predictor_corrector()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.PredictorCorrector.
ode.backward_euler¶
ode.backward_euler()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.BackwardEuler.
ode.bdf¶
ode.bdf()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.BDF.
ode.radau¶
ode.radau()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.Radau.
ode.rosenbrock¶
ode.rosenbrock()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.Rosenbrock.
ode.ode_options¶
ode.ode_options(ode_absolute_tolerance, ode_relative_tolerance, initial_step, minimum_step, maximum_step, maximum_steps, newton_iterations)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.ODEOptions.
hmath_status hmath_ode_ode_options(hmath_context *context, const hmath_value *ode_absolute_tolerance, const hmath_value *ode_relative_tolerance, const hmath_value *initial_step, const hmath_value *minimum_step, const hmath_value *maximum_step, const hmath_value *maximum_steps, const hmath_value *newton_iterations, hmath_value **out);
ode.ode_absolute_tolerance¶
ode.ode_absolute_tolerance(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.odeAbsoluteTolerance.
hmath_status hmath_ode_ode_absolute_tolerance(hmath_context *context, const hmath_value *value, hmath_value **out);
ode.ode_relative_tolerance¶
ode.ode_relative_tolerance(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.odeRelativeTolerance.
hmath_status hmath_ode_ode_relative_tolerance(hmath_context *context, const hmath_value *value, hmath_value **out);
ode.initial_step¶
ode.initial_step(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.initialStep.
hmath_status hmath_ode_initial_step(hmath_context *context, const hmath_value *value, hmath_value **out);
ode.minimum_step¶
ode.minimum_step(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.minimumStep.
hmath_status hmath_ode_minimum_step(hmath_context *context, const hmath_value *value, hmath_value **out);
ode.maximum_step¶
ode.maximum_step(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.maximumStep.
hmath_status hmath_ode_maximum_step(hmath_context *context, const hmath_value *value, hmath_value **out);
ode.maximum_steps¶
ode.maximum_steps(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.maximumSteps.
hmath_status hmath_ode_maximum_steps(hmath_context *context, const hmath_value *value, hmath_value **out);
ode.newton_iterations¶
ode.newton_iterations(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.newtonIterations.
hmath_status hmath_ode_newton_iterations(hmath_context *context, const hmath_value *value, hmath_value **out);
ode.default_ode_options¶
ode.default_ode_options()
Conservative default adaptive settings for Double callbacks.
Original: HMath.ODE.defaultODEOptions.
ode.trajectory¶
ode.trajectory(trajectory_times, trajectory_states, trajectory_derivatives)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.Trajectory.
hmath_status hmath_ode_trajectory(hmath_context *context, const hmath_value *trajectory_times, const hmath_value *trajectory_states, const hmath_value *trajectory_derivatives, hmath_value **out);
ode.trajectory_times¶
ode.trajectory_times(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.trajectoryTimes.
hmath_status hmath_ode_trajectory_times(hmath_context *context, const hmath_value *value, hmath_value **out);
ode.trajectory_states¶
ode.trajectory_states(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.trajectoryStates.
hmath_status hmath_ode_trajectory_states(hmath_context *context, const hmath_value *value, hmath_value **out);
ode.trajectory_derivatives¶
ode.trajectory_derivatives(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.trajectoryDerivatives.
hmath_status hmath_ode_trajectory_derivatives(hmath_context *context, const hmath_value *value, hmath_value **out);
ode.solve_ivp¶
ode.solve_ivp(method, options, panels, f, start, end, initial)
Integrate on n equal panels. Multistep methods use genuine derivative history; implicit methods use checked finite-difference Newton iterations.
Original: HMath.ODE.solveIVP.
hmath_status hmath_ode_solve_ivp(hmath_context *context, const hmath_value *method, const hmath_value *options, const hmath_value *panels, const hmath_value *f, const hmath_value *start, const hmath_value *end, const hmath_value *initial, hmath_value **out);
ode.solve_adaptive¶
ode.solve_adaptive(method, options, f, start, end, initial)
Adaptive explicit RK integration. Euler/Heun/Midpoint/RK4 use step-doubling error estimates. RK23/RK45/DormandPrince/DOP853 use their embedded estimates. Multistep and implicit methods require 'solveIVP' to preserve their grid/history.
Original: HMath.ODE.solveAdaptive.
hmath_status hmath_ode_solve_adaptive(hmath_context *context, const hmath_value *method, const hmath_value *options, const hmath_value *f, const hmath_value *start, const hmath_value *end, const hmath_value *initial, hmath_value **out);
ode.interpolate_trajectory¶
ode.interpolate_trajectory(trajectory, t)
Cubic Hermite interpolation inside the trajectory's closed time range. Extrapolation, malformed public trajectories and repeated sample times fail.
Original: HMath.ODE.interpolateTrajectory.
hmath_status hmath_ode_interpolate_trajectory(hmath_context *context, const hmath_value *trajectory, const hmath_value *t, hmath_value **out);
ode.any_direction¶
ode.any_direction()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.AnyDirection.
ode.rising¶
ode.rising()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.Rising.
ode.falling¶
ode.falling()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.Falling.
ode.event¶
ode.event(event_time, event_state)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.Event.
hmath_status hmath_ode_event(hmath_context *context, const hmath_value *event_time, const hmath_value *event_state, hmath_value **out);
ode.event_time¶
ode.event_time(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.eventTime.
hmath_status hmath_ode_event_time(hmath_context *context, const hmath_value *value, hmath_value **out);
ode.event_state¶
ode.event_state(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.eventState.
hmath_status hmath_ode_event_state(hmath_context *context, const hmath_value *value, hmath_value **out);
ode.locate_events¶
ode.locate_events(direction, tolerance, function, trajectory)
Locate bracketed sign-changing events by dense-output bisection. Tangential roots and multiple roots inside one sample interval are not guaranteed.
Original: HMath.ODE.locateEvents.
EventDirection -> Double -> (Double -> [Double] -> Double) -> Trajectory -> Either MathError [Event]
hmath_status hmath_ode_locate_events(hmath_context *context, const hmath_value *direction, const hmath_value *tolerance, const hmath_value *function, const hmath_value *trajectory, hmath_value **out);
ode.solve_boundary¶
ode.solve_boundary(method, options, panels, f, boundary, start, end, guess)
Shooting boundary-value solver: all initial-state components are unknown. The boundary callback takes initial/final states and returns n residuals. Returns the trajectory matching a locally converged shooting root; convergence is local and depends on the supplied initial guess.
Original: HMath.ODE.solveBoundary.
Method -> ODEOptions -> Int -> ODE -> ([Double] -> [Double] -> [Double]) -> Double -> Double -> [Double] -> Either MathError Trajectory
hmath_status hmath_ode_solve_boundary(hmath_context *context, const hmath_value *method, const hmath_value *options, const hmath_value *panels, const hmath_value *f, const hmath_value *boundary, const hmath_value *start, const hmath_value *end, const hmath_value *guess, hmath_value **out);
ode.solve_dae¶
ode.solve_dae(options, panels, residual, start, end, initial, initial_derivative)
Index-one implicit DAE driver F(t,y,y')=0 with backward differences. Initial y and y' must be consistent to the configured tolerance. Each subsequent state is obtained by a full residual Newton solve.
Original: HMath.ODE.solveDAE.
ODEOptions -> Int -> (Double -> [Double] -> [Double] -> [Double]) -> Double -> Double -> [Double] -> [Double] -> Either MathError Trajectory
hmath_status hmath_ode_solve_dae(hmath_context *context, const hmath_value *options, const hmath_value *panels, const hmath_value *residual, const hmath_value *start, const hmath_value *end, const hmath_value *initial, const hmath_value *initial_derivative, hmath_value **out);
ode.symplectic_euler¶
ode.symplectic_euler()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.SymplecticEuler.
ode.verlet¶
ode.verlet()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.Verlet.
ode.leapfrog¶
ode.leapfrog()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.ODE.Leapfrog.
ode.solve_hamiltonian¶
ode.solve_hamiltonian(method, panels, velocity, force, start, end, q0, p0)
Fixed-step symplectic integration; output states concatenate q then p. Verlet is kick-drift-kick; Leapfrog is drift-kick-drift with integer-time output momenta. These equivalent second-order splittings have distinct order.
Original: HMath.ODE.solveHamiltonian.
HamiltonianMethod -> Int -> ([Double] -> [Double]) -> ([Double] -> [Double]) -> Double -> Double -> [Double] -> [Double] -> Either MathError Trajectory
hmath_status hmath_ode_solve_hamiltonian(hmath_context *context, const hmath_value *method, const hmath_value *panels, const hmath_value *velocity, const hmath_value *force, const hmath_value *start, const hmath_value *end, const hmath_value *q0, const hmath_value *p0, hmath_value **out);
ode.solve_nystrom¶
ode.solve_nystrom(panels, acceleration, start, end, q0, v0)
Fourth-order explicit Runge-Kutta-Nystrom method for q''=a(t,q), with acceleration independent of velocity. State output concatenates q and q'.
Original: HMath.ODE.solveNystrom.
Int -> (Double -> [Double] -> [Double]) -> Double -> Double -> [Double] -> [Double] -> Either MathError Trajectory
hmath_status hmath_ode_solve_nystrom(hmath_context *context, const hmath_value *panels, const hmath_value *acceleration, const hmath_value *start, const hmath_value *end, const hmath_value *q0, const hmath_value *v0, hmath_value **out);
ode.sensitivities¶
ode.sensitivities(method, options, panels, h, family, parameters, start, end, initial)
Terminal-state parameter sensitivities by centered perturbation of the complete IVP solve. Parameters use the same explicit finite-difference step.
Original: HMath.ODE.sensitivities.
Method -> ODEOptions -> Int -> Double -> ([Double] -> ODE) -> [Double] -> Double -> Double -> [Double] -> Either MathError (Matrix Double)
hmath_status hmath_ode_sensitivities(hmath_context *context, const hmath_value *method, const hmath_value *options, const hmath_value *panels, const hmath_value *h, const hmath_value *family, const hmath_value *parameters, const hmath_value *start, const hmath_value *end, const hmath_value *initial, hmath_value **out);
ode.equilibrium¶
ode.equilibrium(options, field, guess)
Find an autonomous equilibrium by a locally convergent Newton solve.
Original: HMath.ODE.equilibrium.
hmath_status hmath_ode_equilibrium(hmath_context *context, const hmath_value *options, const hmath_value *field, const hmath_value *guess, hmath_value **out);
ode.phase_trajectories¶
ode.phase_trajectories(value, value2, value3, value4, value5, value6, value7)
Compute autonomous phase-space trajectories for independently supplied starts.
Original: HMath.ODE.phaseTrajectories.
Method -> ODEOptions -> Int -> ([Double] -> [Double]) -> Double -> Double -> [[Double]] -> Either MathError [Trajectory]
hmath_status hmath_ode_phase_trajectories(hmath_context *context, const hmath_value *value, const hmath_value *value2, const hmath_value *value3, const hmath_value *value4, const hmath_value *value5, const hmath_value *value6, const hmath_value *value7, hmath_value **out);
ode.lyapunov_exponents¶
ode.lyapunov_exponents(options, panels, difference_step, f, start, end, initial)
Full Lyapunov spectrum by the Benettin tangent-space method: integrate variational equations with RK4, then modified Gram-Schmidt at each sample. Finite-difference Jacobians are used; results are finite-time estimates.
Original: HMath.ODE.lyapunovExponents.
hmath_status hmath_ode_lyapunov_exponents(hmath_context *context, const hmath_value *options, const hmath_value *panels, const hmath_value *difference_step, const hmath_value *f, const hmath_value *start, const hmath_value *end, const hmath_value *initial, hmath_value **out);
pde.dirichlet¶
pde.dirichlet(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.Dirichlet.
hmath_status hmath_pde_dirichlet(hmath_context *context, const hmath_value *value, hmath_value **out);
pde.neumann¶
pde.neumann(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.Neumann.
hmath_status hmath_pde_neumann(hmath_context *context, const hmath_value *value, hmath_value **out);
pde.robin¶
pde.robin(value, value2, value3)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.Robin.
hmath_status hmath_pde_robin(hmath_context *context, const hmath_value *value, const hmath_value *value2, const hmath_value *value3, hmath_value **out);
pde.periodic¶
pde.periodic()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.Periodic.
pde.finite_difference¶
pde.finite_difference()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.FiniteDifference.
pde.finite_volume¶
pde.finite_volume()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.FiniteVolume.
pde.finite_element¶
pde.finite_element()
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.FiniteElement.
pde.pde_result¶
pde.pde_result(pde_values, pde_residual, pde_error_estimate)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.PDEResult.
hmath_status hmath_pde_pde_result(hmath_context *context, const hmath_value *pde_values, const hmath_value *pde_residual, const hmath_value *pde_error_estimate, hmath_value **out);
pde.pde_values¶
pde.pde_values(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.pdeValues.
hmath_status hmath_pde_pde_values(hmath_context *context, const hmath_value *value, hmath_value **out);
pde.pde_residual¶
pde.pde_residual(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.pdeResidual.
hmath_status hmath_pde_pde_residual(hmath_context *context, const hmath_value *value, hmath_value **out);
pde.pde_error_estimate¶
pde.pde_error_estimate(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.pdeErrorEstimate.
hmath_status hmath_pde_pde_error_estimate(hmath_context *context, const hmath_value *value, hmath_value **out);
pde.grid¶
pde.grid(dims, bounds, periodic)
Construct a grid with >=3 nodes per axis; reject overflowing counts and rounded-away duplicate coordinates.
Original: HMath.PDE.grid.
hmath_status hmath_pde_grid(hmath_context *context, const hmath_value *dims, const hmath_value *bounds, const hmath_value *periodic, hmath_value **out);
pde.grid_shape¶
pde.grid_shape(value)
Number of nodes along each axis, preserving last-axis-fastest storage order.
Original: HMath.PDE.gridShape.
hmath_status hmath_pde_grid_shape(hmath_context *context, const hmath_value *value, hmath_value **out);
pde.grid_spacing¶
pde.grid_spacing(value)
Positive uniform distance between adjacent nodes on each axis.
Original: HMath.PDE.gridSpacing.
hmath_status hmath_pde_grid_spacing(hmath_context *context, const hmath_value *value, hmath_value **out);
pde.flatten_index¶
pde.flatten_index(value, value2)
Checked conversion of zero-based multidimensional node coordinates to a row-major flat index.
Original: HMath.PDE.flattenIndex.
hmath_status hmath_pde_flatten_index(hmath_context *context, const hmath_value *value, const hmath_value *value2, hmath_value **out);
pde.unflatten_index¶
pde.unflatten_index(value, value2)
Inverse checked row-major index conversion.
Original: HMath.PDE.unflattenIndex.
hmath_status hmath_pde_unflatten_index(hmath_context *context, const hmath_value *value, const hmath_value *value2, hmath_value **out);
pde.grid_coordinates¶
pde.grid_coordinates(value)
Physical coordinates in flat storage order; periodic upper endpoints are omitted.
Original: HMath.PDE.gridCoordinates.
hmath_status hmath_pde_grid_coordinates(hmath_context *context, const hmath_value *value, hmath_value **out);
pde.assemble_pde¶
pde.assemble_pde(value, value2, value3, value4, value5)
Assemble -kappa*Laplacian (FD) or -div(kappa grad) (FV/FEM) plus constant reaction; coefficient field is positive at every node.
Original: HMath.PDE.assemblePDE.
Discretization -> Grid -> [(Boundary, Boundary)] -> [Double] -> Double -> Either MathError PDEOperator
hmath_status hmath_pde_assemble_pde(hmath_context *context, const hmath_value *value, const hmath_value *value2, const hmath_value *value3, const hmath_value *value4, const hmath_value *value5, hmath_value **out);
pde.pde_stiffness¶
pde.pde_stiffness(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.pdeStiffness.
hmath_status hmath_pde_pde_stiffness(hmath_context *context, const hmath_value *value, hmath_value **out);
pde.pde_mass¶
pde.pde_mass(value)
Construct or inspect the original immutable record; field order follows the source signature.
Original: HMath.PDE.pdeMass.
hmath_status hmath_pde_pde_mass(hmath_context *context, const hmath_value *value, hmath_value **out);
pde.pde_boundary_load¶
pde.pde_boundary_load(value)
Read boundary contributions, including prescribed values at essential rows.
Original: HMath.PDE.pdeBoundaryLoad.
hmath_status hmath_pde_pde_boundary_load(hmath_context *context, const hmath_value *value, hmath_value **out);
pde.solve_elliptic¶
pde.solve_elliptic(value, value2)
Dense pivoted reference solve and independently recomputed infinity residual. The error estimate is backward residual, not continuum error.
Original: HMath.PDE.solveElliptic.
hmath_status hmath_pde_solve_elliptic(hmath_context *context, const hmath_value *value, const hmath_value *value2, hmath_value **out);
pde.poisson¶
pde.poisson(method, g, bc, forcing)
Solve a unit-diffusivity zero-reaction Poisson problem with the selected spatial discretization.
Original: HMath.PDE.poisson.
hmath_status hmath_pde_poisson(hmath_context *context, const hmath_value *method, const hmath_value *g, const hmath_value *bc, const hmath_value *forcing, hmath_value **out);
pde.laplace¶
pde.laplace(method, g, bc)
Solve the corresponding homogeneous-source boundary-value problem.
Original: HMath.PDE.laplace.
hmath_status hmath_pde_laplace(hmath_context *context, const hmath_value *method, const hmath_value *g, const hmath_value *bc, hmath_value **out);
pde.helmholtz¶
pde.helmholtz(method, g, bc, k, forcing)
Solve -Laplacian(u)-k²u=f; resonances/singular systems fail.
Original: HMath.PDE.helmholtz.
Discretization -> Grid -> [(Boundary, Boundary)] -> Double -> [Double] -> Either MathError PDEResult
hmath_status hmath_pde_helmholtz(hmath_context *context, const hmath_value *method, const hmath_value *g, const hmath_value *bc, const hmath_value *k, const hmath_value *forcing, hmath_value **out);
pde.spatial_gradient¶
pde.spatial_gradient(value, value2)
Second-order central spatial gradients; physical endpoints use second-order one-sided stencils.
Original: HMath.PDE.spatialGradient.
hmath_status hmath_pde_spatial_gradient(hmath_context *context, const hmath_value *value, const hmath_value *value2, hmath_value **out);
pde.laplacian_stencil¶
pde.laplacian_stencil(g, bc, values)
Apply the FD Laplacian with ghost normal/Robin boundary data. Essential rows return prescribed-value minus current-value residuals.
Original: HMath.PDE.laplacianStencil.
hmath_status hmath_pde_laplacian_stencil(hmath_context *context, const hmath_value *g, const hmath_value *bc, const hmath_value *values, hmath_value **out);
pde.spectral_derivative¶
pde.spectral_derivative(value, value2, value3, value4)
Periodic Fourier collocation derivative of order 0..8 along one axis; odd real Nyquist derivatives are zero.
Original: HMath.PDE.spectralDerivative.
hmath_status hmath_pde_spectral_derivative(hmath_context *context, const hmath_value *value, const hmath_value *value2, const hmath_value *value3, const hmath_value *value4, hmath_value **out);
pde.spectral_laplacian¶
pde.spectral_laplacian(g, values)
Sum periodic second Fourier derivatives over all spatial axes.
Original: HMath.PDE.spectralLaplacian.
hmath_status hmath_pde_spectral_laplacian(hmath_context *context, const hmath_value *g, const hmath_value *values, hmath_value **out);
pde.spectral_poisson¶
pde.spectral_poisson(value, value2, value3)
Solve (-Laplacian+reaction)u=f spectrally; reaction>=0, and zero reaction requires a mean-free source with zero-mean solution gauge.
Original: HMath.PDE.spectralPoisson.
hmath_status hmath_pde_spectral_poisson(hmath_context *context, const hmath_value *value, const hmath_value *value2, const hmath_value *value3, hmath_value **out);
pde.pseudo_spectral_diffusion¶
pde.pseudo_spectral_diffusion(g, kappas, values)
Pseudospectral divergence(kappa*gradient u). Products are evaluated at collocation nodes; no implicit de-aliasing, so caller must resolve coefficients.
Original: HMath.PDE.pseudoSpectralDiffusion.
hmath_status hmath_pde_pseudo_spectral_diffusion(hmath_context *context, const hmath_value *g, const hmath_value *kappas, const hmath_value *values, hmath_value **out);
pde.method_of_lines¶
pde.method_of_lines(value, value2, value3, value4, value5)
Method of lines with a constant assembled operator and checked time-source callback. Essential Dirichlet values remain constant in time; initial state must satisfy them. Consistent FEM mass is inverted on unconstrained rows.
Original: HMath.PDE.methodOfLines.
O.Method -> PDEOperator -> (Double -> [Double]) -> [Double] -> [Double] -> Either MathError O.Trajectory
hmath_status hmath_pde_method_of_lines(hmath_context *context, const hmath_value *value, const hmath_value *value2, const hmath_value *value3, const hmath_value *value4, const hmath_value *value5, hmath_value **out);
pde.heat¶
pde.heat(value, value2, value3, value4, value5)
Explicit heat/diffusion uses RK4, with a conservative forward-Euler CFL check (therefore valid for RK4 too). Positive diffusivity and ordered times.
Original: HMath.PDE.heat.
hmath_status hmath_pde_heat(hmath_context *context, const hmath_value *value, const hmath_value *value2, const hmath_value *value3, const hmath_value *value4, const hmath_value *value5, hmath_value **out);
pde.diffusion¶
pde.diffusion(method, g, bc, kappas, times, initial)
Variable positive nodal diffusivity, chosen spatial method and increasing output times; FEM uses a stricter consistent-mass CFL bound.
Original: HMath.PDE.diffusion.
Discretization -> Grid -> [(Boundary, Boundary)] -> [Double] -> [Double] -> [Double] -> Either MathError O.Trajectory
hmath_status hmath_pde_diffusion(hmath_context *context, const hmath_value *method, const hmath_value *g, const hmath_value *bc, const hmath_value *kappas, const hmath_value *times, const hmath_value *initial, hmath_value **out);
pde.wave¶
pde.wave(g, speed, times, initial, velocity)
Periodic velocity-Verlet wave equation u_tt=c² Laplacian(u); returns u at requested equally or unequally spaced increasing times. Spectral Laplacian.
Original: HMath.PDE.wave.
hmath_status hmath_pde_wave(hmath_context *context, const hmath_value *g, const hmath_value *speed, const hmath_value *times, const hmath_value *initial, const hmath_value *velocity, hmath_value **out);
pde.advection¶
pde.advection(value, value2, value3, value4)
Conservative first-order upwind periodic advection, central conservative variable-coefficient diffusion. Explicit Euler preserves constants and total mass for periodic data when the combined positivity CFL is satisfied.
Original: HMath.PDE.advection.
hmath_status hmath_pde_advection(hmath_context *context, const hmath_value *value, const hmath_value *value2, const hmath_value *value3, const hmath_value *value4, hmath_value **out);
pde.advection_diffusion¶
pde.advection_diffusion(value, value2, value3, value4, value5)
Periodic upwind advection plus central diffusion using explicit Euler and the combined positivity CFL bound.
Original: HMath.PDE.advectionDiffusion.
hmath_status hmath_pde_advection_diffusion(hmath_context *context, const hmath_value *value, const hmath_value *value2, const hmath_value *value3, const hmath_value *value4, const hmath_value *value5, hmath_value **out);
pde.stability_limit¶
pde.stability_limit(g, diffusivity, velocity)
Conservative explicit positivity bound 1/sum(|v|/h+2*kappa/h^2); infinity denotes a zero spatial operator.
Original: HMath.PDE.stabilityLimit.
hmath_status hmath_pde_stability_limit(hmath_context *context, const hmath_value *g, const hmath_value *diffusivity, const hmath_value *velocity, hmath_value **out);
pde.cfl_number¶
pde.cfl_number(g, diffusivity, velocity, dt)
Requested nonnegative timestep divided by the conservative combined stability limit.
Original: HMath.PDE.cflNumber.
hmath_status hmath_pde_cfl_number(hmath_context *context, const hmath_value *g, const hmath_value *diffusivity, const hmath_value *velocity, const hmath_value *dt, hmath_value **out);
pde.manufactured_error¶
pde.manufactured_error(g, exact, values)
Maximum absolute nodal difference from a finite exact-solution callback; this measures continuum error when an exact solution is known.
Original: HMath.PDE.manufacturedError.