Skip to content

fda and instrument amplifier example failing #167

@hconboe

Description

@hconboe

Trying to run the fully differential opamp example on the tutorial

from lcapy import Circuit, t, oo

a = Circuit(r"""
Vsp 1 0_1 ; down
W 0_1 0; down=0.1, 0V
W 1 1_1; right
R1 1_1 6; right
Vsm 2 0_3 ; down
W 0_3 0; down=0.05, 0V
R3 2 3; right
E1 5_2 4_2 fdopamp 3 6 0_4 A; right, mirror, l
W 5_2 5; right
W 4_2 4; right
P2 5 4; down
W 5_1 5_2; down
W 6_1 6; down
W 3 3_1; down
R2 6_1 5_1; right
W 4_2 4_1; down
R4 3_1 4_1; right
W 0 0_4; right=0.4
W 0 0_2; down=0.01, 0V
; draw_nodes=connected
""")

a.draw()

b = a.subs({'R4': 'R2', 'R3': 'R1'})

The above works fine, however, when I get to the line

Vod = (b[5].V(t) - b[4].V(t)).simplify()

I get the following error

File "", line 1, in
File "C:\Python312\Lib\site-packages\lcapy\node.py", line 74, in V
return self.cct.get_Vd(self.name, '0')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\lcapy\netlist.py", line 319, in get_Vd
return self._get_Vd(Np, Nm, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\lcapy\netlist.py", line 306, in _get_Vd
subs = self._subs_make(nowarn=nowarn)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\lcapy\netlist.py", line 109, in _subs_make
cct = self.expand()
^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\lcapy\netlist.py", line 652, in expand
new._add(cpt._expand())
^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\lcapy\mnacpts.py", line 1274, in _expand
opampp = self._netmake_expand('Ep',
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\lcapy\mnacpts.py", line 440, in _netmake_expand
return self._netmake1(name, nodes, args, opts, ignore_keyword=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\lcapy\mnacpts.py", line 397, in _netmake1
parts.append(node.name)
^^^^^^^^^
AttributeError: 'str' object has no attribute 'name'

I get similar errors from running the instrument amplifier example

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions