convergence-study
정보
이 스킬은 수치 시뮬레이션을 위한 자동화된 수렴 분석을 수행하며, Richardson 외삽법과 GCI(Grid Convergence Index) 계산을 통해 관찰된 정확도 차수를 산출하고 이산화 오차를 추정합니다. 이를 통해 개발자는 메시 적절성을 검증하고 점근적 수렴을 확인하며, ASME V&V 20 표준에 따른 공식 검증 보고서를 작성할 수 있습니다. 해의 정확도를 평가하거나 격자 해상도가 충분한지 판단해야 할 때 사용하십시오.
빠른 설치
Claude Code
추천npx skills add HeshamFS/materials-simulation-skills -a claude-code/plugin add https://github.com/HeshamFS/materials-simulation-skillsgit clone https://github.com/HeshamFS/materials-simulation-skills.git ~/.claude/skills/convergence-studyClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Convergence Study
Goal
Provide script-driven convergence analysis for verifying that numerical solutions converge at the expected rate as the mesh or timestep is refined.
Requirements
- Python 3.8+
- NumPy (not required; scripts use only math stdlib)
Inputs to Gather
| Input | Description | Example |
|---|---|---|
| Grid spacings | Sequence of mesh sizes (coarse to fine) | 0.4,0.2,0.1,0.05 |
| Timestep sizes | Sequence of dt values | 0.04,0.02,0.01 |
| Solution values | QoI at each refinement level | 1.16,1.04,1.01,1.0025 |
| Expected order | Formal order of the numerical scheme | 2.0 |
| Safety factor | GCI safety factor (1.25 default) | 1.25 |
Script Outputs (JSON Fields)
| Script | Key Outputs |
|---|---|
scripts/h_refinement.py | results.observed_orders, results.mean_order, results.richardson_extrapolated_value, results.convergence_assessment |
scripts/dt_refinement.py | Same as h_refinement but for temporal convergence |
scripts/richardson_extrapolation.py | results.extrapolated_value, results.error_estimate, results.observed_order |
scripts/gci_calculator.py | results.observed_order, results.gci_fine, results.gci_coarse, results.asymptotic_ratio, results.in_asymptotic_range |
Workflow
- Run grid/timestep refinement study with at least 3 levels
- Compute observed convergence order with
h_refinement.pyordt_refinement.py - Compare observed order to expected order of the scheme
- Estimate discretization error via Richardson extrapolation
- Report GCI for formal solution verification using
gci_calculator.py - Document convergence results and any anomalies
Decision Guidance
Do you have 3+ refinement levels?
+-- YES --> Run h_refinement.py or dt_refinement.py
| +-- Observed order matches expected? --> Solution verified
| +-- Order too low? --> Check: pre-asymptotic, coding error, insufficient resolution
| +-- Order too high? --> Check: superconvergence or cancellation effects
+-- NO (only 2 levels) --> Use richardson_extrapolation.py with assumed order
(less reliable without order verification)
CLI Examples
# Spatial convergence with 4 grid levels
python3 scripts/h_refinement.py --spacings 0.4,0.2,0.1,0.05 --values 1.16,1.04,1.01,1.0025 --expected-order 2.0 --json
# Temporal convergence with 3 timestep levels
python3 scripts/dt_refinement.py --timesteps 0.04,0.02,0.01 --values 2.12,2.03,2.0075 --expected-order 2.0 --json
# Richardson extrapolation with assumed 2nd-order
python3 scripts/richardson_extrapolation.py --spacings 0.02,0.01 --values 1.0032,1.0008 --order 2.0 --json
# GCI for 3-mesh verification
python3 scripts/gci_calculator.py --spacings 0.04,0.02,0.01 --values 1.0128,1.0032,1.0008 --json
Error Handling
| Error | Cause | Resolution |
|---|---|---|
spacings and values must have the same length | Mismatched input arrays | Provide equal-length lists |
At least 2 refinement levels required | Too few data points | Add more refinement levels |
Exactly 3 refinement levels required | GCI needs 3 levels | Provide fine/medium/coarse |
Oscillatory convergence detected | Non-monotone convergence | Check mesh quality or scheme |
Interpretation Guidance
| Scenario | Meaning | Action |
|---|---|---|
| Observed order matches expected | Solution in asymptotic range | Report GCI, extrapolate |
| Observed order < expected | Pre-asymptotic or coding bug | Refine further or debug |
| Negative observed order | Solution diverging | Check implementation |
| GCI asymptotic ratio near 1.0 | Grids in asymptotic range | Results are reliable |
| GCI asymptotic ratio far from 1.0 | Not in asymptotic range | Refine further |
Security
Input Validation
- All numeric parameters (
spacings,timesteps,values,expected-order,order) are validated as finite positive numbers - Comma-separated value lists are length-matched (spacings and values must have equal length) and capped at 10,000 entries
- GCI calculator enforces exactly 3 refinement levels; Richardson extrapolation requires at least 2
- Safety factor is validated as a finite number greater than 1.0
File Access
- Scripts read no external files; all inputs are provided via CLI arguments
- Scripts write only to stdout (JSON output); no files are created unless the agent explicitly uses the Write tool
Tool Restrictions
- Bash: Used to execute the four Python analysis scripts (
h_refinement.py,dt_refinement.py,richardson_extrapolation.py,gci_calculator.py) with explicit argument lists - Read: Used to inspect script source and reference documentation
Safety Measures
- No
eval(),exec(), or dynamic code generation - All subprocess calls use explicit argument lists (no
shell=True) - Scripts use only Python standard library (
mathmodule); no pickle loading or deserialization of untrusted data - Minimal tool surface (Bash and Read only) limits the agent's ability to modify the filesystem
References
references/convergence_theory.md- Formal convergence order, log-log analysis, asymptotic rangereferences/gci_guidelines.md- Roache's GCI method, ASME V&V 20, safety factors
GitHub 저장소
연관 스킬
railway-docs
문서이 스킬은 Railway의 기능, 작동 방식 또는 특정 문서 URL에 대한 질문에 답하기 위해 최신 Railway 문서를 가져옵니다. 개발자들이 Railway의 공식 소스로부터 정확하고 최신 정보를 직접 받을 수 있도록 보장합니다. 사용자가 Railway의 작동 방식을 묻거나 Railway 문서를 참조할 때 사용하세요.
n8n-code-python
문서이 Claude Skill은 n8n의 Code 노드에서 Python 코드를 작성할 때 전문적인 지침을 제공하며, 특히 Python 표준 라이브러리 사용과 n8n의 특수 구문인 `_input`, `_json`, `_node` 작업에 중점을 둡니다. 이는 개발자가 n8n 내에서 Python의 제한 사항을 이해하도록 돕고, 대부분의 워크플로에는 JavaScript 사용을 권장하면서도 특정 데이터 변환 요구사항에 대한 Python 솔루션을 제안합니다.
archon
문서Archon 스킬은 REST API를 통해 RAG 기반 시맨틱 검색과 프로젝트 관리를 제공합니다. 이 스킬을 사용하여 문서 검색, 계층적 프로젝트/태스크 관리, 문서 업로드 기능을 갖춘 지식 검색을 수행할 수 있습니다. 외부 문서를 검색할 때는 다른 소스를 사용하기 전에 항상 Archon을 최우선으로 활용하세요.
n8n-code-javascript
문서이 Claude Skill은 n8n의 Code 노드에서 JavaScript 코드 작성에 대한 전문적인 지침을 제공합니다. `$input`/`$json` 변수, HTTP 헬퍼, DateTime 처리와 같은 필수적인 n8n 특정 구문을 다루며 일반적인 오류를 해결합니다. Code 노드에서 사용자 정의 JavaScript 처리가 필요한 n8n 워크플로우를 개발할 때 활용하세요.
