Skip to content

User's guide

Luca Giaccone edited this page Aug 19, 2017 · 15 revisions

Introduction

The SpicePy wiki provides the minimum information to use the code.

Netlist

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).

Components

In a netlist every component is defined as:

<label><X>  <node+>  <node->  <value>  <other optional information>

where:

  • <label><X> is the label of the component and X 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

Analysis

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

Operating point analysis

To perform an operating point analysis it is sufficient to add at the end of the netlist the following simulation command:

.op

AC analysis

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 with n points between frequencies f1 and f2 (> f1)
    • dec for a logarithmic sweep (by decades) with n points between frequencies f1 and f2 (> f1)
    • oct for a logarithmic sweep (by octaves) with n points between frequencies f1 and f2 (> f1)

Right now SpicePy only supports a single frequency simulation using the following notation:

.ac  lin  1  f  f