lcapy.circuit
This module provides circuit analysis using modified nodal analysis (MNA).
The circuit is described using netlists, similar to SPICE, but with arbitrary node names (except for the ground node which is labelled 0). The netlists can be loaded from a file or created at run-time. For example:
>>> from lcapy import Circuit
>>> cct = Circuit('''
V_s fred 0
R_a fred 1
R_b 1 0''')
Branch currents and branch voltage differences can be found using the component name as an attribute, for example,
>>> cct.V_s.V.pprint()
>>> cct.R_a.I.pprint()
Nodal voltages (with respect to the ground node) can be found using the node name or number as index, for example,
>>> cct['fred'].V.pprint()
>>> cct[1].V.pprint()
Copyright 2014–2023 Michael Hayes, UCECE
Classes
|
The Circuit class is used for describing networks using netlists. |