Skip to content

CCCS doesn't always works as expected #140

@lcarpineto

Description

@lcarpineto

Hi, I've been trying to generate equations for circuits were I need to use CCCS.
In the attached test bench I've tried to use as control source either V1 or R1.
The current flowing V1 or R1 is always the same, but I do get different results. The V1 case is the correct one (apart from the fact that the sign is not what I would expect). In the case of R1 the answer is instead wrong.

from lcapy import Circuit
c=Circuit("""
# Created by lcapy-tk V0.94
; nodes={1@(2.5, 8.5), 2@(2.5, 6.5), 3@(5.5, 8.5), 4@(8, 8.5), 5@(11, 8.5), 6@(11, 6.5), 0@(2.5, 5.5), 7@(13, 6.5), 8@(13, 8.5), 9@(15, 8.5), 10@(15, 6.5)}
W1 1 3; right=1.5
R1 3 4; right=1.25
W2 4 5; right=1.5
R2 5 6; down
W3 6 2; left=4.25
W4 2 0; down=0.5, scale=0.5, ground
W5 6 7; right
W6 8 9; right
W7 10 7; left
R3 9 10; down
V1 1 2; down
F1 8 7 V1 F1; down
; draw_nodes=connections, label_nodes=all, style=american, voltage_dir=RP, label_style=name """)
c.draw()
c.R3.I

image

replacing this line
F1 8 7 R1 F1; down

from lcapy import Circuit
c=Circuit("""
# Created by lcapy-tk V0.94
; nodes={1@(2.5, 8.5), 2@(2.5, 6.5), 3@(5.5, 8.5), 4@(8, 8.5), 5@(11, 8.5), 6@(11, 6.5), 0@(2.5, 5.5), 7@(13, 6.5), 8@(13, 8.5), 9@(15, 8.5), 10@(15, 6.5)}
W1 1 3; right=1.5
R1 3 4; right=1.25
W2 4 5; right=1.5
R2 5 6; down
W3 6 2; left=4.25
W4 2 0; down=0.5, scale=0.5, ground
W5 6 7; right
W6 8 9; right
W7 10 7; left
R3 9 10; down
V1 1 2; down
F1 8 7 R1 F1; down
; draw_nodes=connections, label_nodes=all, style=american, voltage_dir=RP, label_style=name """)
c.draw()
c.R3.I

image

A further example where I see issue is when I try to reproduce the "CapMultiplier" scheme. The use of CCCS serve the purpouse of increasing the capacitance. The issue here is that the equations are not generated.
image

cct=Circuit("""
# Created by lcapy-tk V0.94
; nodes={1@(2.5, 7.5), 2@(2.5, 5), 3@(2.5, 2.5), 4@(5, 7.5), 5@(5, 2.5), 0@(5, 1.5), 6@(7, 7.5), 7@(7, 2.5)}
C1 2 3; down=1.25
W1 1 4; right=1.25
W2 3 5; right=1.25
W3 5 0; down=0.5, scale=0.5, ground
F1 4 5 V1 F1; down=2.5
V1 1 2 ac V1 0; down=1.25
W4 4 6; right
I1 6 7 ac; down=2.5
W5 7 5; left
; draw_nodes=connections, label_nodes=all, style=american, voltage_dir=RP, label_style=name """)
cct.draw()

image

cct.ac().matrix_equations()

NonInvertibleMatrixError: Matrix det == 0; not invertible.

Any help is very much appreciated.


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