Skip to content

Add NetlistCircuit, importing circuit into SparseLinearDAE - #7

Merged
milanofthe merged 7 commits into
pathsim:mainfrom
Pimss:main
Oct 29, 2026
Merged

milanofthe merged 7 commits into
pathsim:mainfrom
Pimss:main

Conversation

@Pimss

@Pimss Pimss commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Title

Adding NetlistCircuit, a class importing netlist into SparseLinearDAE format.
This ease the process of simulating electrical system, but also any kind of physics with equivalent circuit.
This PR needs pathsim version above commit pathsim/pathsim@e34add6 to work

Modifications

        modified:   pyproject.toml                (added Elecsolver, for netlist numpy sparse formulation)
        modified:   src/pathsim_rf/__init__.py    (import of NetlistCircuit and added comments)
        modified:   README.md                     (added NetlistCircuit to table)
        
        added:      docs/source/examples/example_netlist_circuit.ipynb     (example for a LC filter import)
        added:      docs/source/examples/transformer_thermal_pathsim.ipynb (transformer with k coupling and thermal model)
        added:      src/pathsim_rf/circuit.py                              (NetlistCircuit class addition)
        added:      tests/test_circuit.py                                  (tests for NetlistCircuit class)

Tests

  • python -m unittest discover
Ran 84 tests in 5.044s

OK (skipped=1)
  • Added tests for new classes

Pimss added 7 commits October 27, 2026 17:32
NetlistCircuit leverage ElecSolver netlist parser and system building to formalise S2, S1 and B matrices compatible with SparseLinearDAE. Meanwhile, C and D are generated using imput parameters matching netlist style notation
This notebook demonstrates a pulse-driven LC low-pass filter simulation using the NetlistCircuit block, including setup instructions and simulation results.
`NetlistCircuit` can be used in any physics given a circuit equivalence can be used. This example feature coupled inductors and a second order thermal model.
Removed the ambient temperature definition from the thermal path simulation example.
@Pimss

Pimss commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

The rest is up to the users, I am currently running simulations for a PMSM with speed control, anti-windup, field weakening, clarke and park transform and cable and filter simulation in pathsim under 5 minutes. I am very happy

@milanofthe
milanofthe merged commit 421a848 into pathsim:main Oct 29, 2026
1 check passed
Comment thread pyproject.toml
"numpy>=1.15",
"scipy>=1.2",
"scikit-rf>=0.30",
"ElecSolver>=2.2.1",

@williampiat3 williampiat3 Oct 29, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@milanofthe ElecSolver>=2.2.1 is a python lightweight sparse linear system builder for electric systems (or anything that can be expressed in a similar circuit form), it only needs numpy and scipy (I removed networkx in the 2.2.0 release to make it minimal).
In case you were worried about adding deps to pathSim, this one does not add extra packages (except itself)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants