SimPEG

Run SimPEG geophysical forward simulations and gradient-based inversions with validated tools and diagnostics.

155|6|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation --skill simpeg-lzwei196
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: SimPEG
Source: https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation/tree/main/models/SimPEG
Command: npx skills add https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation --skill simpeg-lzwei196

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires simpeg, discretize, pymatsolver, geoana, numpy, scipy, matplotlib, and includes scripts (resource) and references (resource) components.

What problem does it solve? Running geophysical simulations and inversions with SimPEG requires operational expertise scattered across source code, docs, and examples: correct SI unit conventions, mesh design, map selection, regularization tuning, and recovery from silent failures. This Skill packages that expertise so an AI agent can reliably build meshes, configure models, execute forward simulations and inversions, parse results, and diagnose failures without substituting approximations for the real model. ## Core Features & Use Cases - Staged pipeline tools: Four executable scripts cover mesh and survey setup (build_mesh.py), model initialization with unit-aware maps (initialize_model.py), forward/inversion execution (run_simpeg.py), and output parsing with convergence metrics and plots (parse_results.py). - Diagnostic recovery: 18 symptom-to-diagnosis-to-remedy triplets in diagnostics/triplets.yaml cover known failure modes such as CGS-vs-SI density errors, resistivity/conductivity confusion, singular air-cell conductivity, and beta mis-scheduling. - Machine-readable contracts: dag.yaml, format_spec.yaml, and validation_convention.yaml define inputs, outputs, units, observability, and validation metrics so runs are graded against cited conventions rather than intuition. - Use Case: A user provides gravity survey locations and observed data in CSV; the agent builds a padded TensorMesh, initializes a density model in kg/m^3, runs a beta-cooled Gauss-Newton inversion, and exports the recovered model CSV with convergence diagnostics. ## Quick Start Ask the agent to run preflight_check.py first, then build a mesh and run a gravity inversion from your survey CSV using the SimPEG pipeline tools.

Frequently Asked Questions about SimPEG

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

FAQPage Schema
How do I run a gravity inversion with SimPEG?▼

Build a mesh and survey with build_mesh.py, initialize a density model with initialize_model.py, then run run_simpeg.py in inversion mode with your observed data CSV, relative error, and noise floor. Finish by exporting the recovered model and convergence plots with parse_results.py.

What geophysical methods does SimPEG support?▼

SimPEG supports gravity, magnetics, DC resistivity, induced polarization, self-potential, frequency-domain and time-domain EM, natural-source MT, viscous remanent magnetization, seismic straight-ray tomography, and Richards-equation flow. Dimensionality ranges from 1D to 3D depending on the method.

Why is my SimPEG gravity anomaly off by a factor of 1000?▼

The density model was likely supplied in g/cm^3 instead of the required SI unit kg/m^3. Multiply g/cm^3 values by 1000 before building the model vector; this silent unit trap is documented as diagnostic triplet dt_001.

Does SimPEG support Bayesian or MCMC inversion?▼

No. SimPEG is a deterministic, gradient-based framework using Tikhonov or sparse-norm regularization with Gauss-Newton optimization. Stochastic or Bayesian inversion is explicitly outside its scope.

Why does my SimPEG inversion produce a singular matrix error?▼

Air or inactive cells were likely assigned exactly zero conductivity in InjectActiveCells, making the stiffness matrix singular. Use a small nonzero value such as 1e-8 S/m, or ln(1e-8) under a log map.

How do I avoid out-of-memory errors in large 3D SimPEG inversions?▼

Use a TreeMesh for adaptive refinement, set store_sensitivities to forward_only to avoid storing the dense Jacobian, or enable Dask-based distributed computation. Dense sensitivity storage scales as nD times nM and can exceed RAM quickly.