Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

numerical-stability数值稳定性

Agent Skill

numerical-stability 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

760

周安装

32

GitHub Stars

31

下载量

266
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:numerical-stability(数值稳定性)
来源仓库:https://github.com/heshamfs/materials-simulation-skills
仓库路径:skills/numerical-stability
安装命令:
npx skills add https://github.com/heshamfs/materials-simulation-skills --skill numerical-stability
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/heshamfs/materials-simulation-skills --skill numerical-stability

简介

numerical-stability 用于查找、检索和筛选相关信息,适合在主流 Agent 宿主中快速定位候选结果。

  • 适用于围绕数值稳定性分析进行信息检索。
  • 通过 npx skills add 命令安装,需结合原始 README 确认具体用法。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件读写操作。
  • 可结合来源仓库进一步核验功能细节和使用限制。

SKILL.md

Numerical Stability

Goal

Provide a repeatable checklist and script-driven checks to keep time-dependent simulations stable and defensible.

Requirements

  • Python 3.8+
  • NumPy (for matrix_condition.py and von_neumann_analyzer.py)
  • See scripts/requirements.txt for dependencies

Inputs to Gather

InputDescriptionExample
Grid spacing dxSpatial discretization0.01 m
Time step dtTemporal discretization1e-4 s
Velocity vAdvection speed1.0 m/s
Diffusivity DThermal/mass diffusivity1e-5 m²/s
Reaction rate kFirst-order rate constant100 s⁻¹
Dimensions1D, 2D, or 3D2
Scheme typeExplicit or implicitexplicit

Decision Guidance

Choosing Explicit vs Implicit

Is the problem stiff (fast + slow dynamics)?
├── YES → Use implicit or IMEX scheme
│         └── Check conditioning with matrix_condition.py
└── NO → Is CFL/Fourier satisfied with reasonable dt?
    ├── YES → Use explicit scheme (cheaper per step)
    └── NO → Consider implicit or reduce dx

Stability Limit Quick Reference

PhysicsNumberExplicit Limit (1D)Formula
AdvectionCFLC ≤ 1C = v·dt/dx
DiffusionFourierFo ≤ 0.5Fo = D·dt/dx²
ReactionReactionR ≤ 1R = k·dt

Multi-dimensional correction: For d dimensions, diffusion limit is Fo ≤ 1/(2d).

Script Outputs (JSON Fields)

ScriptKey Outputs
scripts/cfl_checker.pymetrics.cfl, metrics.fourier, recommended_dt, stable
scripts/von_neumann_analyzer.pyresults.max_amplification, results.stable
scripts/matrix_condition.pyresults.condition_number, results.is_symmetric
scripts/stiffness_detector.pyresults.stiffness_ratio, results.stiff, results.recommendation

Workflow

  1. Identify dominant physics (advection vs diffusion vs reaction)
  2. Run CFL checker with scripts/cfl_checker.py
  3. Compare to limits and adjust dt if needed
  4. Check stiffness with scripts/stiffness_detector.py if multiple scales
  5. Analyze custom schemes with scripts/von_neumann_analyzer.py
  6. Check conditioning with scripts/matrix_condition.py for implicit solves
  7. Document the stability verdict and recommended time step

Conversational Workflow Example

User: My phase-field simulation is blowing up after 100 steps. I'm using explicit Euler with dx=0.01, dt=1e-4, and diffusivity D=1e-3.

Agent workflow:

  1. Check stability criteria: python3 scripts/cfl_checker.py --dx 0.01 --dt 1e-4 --diffusivity 1e-3 --dimensions 2 --json
  2. Interpret results:

- Fourier number: Fo = 1e-3 × 1e-4 / (0.01)² = 1.0 - 2D limit: Fo ≤ 0.25 - Violation: Fo = 1.0 > 0.25, unstable!

  1. Recommend fix:

- Reduce dt to 2.5e-5 (to get Fo = 0.25) - Or increase dx, or switch to implicit

