From full
Selects and configures time integration methods for ODE/PDE simulations: Runge-Kutta, BDF, Rosenbrock, Adams, with adaptive step control and IMEX splitting for stiff/non-stiff problems.
How this skill is triggered — by the user, by Claude, or both
Slash command
/full:numerical-integrationThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Provide a reliable workflow to select integrators, set tolerances, and manage adaptive time stepping for time-dependent simulations.
CHANGELOG.mdevals/evals.jsonreferences/error_control.mdreferences/imex_guidelines.mdreferences/method_catalog.mdreferences/multiphase_field_patterns.mdreferences/splitting_catalog.mdreferences/tolerance_guidelines.mdscripts/adaptive_step_controller.pyscripts/error_norm.pyscripts/imex_split_planner.pyscripts/integrator_selector.pyscripts/splitting_error_estimator.pyProvide a reliable workflow to select integrators, set tolerances, and manage adaptive time stepping for time-dependent simulations.
| Input | Description | Example |
|---|---|---|
| Problem type | ODE/PDE, stiff/non-stiff | stiff PDE |
| Jacobian available | Can compute ∂f/∂u? | yes |
| Target accuracy | Desired error level | 1e-6 |
| Constraints | Memory, implicit allowed? | implicit OK |
| Time scale | Characteristic time | 1e-3 s |
Is the problem stiff?
├── YES → Is Jacobian available?
│ ├── YES → Use Rosenbrock or BDF
│ └── NO → Use BDF with numerical Jacobian
└── NO → Is high accuracy needed?
├── YES → Use RK45 or DOP853
└── NO → Use RK4 or Adams-Bashforth
| Symptom | Likely Stiff | Action |
|---|---|---|
| dt shrinks to tiny values | Yes | Switch to implicit |
| Eigenvalues span many decades | Yes | Use BDF/Radau |
| Smooth solution, reasonable dt | No | Stay explicit |
| Script | Key Outputs |
|---|---|
scripts/error_norm.py | error_norm, scale_min, scale_max |
scripts/adaptive_step_controller.py | accept, dt_next, factor |
scripts/integrator_selector.py | recommended, alternatives, notes |
scripts/imex_split_planner.py | implicit_terms, explicit_terms, splitting_strategy |
scripts/splitting_error_estimator.py | error_estimate, substeps |
references/tolerance_guidelines.mdscripts/integrator_selector.pyscripts/error_norm.py for step acceptancescripts/adaptive_step_controller.pyscripts/imex_split_planner.pyUser: I'm solving the Allen-Cahn equation with a stiff double-well potential. What integrator should I use?
Agent workflow:
python3 scripts/integrator_selector.py --stiff --jacobian-available --accuracy high --json
python3 scripts/imex_split_planner.py --stiff-terms diffusion --nonstiff-terms reaction --coupling weak --json
rtol/atol consistent with physics and units# Select integrator for stiff problem with Jacobian
python3 scripts/integrator_selector.py --stiff --jacobian-available --accuracy high --json
# Compute scaled error norm
python3 scripts/error_norm.py --error 0.01,0.02 --solution 1.0,2.0 --rtol 1e-3 --atol 1e-6 --json
# Adaptive step control with PI controller
python3 scripts/adaptive_step_controller.py --dt 1e-2 --error-norm 0.8 --order 4 --controller pi --json
# Plan IMEX splitting
python3 scripts/imex_split_planner.py --stiff-terms diffusion,elastic --nonstiff-terms reaction --coupling strong --json
# Estimate splitting error
python3 scripts/splitting_error_estimator.py --dt 1e-4 --scheme strang --commutator-norm 50 --target-error 1e-6 --json
| Error | Cause | Resolution |
|---|---|---|
rtol must be a non-negative finite number / atol must be a non-negative finite number | Invalid tolerances | Use non-negative finite values |
error_norm must be finite and non-negative | Negative or non-finite error norm | Check error computation |
scale must be positive; with min_scale=0 ensure atol>0 or rtol*|y|>0 | All scale entries collapsed to 0 (e.g. rtol=0, atol=0, default min_scale=0) | Set atol>0, rtol>0, or --min-scale > 0 |
argument --controller: invalid choice: ... (choose from p, pi) | Invalid controller type | Use p or pi |
Provide at least one stiff or non-stiff term | Empty term list | Specify stiff or nonstiff terms |
| Error Norm | Meaning | Action |
|---|---|---|
| < 1.0 | Step acceptable | Accept, maybe increase dt |
| ≈ 1.0 | At tolerance boundary | Accept with current dt |
| > 1.0 | Step rejected | Reject, reduce dt |
| Controller | CLI value | Properties | Best For |
|---|---|---|---|
| P (elementary / integral) | p (default) | Simple, some overshoot | Non-stiff, moderate accuracy |
| PI (proportional-integral) | pi | Smooth, robust (requires --prev-error) | General use |
PID control is described in
references/error_control.mdfor reference only; theadaptive_step_controller.pyCLI implementspandpicontrollers.
| Coupling | Strategy |
|---|---|
| Weak | Simple operator splitting |
| Moderate | Strang splitting |
| Strong | Fully coupled IMEX-RK |
error_norm (and scale_min/scale_max) from scripts/error_norm.py and confirmed scale_min > 0, so no component reduced to atol-only scaling by accident.error_norm <= accept_threshold (default 1.0) per scripts/adaptive_step_controller.py; logged any accept: false steps and the resulting dt_next/factor rather than forcing the step through.--prev-error and verified controller_used reported pi (not the silent p fallback that occurs when --prev-error is omitted).scripts/integrator_selector.py with the actual --stiff/--jacobian-available/--accuracy flags matching the problem and recorded recommended plus the notes (e.g. the "expect smaller dt" warning for stiff-without-implicit).error_estimate, substeps, and dt_effective from scripts/splitting_error_estimator.py and confirmed error_estimate <= target-error after substepping, using the correct --scheme order (lie=1, strang=2).rtol/atol and confirmed the solution change is below the target accuracy, rather than trusting a single tolerance run.| Tempting shortcut | Why it's wrong / what to do |
|---|---|
"I picked an implicit/BDF method, so any dt is fine." | Unconditional stability is not accuracy; large dt still inflates temporal error. Check error_norm against the accept threshold and run the tighter-tolerance convergence check (Workflow step 7). |
"error_norm came back < 1, so the step and the whole run are correct." | The norm only certifies the local step under the chosen rtol/atol. A loose tolerance passes every step while the global solution is wrong — tighten tolerances and confirm convergence before trusting results. |
"I'll use the PI controller for smoother stepping" but omit --prev-error. | Without --prev-error the script silently falls back to the P controller (controller_used: p). You get no PI benefit. Pass the previous accepted error_norm and verify controller_used: pi. |
| "Strang vs Lie splitting won't matter much here." | Splitting error scales as commutator_norm * dt^(order+1) with order 1 (lie) vs 2 (strang). For a nonzero commutator the schemes differ by a full power of dt — run splitting_error_estimator.py with the actual --commutator-norm and --target-error instead of guessing. |
| "The selector recommended IMEX/RK-Chebyshev, so I'll just run explicitly without a Jacobian." | That branch fires only for stiff problems without implicit solves and the script warns "expect smaller dt." Read the notes: provide a Jacobian/Jv product and use BDF/Radau if implicit solves are feasible. |
| "It ran to the final time without crashing, so the integration is valid." | Completion is not correctness. Verify step acceptance (error_norm <= threshold), splitting error within target-error, and convergence under tighter tolerances; for conservative problems pass --conservative to imex_split_planner.py and check conserved quantities. |
dt, rtol, atol, error_norm, stiffness_ratio, commutator_norm, etc.) are validated as finite numbers at the function boundaryimex_split_planner.py validates term names against [a-zA-Z_][a-zA-Z0-9_ -]* with length and count limits, preventing injection payloads in user-supplied term listsdimension capped at 10 billion, order at 20, stiffness_ratio at 1e30--controller is validated against a fixed allowlist (p, pi)--scheme is validated against known splitting schemes (lie, strang)allowed-tools excludes Bash to prevent the agent from executing arbitrary commands when processing user-provided inputseval(), exec(), or dynamic code generationshell=True)references/method_catalog.md - Integrator options and propertiesreferences/tolerance_guidelines.md - Choosing rtol/atolreferences/error_control.md - Error norm and adaptation formulasreferences/imex_guidelines.md - Stiff/non-stiff splittingreferences/splitting_catalog.md - Operator splitting patternsreferences/multiphase_field_patterns.md - Phase-field specific splitsnpx claudepluginhub heshamfs/materials-simulation-skills --plugin core-numericalChecks CFL and Fourier stability criteria for PDE simulations, performs von Neumann analysis, detects stiffness, and recommends explicit vs implicit time-stepping.
Classifies ODE/PDE type, selects analytical or numerical solution methods, validates solutions, and interprets physical meaning.
Runs CFD simulations using the FluidSim Python framework with pseudospectral FFT methods. Supports Navier-Stokes (2D/3D), shallow water, and stratified flow equations for turbulence, vortex dynamics, and geophysical analysis.