Skip to content

Commit

Permalink
Show MNA equations for resistive circuits in the time-domain
Browse files Browse the repository at this point in the history
  • Loading branch information
mph- committed Dec 26, 2024
1 parent bf264b8 commit c5b5d3a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lcapy/netlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,12 +772,17 @@ def modified_nodal_analysis(self):
"""Perform modified nodal analysis for this netlist. This is
cached."""

if self.kind in ('time', 'super'):
raise ValueError(
'Cannot put time domain equations into matrix form. '
'Convert to dc, ac, or laplace domain first.')
kind = self.kind
if kind in ('time', 'super'):

return SubNetlist(self, self.kind).mna
if self.reactances != []:
raise ValueError(
'Cannot put time domain equations into matrix form due to'
' reactive components: %s. Convert to dc, ac, or'
' laplace domain first.' % ', '.join(self.reactances))
kind = 'time'

return SubNetlist(self, kind).mna

@lru_cache(1)
def nodal_analysis(self, node_prefix=''):
Expand Down

0 comments on commit c5b5d3a

Please sign in to comment.