Pure NumPy/SciPy 2D Electrostatic FEM Solver (Dependency-Free & Platform-Independent) #1
Pinned
ratwolfzero
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone! 👋
I wanted to share capacitor-fem, a self-contained 2D finite-element electrostatics solver designed for real-world capacitor geometries (parallel plates, coaxial cables, and arbitrary shapes built from simple primitives).
🛠️ Why another solver?
Most FEM tools require native dependencies like
gmshor compiled C++ extensions. This project is built entirely on pure NumPy, SciPy, and Matplotlib. It's just a single file (capacitor_fem_universal.py) that runs anywhere—from high-performance desktops to Jupyter notebooks and even Pydroid 3 on Android!🔬 Key Features & Numerical Architecture
csr_matrixfor a fast sparse LU solve.snap_to_gridvalidation mechanism to prevent geometric rounding errors from changing simulated gaps.📊 Validation & Limitations
The core engine is verified against exact analytical 1D solutions to within machine precision ($~10^{-15}$ relative error). It handles realistic challenges like material-interface straddling and domain truncation effects, all of which are deeply documented in the repository.
Check out the repo here: Capacitor_FEM
I would love to hear your feedback, especially on potential future work like cut-cell boundary treatments or nonlinear dielectrics!
All reactions