-
Notifications
You must be signed in to change notification settings - Fork 20
User's guide
The SpicePy wiki provides the minimum information to use the code.
SpicePy makes use of a netlist to describe the circuit. The notation used is very similar to the SPICE one. A netlist is a text file (common extensions are .net or .cir).
In a netlist every component is defined as:
<label><X> <node+> <node-> <value> <other optional information>
where:
-
<label><X>
is thelabel
of the component andX
is an identification number -
<node+>
is one node to which the component is connected. The sign+
indicates that it is conventionally the positive node -
<node->
is one node to which the component is connected. The sign-
indicates that it is conventionally the negative node -
<value>
is the value of the component -
<other optional information>
can be, for example, initial conditions for dynamic components of the phase of a generator to be used in AC problems
To give an example, a 5.6 ohm resistor caller R3
connected between nodes 1 and 5 is described in the netlist by:
R3 1 5 5.6
The analysis is defined using standard SPICE simulation commands. The simulation command have to be included at the end (last line) of the netlist. Right now SpicePy supports only two kind of simulation:
- Operating point analysis: used to solve direct current (DC) networks and also to compute the initial conditions of circuits including dynamic componets
- AC analysis: used to solve AC network in frequency domanin
To perform an operating point analysis it is sufficient to add at the end of the netlist the following simulation command:
.op
The AC analysis is defined by the following simulation command:
.ac type n f1 f2
where:
-
.ac
indicated the AC analysis -
type
indicates how to create the frequency range. It can be:-
lin
for a linear sweep withn
points between frequenciesf1
andf2 (> f1)
-
dec
for a logarithmic sweep (by decades) withn
points between frequenciesf1
andf2 (> f1)
-
oct
for a logarithmic sweep (by octaves) withn
points between frequenciesf1
andf2 (> f1)
-
Right now SpicePy only supports a single frequency simulation using the following notation:
.ac lin 1 f f