numerical-integration

Select and configure time integration methods for ODE and PDE simulations.

61|4|Updated Dec 24, 2025
One-click install
npx skills add https://github.com/HeshamFS/materials-simulation-skills --skill numerical-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: numerical-integration
Source: https://github.com/HeshamFS/materials-simulation-skills/tree/main/skills/core-numerical/numerical-integration
Command: npx skills add https://github.com/HeshamFS/materials-simulation-skills --skill numerical-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps you select time integration methods, set tolerances, and manage adaptive stepping for ODE/PDE simulations, handling stiffness, explicit/implicit splitting, and error control to keep simulations accurate and efficient.

Core Features & Use Cases

  • Integrator selector: Choose RK, implicit multistep, or IMEX schemes based on stiffness and accuracy needs.
  • Error control: Configure adaptive step size using error norms and controllers.
  • IMEX planning: Plan splitting strategies for mixed stiff/non-stiff terms.
  • Use Case: For a stiff reaction-diffusion system, select SBDF2 with an implicit diffusion term and explicit reaction term.

Quick Start

Example commands: python3 scripts/integrator_selector.py --stiff --jacobian-available --accuracy high --json python3 scripts/adaptive_step_controller.py --dt 1e-3 --error-norm 0.8 --order 4 --json

Frequently Asked Questions about numerical-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between explicit and implicit time integration methods for my ODE simulation?

Time integration method selection depends on stiffness: explicit methods like Runge-Kutta suit non-stiff problems with fast dynamics, while implicit multistep schemes handle stiff systems where fast and slow timescales coexist. Use the integrator selector with the --stiff flag to match your problem's characteristics and accuracy requirements.

What is adaptive time stepping and when do I need it for PDE simulations?

Adaptive time stepping automatically adjusts step size based on estimated local error, keeping accuracy within a tolerance while reducing unnecessary computation. It's essential for PDEs with varying dynamics—reaction-diffusion systems, for example—where fixed steps either waste time or accumulate error.

How do I set up IMEX splitting for a multiphysics coupling with stiff and non-stiff terms?

IMEX (implicit-explicit) schemes treat stiff terms implicitly and non-stiff terms explicitly, avoiding the cost of fully implicit solves. Plan your splitting by identifying which terms dominate stiffness, then use the IMEX planning feature to configure the split and select an appropriate IMEX method like SBDF2.

What error control options does adaptive stepping provide, and how do I tune tolerance?

Error control uses error norms and step controllers to estimate local truncation error and adjust step size accordingly. Configure tolerance via error-norm thresholds and integrator order; tighter tolerances improve accuracy but increase cost, while looser tolerances reduce computation at the expense of precision.

Can I use time integration selection with Python 3.8+ and NumPy only?

Yes, this Skill requires only Python 3.8+ and NumPy with minimal dependencies, making it lightweight and portable. CLI scripts emit structured JSON outputs compatible with downstream workflows, so you can integrate step recommendations and error metrics into larger simulation pipelines.

What's the difference between stiff and non-stiff ODE problems, and which integrator should I use?

Stiff problems contain both fast and slow timescales; explicit methods become inefficient because they must use tiny steps to resolve fast dynamics. Non-stiff problems have well-separated timescales or smooth behavior; explicit Runge-Kutta methods are faster. Use the stiff flag to select appropriate schemes.