スキル一覧に戻る

convergence-study

HeshamFS
更新日 2 days ago
4 閲覧
40
3
40
GitHubで表示
ドキュメントgeneral

について

このスキルは、数値シミュレーションの自動収束解析を実行し、リチャードソン補外とグリッド収束指数(GCI)計算を用いて観測精度次数を算出し、離散化誤差を推定します。開発者がメッシュの適切性を検証し、漸近的収束を確認し、ASME V&V 20規格に準拠した正式な検証報告書を作成するのに役立ちます。解の精度を評価したり、グリッド解像度が十分かどうかを判断する必要がある際にご利用ください。

クイックインストール

Claude Code

推奨
メイン
npx skills add HeshamFS/materials-simulation-skills -a claude-code
プラグインコマンド代替
/plugin add https://github.com/HeshamFS/materials-simulation-skills
Git クローン代替
git clone https://github.com/HeshamFS/materials-simulation-skills.git ~/.claude/skills/convergence-study

このコマンドをClaude 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

InputDescriptionExample
Grid spacingsSequence of mesh sizes (coarse to fine)0.4,0.2,0.1,0.05
Timestep sizesSequence of dt values0.04,0.02,0.01
Solution valuesQoI at each refinement level1.16,1.04,1.01,1.0025
Expected orderFormal order of the numerical scheme2.0
Safety factorGCI safety factor (1.25 default)1.25

Script Outputs (JSON Fields)

ScriptKey Outputs
scripts/h_refinement.pyresults.observed_orders, results.mean_order, results.richardson_extrapolated_value, results.convergence_assessment
scripts/dt_refinement.pySame as h_refinement but for temporal convergence
scripts/richardson_extrapolation.pyresults.extrapolated_value, results.error_estimate, results.observed_order
scripts/gci_calculator.pyresults.observed_order, results.gci_fine, results.gci_coarse, results.asymptotic_ratio, results.in_asymptotic_range

Workflow

  1. Run grid/timestep refinement study with at least 3 levels
  2. Compute observed convergence order with h_refinement.py or dt_refinement.py
  3. Compare observed order to expected order of the scheme
  4. Estimate discretization error via Richardson extrapolation
  5. Report GCI for formal solution verification using gci_calculator.py
  6. 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

ErrorCauseResolution
spacings and values must have the same lengthMismatched input arraysProvide equal-length lists
At least 2 refinement levels requiredToo few data pointsAdd more refinement levels
Exactly 3 refinement levels requiredGCI needs 3 levelsProvide fine/medium/coarse
Oscillatory convergence detectedNon-monotone convergenceCheck mesh quality or scheme

Interpretation Guidance

ScenarioMeaningAction
Observed order matches expectedSolution in asymptotic rangeReport GCI, extrapolate
Observed order < expectedPre-asymptotic or coding bugRefine further or debug
Negative observed orderSolution divergingCheck implementation
GCI asymptotic ratio near 1.0Grids in asymptotic rangeResults are reliable
GCI asymptotic ratio far from 1.0Not in asymptotic rangeRefine 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 (math module); 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 range
  • references/gci_guidelines.md - Roache's GCI method, ASME V&V 20, safety factors

GitHub リポジトリ

HeshamFS/materials-simulation-skills
パス: skills/core-numerical/convergence-study
0
agent-skillsagentscli-toolscomputational-sciencellmmaterials-science

関連スキル

railway-docs

ドキュメント

このスキルは、Railwayの機能や仕様、特定のドキュメントURLに関する質問に答えるために、最新のRailwayドキュメントを取得します。開発者がRailwayの公式情報源から正確かつ最新の情報を直接受け取れるようにします。ユーザーがRailwayの動作方法について尋ねたり、Railwayドキュメントを参照する際にご利用ください。

スキルを見る

n8n-code-python

ドキュメント

このClaudeスキルは、n8nのコードノードでPythonコードを記述するための専門的なガイダンスを提供します。具体的には、Pythonの標準ライブラリの使用方法や、`_input`、`_json`、`_node`といったn8n独自の構文の扱い方を解説します。n8n環境内におけるPythonの制限事項を開発者が理解できるよう支援し、ほとんどのワークフローではJavaScriptの使用を推奨しながらも、特定のデータ変換ニーズに対応するPythonソリューションを提案します。

スキルを見る

archon

ドキュメント

Archonスキルは、RAGを活用したセマンティック検索とプロジェクト管理をREST APIを通じて提供します。ドキュメントの検索、階層的なプロジェクト/タスクの管理、ドキュメントアップロード機能を備えたナレッジ検索の実行にご利用いただけます。外部ドキュメントを検索する際は、他の情報源を利用する前に常にArchonを最優先で使用してください。

スキルを見る

n8n-code-javascript

ドキュメント

このClaudeスキルは、n8nのCodeノードでJavaScriptコードを書くための専門的なガイダンスを提供します。`$input`/`$json`変数、HTTPヘルパー、DateTime処理などの重要なn8n固有の構文を網羅し、一般的なエラーのトラブルシューティングも行います。CodeノードでカスタムJavaScript処理を必要とするn8nワークフローを開発する際にご利用ください。

スキルを見る