differentiation-schemes
Generate finite-difference stencils, select optimal numerical schemes for PDEs/ODEs, and perform truncation error analysis to improve simulation accuracy.
Introduction
The differentiation-schemes skill provides a robust toolkit for simulation engineers and researchers needing to discretize differential equations accurately. Designed for computational materials science and fluid dynamics workflows, it enables users to generate optimal finite-difference stencils tailored to specific grid types, boundary conditions, and accuracy requirements. By bridging the gap between theoretical numerical analysis and practical implementation, the skill helps engineers select between central, upwind, compact (Padé), and spectral methods based on field smoothness and the presence of discontinuities like shocks.
-
Automated generation of finite-difference stencils for arbitrary derivative orders and truncation accuracy levels.
-
Intelligent scheme selection guidance based on flow physics, including advection-dominated vs. diffusion-dominated problems.
-
Comprehensive truncation error estimation to quantify grid sensitivity and verify spatial discretization.
-
Integration with Python-based numerical workflows, ensuring portability across AI coding agents like Claude Code, Cursor, and VS Code Copilot.
-
Built-in validation logic to handle complex scenarios such as one-sided boundary stencils or nonuniform grids.
-
Input requirements include derivative order, target truncation accuracy, grid type (uniform/nonuniform), and physical constraints (e.g., periodic vs. Dirichlet/Neumann boundaries).
-
CLI-based execution via stencil_generator.py, scheme_selector.py, and truncation_error.py ensures reproducible, deterministic JSON outputs for downstream simulation tasks.
-
Ideal for addressing common simulation pitfalls such as excessive numerical diffusion, dispersion errors, or incorrect operator implementation in nonstandard physics engines.
-
Users should define smoothness parameters to let the agent distinguish between smooth spectral-capable regions and shock-prone areas requiring TVD or WENO schemes.
-
Constraints include limited dependency requirements (NumPy focused), emphasizing lightweight, high-performance execution without the overhead of heavy computational frameworks.
Repository Stats
- Stars
- 31
- Forks
- 2
- Open Issues
- 0
- Language
- Python
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 4, 2026, 12:34 AM