## [eispice] Re: Some simple examples

• From: Charles Eidsness <charles@xxxxxxxxxxxxxxxxxxxxx>
• To: eispice@xxxxxxxxxxxxx
• Date: Thu, 13 Sep 2007 19:34:40 -0400

```Hi Ted,

Something like this should get you started with the syntax
(see below), but you will have to check it for polarity
Refer to the eispice webpage for less trivial examples.

eispice can be used to simulate these kinds of circuits but
it wasn't really designed for it. For instance the MNA
matrix will have a singularity if you don't combine the
current sources in circuit 2 before running the sim. eispice
is really more for transient simulations of real-world circuits.

Cheers,
Charles

----------------

import eispice

cct1 = eispice.Circuit("Ted's Circuit 1")
cct1.V18 = eispice.V(eispice.GND, 1, 18)
cct1.V7 = eispice.V(2, eispice.GND, 7)
cct1.I5m = eispice.I(1, 2, 0.005)

cct1.op()

print '-- Circuit 1 --'
print 'V18 Current: %gA' % cct1.current('V18')[0][1]
print 'V7 Current: %gA' % cct1.current('V7')[0][1]
print 'I5m Voltage: %gV' % (cct1.voltage(1)[0][1] -
cct1.voltage(2)[0][1])

cct2 = eispice.Circuit("Ted's Circuit 2")
cct2.In5 = eispice.I(eispice.GND, 1, (20-25-5))
cct2.V60 = eispice.V(2, 1, 60)
cct2.V100 = eispice.V(2, eispice.GND, 100)

cct2.op()

print '-- Circuit 2 --'
print 'V60 Current: %gA' % cct2.current('V60')[0][1]
print 'V100 Current: %gA' % cct2.current('V100')[0][1]

----------------

Ted Kosan wrote:
> Hello,
>
> Would anyone be able to provide the eispice source code which would
> solve the following 2 circuit problems?:
>
> http://206.21.94.60/tkosan/misc/eispice_circuits.pdf
>
> I am beginning to learn eispice and it would be helpful to see how it
> is used to solve these simple problems.
>