Inductors

5 views
Skip to first unread message

Pat Hanrahan

unread,
Jul 11, 2010, 9:41:09 PM7/11/10
to pycircuit
pycircuit is very nice!

I tried the following simple program using inductors, and it doesn't
seem to work. Any idea what's going on?

from scipy import *
from pycircuit.circuit import *
from pylab import *
from pycircuit.post.functions import *

l = 125e-3
c = 100e-6

cir=SubCircuit()

cir['VS'] = VS(1, gnd, vac=1.0)
cir['C1'] = C(1, gnd, c)
cir['L1'] = L(1, 2, l)
cir['C2'] = C(2, gnd, c)

ac = AC(cir)
# from f=0 to 1000
res = ac.solve(freqs=logspace(0,6))

vnet1 = res.v(2)

print type(vnet1)
print vnet1, vnet1.ylabel
vnet1.semilogx()
grid(True)
show()




Joacim Frisk

unread,
Jul 27, 2010, 4:37:38 AM7/27/10
to pyci...@googlegroups.com
Your example works in an older version. Seems like I've broken
something when I fixed AC based on DC steady-state.

I'll try to fix this, but you could try to check out a version from
before june meanwhile.

Regards,
Joacim

> --
> You received this message because you are subscribed to the Google Groups "pycircuit" group.
> To post to this group, send email to pyci...@googlegroups.com.
> To unsubscribe from this group, send email to pycircuit+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pycircuit?hl=en.
>
>

andreas dreyfert

unread,
Jul 27, 2010, 4:34:38 PM7/27/10
to pyci...@googlegroups.com
Joacim,

That change also broke linear symbolic parts of Pycircuit as no symbolic DC soultion is provided. One
could use the Symbolic DC solver Henrik wrote to implement the DC solution for the symbolic parts.

Best Regards,
Andreas

Pat Hanrahan

unread,
Jul 28, 2010, 3:26:24 PM7/28/10
to pyci...@googlegroups.com
Thanks for your help.

I found the problem with that program. I wan't setting the inductance
properly. I needed to change

> > cir['L1'] = L(1, 2, l)

to L(1,2, L=l)

Pat

Pat Hanrahan

unread,
Jul 30, 2010, 11:43:11 AM7/30/10
to pyci...@googlegroups.com
I ran the following program and it didn't converge. I set the maximum
number of iterations to 1000, and it worked.

Pat

from scipy import *
from pycircuit.circuit import *
from pylab import *
from pycircuit.post.functions import *

rr = 1000.

cir=SubCircuit()

cir['VS'] = VS(1, gnd, v=5.)
cir['R1'] = R(1, 2, r=rr)
cir['D1'] = Diode(2, gnd)

dc = DC(cir)
res = dc.solve()

print res.v(1), res.v(2)


Reply all
Reply to author
Forward
0 new messages