Loading...
Loading...
Select and configure time integration methods for ODE/PDE simulations. Use when choosing explicit/implicit schemes, setting error tolerances, adapting time steps, diagnosing integration accuracy, planning IMEX splitting, or handling stiff/non-stiff coupled systems.
npx skill4agent add heshamfs/materials-simulation-skills numerical-integration| Input | Description | Example |
|---|---|---|
| Problem type | ODE/PDE, stiff/non-stiff | |
| Jacobian available | Can compute ∂f/∂u? | |
| Target accuracy | Desired error level | |
| Constraints | Memory, implicit allowed? | |
| Time scale | Characteristic time | |
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 |
|---|---|
| |
| |
| |
| |
| |
references/tolerance_guidelines.mdscripts/integrator_selector.pyscripts/error_norm.pyscripts/adaptive_step_controller.pyscripts/imex_split_planner.pypython3 scripts/integrator_selector.py --stiff --jacobian-available --accuracy high --jsonpython3 scripts/imex_split_planner.py --stiff-terms diffusion --nonstiff-terms reaction --coupling weak --jsonrtolatol# 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 |
|---|---|---|
| Invalid tolerances | Use positive values |
| Negative error norm | Check error computation |
| Invalid controller type | Use |
| 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 | Properties | Best For |
|---|---|---|
| I (integral) | Simple, some overshoot | Non-stiff, moderate accuracy |
| PI (proportional-integral) | Smooth, robust | General use |
| PID | Aggressive adaptation | Rapidly varying dynamics |
| Coupling | Strategy |
|---|---|
| Weak | Simple operator splitting |
| Moderate | Strang splitting |
| Strong | Fully coupled IMEX-RK |
references/method_catalog.mdreferences/tolerance_guidelines.mdreferences/error_control.mdreferences/imex_guidelines.mdreferences/splitting_catalog.mdreferences/multiphase_field_patterns.md