Mathematica 9 is now available

Analog Insydes

download notebookDownload this example as a Mathematica notebook.

Analog Insydes is a Mathematica toolbox for symbolic modeling, analysis, and design of analog electronic circuits. With Analog Insydes and Mathematica you can model and analyze circuits, manipulate analysis results mathematically, produce graphical visualizations of circuit characteristics, and document your solutions all in one integrated environment.

A Very Short Introduction

What Is SPICE?

SPICE stands for Simulation Program Integrated Circuits Especially! The program originates from the University of California, Berkeley. SPICE is used to provide a reasonably detailed analysis of circuits containing active components such as bipolar transistors, field effect transistors, diodes, and lumped components such as resistors, capacitors, and inductors. Note that SPICE is a circuit simulation program, not a logic simulation program. Thus, SPICE considers the voltages and currents in a circuit to be continuous quantities not quantized into high/low values. The original SPICE program has given rise to a variety of commercial implementations. Variations of SPICE include PSpice, HSpice, etc.

The one thing to keep in mind is that everybody uses SPICE.

Some Simple Demos


Getting More Examples

Analysis of a voltage divider


A simple voltage divider

VoltageDivider =
        {V0, {1, 0}, 10},
        {R1, {1, 2}, R1},
        {R2, {2, 0}, R2}

CheckedNetlist[{V0, {1, 0}, 10},
{R1, {1, 2}, R1}, {R2, {2, 0}, R2}]

vdeqs = CircuitEquations[VoltageDivider]






Small-signal transistor model (hierarchical netlists)

To analyze the common-emitter transistor amplifier below, one has to find an appropriate analog model for the transistor Q1.


Let's take a look at two standard transistor models to replace the transistor by either one of the following two small-signal equivalent circuits.


In the following netlist, you can see the reference to the models in the top level and the two alternative formulations of the two transistor models. Note that the top-level definition includes only the external connections. This is called a black box: the top level does not have to know anything about the inner workings of the subcircuits, just where they connect to the top level. The Selector option lets the user easily switch between the two formulations.

Now we can expand the subcircuits:
flatAmpSimple =
   [CommonEmitterAmplifier /.{supplyVoltage -> 0,
       inputVoltage -> 1, BJTModel -> ACsimple}]

FlatNetlist[{V1, {1, 0}, 1}, {VCC, {2, 0},
Type -> VoltageSource,
Value -> 0}, {R1, {2, 1}, R1}, {R2, {2, 0}, R2},
{RC, {2, 3}, RC}, {RE, {4, 0}, RE},
{RB$Q1, {X$Q1, 4}, RB},
{CC$Q1, {1, X$Q1, 3, 4},beta;}]

flatAmpDyn =
        CommonEmitterAmplifier /.{supplyVoltage -> 0,
inputVoltage -> 1, BJTModel -> ACdynamic}]

FlatNetlist[{V1, {1, 0}, 1},
{VCC, {2, 0},Type -> VoltageSource,
Value -> 0}, {R1, {2, 1}, R1}, {R2, {2, 0}, R2},
{RC, {2, 3}, RC}, {RE, {4, 0}, RE},
{RB$Q1, {X$Q1, 4}, RB}, {CM$Q1, {1, 3}, CM},
{CC$Q1, {1, X$Q1, 3, 4}, beta;},
{RO$Q1, {3, 4}, RO}]

and analyze the resulting netlists.
eqAmpSimple = CircuitEquations[flatAmpSimple];

MatrixForm /@ eqAmpSimple

We can now solve the circuit equations for the voltage gain at the collector [3], for example.
v3simple =
V$3 /. SolveCircuitEquations[eqAmpSimple, V$3][[1]]


v3dyn =
V$3 /. SolveCircuitEquations[eqAmpDyn, V$3] [[1]]

(RC (RE + CM RB RE s + CM RB RO s + CM RE RO s - RO beta
+ CM RE RO s beta))/ (RB RC + RB RE + RC RE + RB RO +
RE RO beta + CM RC RE RO s beta)

Now let's see what happens when we make the (usually realistic) assumption that the transistor current gain is very large.
Limit[vtfsimple, beta -> infin]


Limit[vtfdyn, beta -> infin]


This result actually agrees with the approximations found in the textbooks.

What Functionality Is Built In?

General functionality

Analog Insydes can set up and analyze analog circuits. It can also model elements like transistors, diodes, and MOSFETs using standard models also used in SPICE and PSpice symbolically and numerically. Analog Insydes allows users to create hierarchical models using object-oriented definitions of circuits and subcircuits. Analog Insydes can automatically simplify and approximate complex models by discharging higher-order terms and taking symbolic limits. Analog Insydes can read, interpret, and analyze SPICE and PSpice models.

Basic circuit elements

TableForm[Partition[ElementTypes, 3]]
Resistor Conductance Admittance
Impedance Capacitor Inductor
Current Source Voltage Source CCCSource
CCVSource VCCSource VCVSource
Nullator Norator Fixator
OpAmp OTAmp ABModel
OpenCircuit ShortCircuit SignalSource
Amplifier Integrator Differentiator