Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B source : how to define a current-dependent voltage source #349

Open
pbadel opened this issue Jul 21, 2023 · 1 comment
Open

B source : how to define a current-dependent voltage source #349

pbadel opened this issue Jul 21, 2023 · 1 comment

Comments

@pbadel
Copy link

pbadel commented Jul 21, 2023

I'm trying to define a non linear component using current-dependent voltage source :

circuit = Circuit('Voltage Divider')

circuit.V('alim',circuit.gnd, 'n1', 10@u_V)
circuit.V('Vdummy','n1', 'n2', 0)
circuit.B('RNL','n2', 'n3', v="0.001*i(VVdummy)**2")
circuit.R('R', 'n3', circuit.gnd, 1@u_kΩ)

simulator = circuit.simulator(temperature=25, nominal_temperature=25)

analysis = simulator.operating_point()

i get the following message error :
NameError: name 'i' is not defined. Did you mean: 'id'?

If i define a voltage dependant current source (i.e. using the expression i="(v(n2)-v(n1))**2") that works... what's the trick with current dependent voltage source ?

@cyber-g
Copy link
Contributor

cyber-g commented Aug 5, 2023

Hi, to my knowledge, a current-dependent voltage source is a CCVS : 4.2.4 Hxxxx: Linear Current-Controlled Voltage Sources (CCVS)

Though I have never tested it yet, according to PySpice documentation : CurrentControlledVoltageSource you can instantiate with :

circuit.H('Vout', 'node1', 'node2', source='nodetosensecurrent', transresistance=float(coefficient))

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

No branches or pull requests

2 participants