Pre-Simulation Stability Checklist

  • Identify dominant physics and nondimensional groups
  • Compute CFL/Fourier/Reaction numbers with cfl_checker.py
  • If explicit and limit violated, reduce dt or change scheme
  • If stiffness ratio > 1000, select implicit/stiff integrator
  • For custom schemes, verify amplification factor ≤ 1
  • Document stability reasoning with inputs and outputs

CLI Examples

# Check CFL/Fourier for 2D diffusion-advection
python3 scripts/cfl_checker.py --dx 0.1 --dt 0.01 --velocity 1.0 --diffusivity 0.1 --dimensions 2 --json

# Von Neumann analysis for custom 3-point stencil
python3 scripts/von_neumann_analyzer.py --coeffs 0.2,0.6,0.2 --dx 1.0 --nk 128 --json

# Detect stiffness from eigenvalue estimates
python3 scripts/stiffness_detector.py --eigs=-1,-1000 --json

# Check matrix conditioning for implicit system
python3 scripts/matrix_condition.py --matrix A.npy --norm 2 --json

Error Handling

ErrorCauseResolution
dx and dt must be positiveZero or negative valuesProvide valid positive numbers
No stability criteria appliedMissing velocity/diffusivityProvide at least one physics parameter
Matrix file not foundInvalid pathCheck matrix file exists
Could not compute eigenvaluesSingular or ill-formed matrixCheck matrix validity

Interpretation Guidance

ScenarioMeaningAction
stable: trueAll checked criteria satisfiedProceed with simulation
stable: falseAt least one limit violatedReduce dt or change scheme
stable: nullNo criteria could be appliedProvide more physics inputs
Stiffness ratio > 1000Problem is stiffUse implicit integrator
Condition number > 10⁶Ill-conditionedUse scaling/preconditioning

Security

Input Validation

  • All numeric parameters (dx, dt, velocity, diffusivity, dimensions) are validated as finite positive numbers before any computation
  • --dimensions is restricted to {1, 2, 3}
  • Comma-separated eigenvalue lists (--eigs) are capped at 10,000 entries and validated as finite numbers
  • Stencil coefficient lists (--coeffs) are length-limited and validated as finite floats

File Access

  • matrix_condition.py reads a single matrix file (.npy format) specified by --matrix; no directory traversal beyond the given path
  • Matrix files are rejected if they exceed 500 MB before parsing
  • np.load() is called with allow_pickle=False to prevent arbitrary code execution via crafted .npy files
  • Scripts write only to stdout (JSON output); no files are created unless the agent explicitly uses the Write tool

Tool Restrictions

  • Read: Used to inspect script source, references, and user configuration files
  • Bash: Used to execute the four Python analysis scripts (cfl_checker.py, von_neumann_analyzer.py, matrix_condition.py, stiffness_detector.py) with explicit argument lists
  • Write: Used to save analysis results or generated reports; writes are scoped to the user's working directory
  • Grep/Glob: Used to locate relevant files and search references

Safety Measures

  • No eval(), exec(), or dynamic code generation
  • All subprocess calls use explicit argument lists (no shell=True)
  • Matrix dimension limits (100,000 per dimension) prevent memory exhaustion
  • JSON output mode (--json) produces structured, parseable results without shell-interpretable content

Limitations

  • Explicit schemes only for CFL/Fourier checks (implicit is unconditionally stable)
  • Von Neumann analysis assumes linear, constant-coefficient, periodic BCs
  • Stiffness detection requires eigenvalue estimates from user

References

  • references/stability_criteria.md - Decision thresholds and formulas
  • references/common_pitfalls.md - Frequent failure modes and fixes
  • references/scheme_catalog.md - Stability properties of common schemes

Version History

  • v1.1.0 (2024-12-24): Enhanced documentation, decision guidance, examples
  • v1.0.0: Initial release with 4 stability analysis scripts

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.55%
按下载量换算97

Claude

30.7%
按下载量换算82

Cursor

20.68%
按下载量换算55

Gemini CLI

8.83%
按下载量换算23

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/heshamfs/materials-simulation-skills --skill numerical-stability 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills