Adaptive Timestep¶
Last changes: Documentation changelog
Contract¶
This page records the embedded-error and step-doubling controls exposed by AdaptiveTimestep.
Governing equations¶
Error control mathematics belongs to Adaptive time stepping.
Symbols and SI units¶
Tolerances are relative/absolute dimensionless mixed-error bounds; dt_initial, dt_min, and
dt_max are in seconds.
Assumptions and validity¶
At least one of atol/rtol must be positive; step bounds must satisfy
dt_min <= dt_initial <= dt_max.
Python API¶
Python |
Type |
Default |
SI unit |
Validation |
Meaning |
Backend support |
ProblemIR |
|---|---|---|---|---|---|---|---|
— |
— |
— |
\(1\) |
— |
— |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
— |
|
|
|
\(\mathrm{s}\) |
Non-negative; one of atol/rtol positive |
Absolute tolerance |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(\mathrm{s}\) |
Non-negative |
Relative tolerance |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(\mathrm{s}\) |
Within |
Initial step |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(\mathrm{s}\) |
Positive |
Minimum step |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(\mathrm{s}\) |
|
Maximum step |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(\mathrm{s}\) |
|
Step safety factor |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(\mathrm{s}\) |
|
Growth limit |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(\mathrm{s}\) |
|
Shrink limit |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(\mathrm{s}\) |
Positive |
Spin-rotation cap |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
|
|
|
\(\mathrm{s}\) |
Positive |
Norm tolerance |
FEM/FDM CPU/GPU; planner and runtime capability checks remain authoritative |
|
A max_error convenience mode sets rtol=0 and records tolerance_mode="max_error".
Complete stage-first example¶
# %% Adaptive RK45 with embedded error control
import fullmag as fm
nm = 1.0e-9
study = fm.study("adaptive_timestep_api_example")
study.engine("fdm")
study.device("cpu", precision="double")
study.mode("strict")
study.objects.mesh.defaults(cell_size=(2 * nm, 2 * nm, 5 * nm))
film = study.geometry(fm.Box(100 * nm, 20 * nm, 5 * nm), name="film")
film.Ms = 800.0e3
film.Aex = 13.0e-12
film.alpha = 0.02
film.m = fm.init.UniformMagnetization((1.0, 0.0, 0.0))
study.exchange()
study.solver(
integrator="rk45",
adaptive_timestep=fm.AdaptiveTimestep(
atol=1.0e-6,
rtol=1.0e-3,
dt_min=1.0e-15,
dt_max=1.0e-12,
),
gamma=2.211e5,
)
study.stages.add_run(stage_id="run", until=1.0e-9)
ProblemIR¶
AdaptiveTimestep.to_ir() emits tolerance_mode, atol, rtol, dt_initial, dt_min,
safety, growth_limit, shrink_limit, and optional dt_max, max_spin_rotation,
norm_tolerance.
Round-trip and failure semantics¶
Requested intent is the value authored by Python and preserved in ProblemIR; resolved execution is the planner or realization result. Validation errors identify the violated domain rule, and unsupported combinations are rejected explicitly rather than silently substituted.
Bound violations and zero tolerance pairs fail immediately. A _from_max_error policy is a
compatibility normalization, not a distinct physics.
Discrete realization¶
Step selection is realized by the embedded RK estimators and the coupled IMEX step-doubling lane.
Implementation mapping¶
Anchor: packages/fullmag-py/src/fullmag/model/dynamics.py (class AdaptiveTimestep).
Validation¶
Ownership tests compare this inventory with live signatures.
Limitations¶
Adaptive stepping requires an adaptive integrator; fixed-step schemes reject the policy.
Scientific bibliography¶
Error-control references belong to the time-integration numerical pages.
Control Room crosswalk¶
Status: Common solver/stage fields are partial; backend-specific options without editor fields remain not implemented.
Python/API surface |
Control Room path |
Status |
Transaction |
|---|---|---|---|
Parameters documented on this page |
|
|
Apply stage draft; solver request and result resources become stale |
Parameters without a named UI field |
|
|
Python-only until implemented |
not implemented: frontend support for dynamics parameters not rendered by the stage editor.
See Control Room capability register for the support matrix and not implemented policy.
Frontend source owner: apps/control-room/src/modules/inspector/panels/StudyStageDraftEditor.tsx (StudyStageDraftEditor).
Source-code index¶
Claim |
Path |
Stable symbol |
Responsibility |
Evidence |
|---|---|---|---|---|
Adaptive policy |
|
|
Step control lowering |
Ownership test |
Source-map coverage¶
Claim |
Path |
Stable symbol |
Responsibility |
Evidence |
|---|---|---|---|---|
Adaptive-step parameters, validation, and IR lowering. |
|
|
Adaptive-step parameters, validation, and IR lowering. |
Source-map validator and focused API tests |