resolve_tolerances
Stable function · Simulation
Tier: stable · Kind: function · Topic: Simulation
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
resolve_tolerances | resolveTolerances | resolve_tolerances | resolve_tolerances | outside profile |
Julia
resolve_tolerances(solver; abstol, reltol)
resolve_tolerances(solver; abstol=nothing, reltol=nothing) -> (abstol, reltol)
Resolve integration tolerances most-specific first (esm-spec §2.2.2):
- An explicit argument at the
solvecall site — wins outright. - Otherwise the document’s
solver.abstol/solver.reltol. - Otherwise the binding default (
reltol1e-4,abstol1e-6).
The two resolve INDEPENDENTLY, so a document declaring only reltol leaves
abstol on the default — the same per-field fall-through §6.6.4 uses.
These are INTEGRATION tolerances, a DIFFERENT QUANTITY from the Tolerance
an assertion is COMPARED at (§6.6.4), which resolves on its own chain.
TypeScript
function resolveTolerances(solver: Solver | undefined | null, opts?: { abstol?: number; reltol?: number }): { abstol: number; reltol: number }
Resolve integration tolerances most-specific first (esm-spec §2.2.2):
- An explicit argument at the call site — wins outright.
- Otherwise the document’s
solver.abstol/solver.reltol. - Otherwise the binding default (
reltol1e-4,abstol1e-6).
The two resolve INDEPENDENTLY, so a document declaring only reltol leaves
abstol on the default — the same per-field fall-through §6.6.4 uses.
These are INTEGRATION tolerances, a different quantity from the tolerance
object an assertion is COMPARED at (§6.6.4).
Python
resolve_tolerances(solver: Any, abstol: float | None = None, reltol: float | None = None) -> tuple[float, float]
Resolve integration tolerances most-specific first (esm-spec §2.2.2).
solver may be a Solver
, the raw
solver block as a dict (what EsmProblem.doc carries), or None.
- An explicit argument at the
solve()call site — wins outright. - Otherwise the document’s
solver.abstol/solver.reltol. - Otherwise the binding default (
reltol1e-4,abstol1e-6).
The two tolerances resolve INDEPENDENTLY: a document that declares only
reltol leaves abstol to fall through to the default, exactly as
§6.6.4 merges its own chain per field.
These are INTEGRATION tolerances. They are a different quantity from the
tolerance object an assertion is compared at (§6.6.4), which resolves
on its own chain and is not touched here.
Rust
pub fn resolve_tolerances(solver: Option<&Solver>, abstol: Option<f64>, reltol: Option<f64>) -> (f64, f64)
Resolve integration tolerances most-specific first (esm-spec §2.2.2):
- An explicit argument at the
solvecall site — wins outright. - Otherwise the document’s
solver.abstol/solver.reltol. - Otherwise the binding default (
reltol1e-4,abstol1e-6).
The two resolve INDEPENDENTLY, so a document declaring only reltol leaves
abstol on the default — the same per-field fall-through §6.6.4 uses.
These are INTEGRATION tolerances, a different quantity from the tolerance
object an assertion is COMPARED at (§6.6.4).
Go
Not available in Go. Go is outside the simulation capability profile (Julia, Python, Rust): build an RHS and integrate it; TypeScript and Go are deliberately non-simulating.