dipl.-ing. thomas halfmann dr.-ing. eckhard hennig dr.-ing ... · pdf fileanalog electronic...

504

Upload: vunga

Post on 06-Mar-2018

218 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog
Page 2: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

Authors:

Dipl.-Ing. Thomas HalfmannDr.-Ing. Eckhard HennigDr.-Ing. Manfred TholeDipl.-Math. Tim Wichmann

Copyright 2000–2001 by Fraunhofer-Institut fur Techno- und Wirtschaftsmathematik (ITWM)Gottlieb-Daimler-Strasse, D-67663 Kaiserslautern, GermanyFax: +49-631-205-4139Email: [email protected]: http://www.analog-insydes.de

This document is furnished by Fraunhofer-ITWM to licensed users of Analog Insydes for information purposes only. All information in thisdocument is subject to change without notice. This document is provided as is without any express or implied warranties.

No part of this document may be reproduced or redistributed, on any media or by any means, without prior written permission ofFraunhofer-ITWM.

This document was typeset using the WRILaTeX Document System provided under license by Wolfram Research, Inc.

The sparse matrix routines used in the Analog Insydes MathLink applications are copyright 1985, 86, 87, 88 by Kenneth S. Kundert andthe University of California.

Analog Insydes and the Analog Insydes logo are trademarks of Fraunhofer-ITWM.Mathematica and MathLink are registered trademarks of Wolfram Research, Inc.All other product names are trademarks of their respective owners.

Printed by Rohr Druck GmbH Kaiserslautern.Printed in Germany.

Page 3: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

Table of Contents

Part 1. A Short Introduction1.1 Welcome to Analog Insydes.........................................................................................................................6

How to Read this Book Feature List

1.2 Getting Started............................................................................................................................................8Command Overview The First Step An Example Application The Online Help System The Analog Insydes

Palette

1.3 What’s New?.............................................................................................................................................25New Features: An Overview New Features: A More Detailed Description Compatibility

Part 2. Tutorial2.1 Preface......................................................................................................................................................32

How to Read this Tutorial Loading Analog Insydes

2.2 Netlists.......................................................................................................................................................33The Netlist Format Circuit Elements A Brief Preview on Circuit Analysis More about Netlists

2.3 Circuits and Subcircuits..............................................................................................................................46Circuits, Netlists, and Subcircuits Defining Subcircuits and Device Models Referencing Subcircuits Subcircuit

Expansion Subcircuit Parameters The Scope Argument The Translation Argument

2.4 Setting up and Solving Circuit Equations....................................................................................................70Naming Conventions Circuit Equations Circuit Equation Formulations Additional Options for

CircuitEquations

2.5 Graphics....................................................................................................................................................81Bode Plots Nyquist Plots Nichol Plots Root Locus Plots Transient Waveforms

2.6 Modeling and Analysis of Nonlinear Circuits.............................................................................................90Behavioral Models Defining Behavioral Models Referencing Behavioral Models Nonlinear Circuit EquationsMulti-Dimensional Models Nonlinear DC Circuit Analysis References

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits...............................................................................104Transient Circuit Analysis Analysis of a Differential Amplifier Flow of Transient Circuit Analysis NDAESolve

Options Transient Analysis with Initial Conditions TransientPlot Options

2.8 Linear Symbolic Approximation................................................................................................................127Introduction to Symbolic Approximation Solution-Based Symbolic Approximation Equation-Based Symbolic

Approximation Combining SBG and SAG Options for ApproximateMatrixEquation

2.9 Frequency-Domain Analysis of Linear Circuits..........................................................................................142Transistor Models Transfer Functions Device Mismatch Input and Output Impedances Two-Port ParametersAdvanced Transistor Modeling AC Analysis of the CMOS Amplifier

2.10 Nonlinear Symbolic Approximation..........................................................................................................164Introduction to Nonlinear Approximation Analyzing a Square Root Function Block

Page 4: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2

Part 3. Reference Manual3.1 Netlist Format..........................................................................................................................................178

Netlist Circuit Netlist Entries Netlist Entry Options ElementTypes Value Specifications for IndependentSources Time and Frequency Model References Model and Subcircuit ModelParameters GlobalParameters

3.2 Subcircuit and Device Model Definition....................................................................................................190Model Subcircuit

3.3 Model Library Management.....................................................................................................................211ListLibrary FindModel FindModelParameters GlobalSubcircuits GlobalModelParameters LoadModelLoadModelParameters RemoveSubcircuit RemoveModelParameters

3.4 Expanding Subcircuits and Device Models................................................................................................221ExpandSubcircuits

3.5 Setting Up and Solving Circuit Equations.................................................................................................227CircuitEquations ACEquations DCEquations Solve

3.6 Circuit and DAEObject Manipulation........................................................................................................255AddElements DeleteElements GetElements RenameNodes GetEquations GetMatrix GetVariables GetRHSGetParameters GetDAEOptions SetDAEOptions GetDesignPoint ApplyDesignPoint UpdateDesignPointMatchSymbols ShortenSymbols Statistics

3.7 Numerical Analyses.................................................................................................................................280Analog Insydes Numerical Data Format Parameter Sweeps ACAnalysis NoiseAnalysis NDAESolve

3.8 Pole/Zero Analysis..................................................................................................................................304GeneralizedEigensystem GeneralizedEigenvalues PolesAndZerosByQZ PolesByQZ ZerosByQZRootLocusByQZ LREigenpair ApproximateDeterminant

3.9 Graphics Functions...................................................................................................................................330BodePlot FourierPlot NicholPlot NyquistPlot RootLocusPlot TransientPlot

3.10 Interfaces.................................................................................................................................................365ReadNetlist Simulator-Specific Remarks on ReadNetlist ReadSimulationData WriteSimulationDataWriteModel

3.11 Linear Simplification Techniques...............................................................................................................385ComplexityEstimate ApproximateTransferFunction ApproximateMatrixEquation CompressMatrixEquation

3.12 Nonlinear Simplification Techniques..........................................................................................................401NonlinearSetup CompressNonlinearEquations CancelTerms SimplifySamplePoints NonlinearSettingsShowLevel ShowCancellations

3.13 Miscellaneous Functions...........................................................................................................................418ConvertDataTo2D DXFGraphics MathLink Module MSBG MathLink Module QZ

3.14 Global Options........................................................................................................................................425Options[AnalogInsydes] InstanceNameSeparator LibraryPath ModelLibrary Protocol SimulatorUseExternals Option Inheritance

3.15 The Analog Insydes Environment..............................................................................................................432The Initialization Procedure ReleaseInfo ReleaseNumber License Version Info

Page 5: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

Table of Contents 3

Part 4. Appendix4.1 Stimuli Sources........................................................................................................................................438

AMWave ExpWave PulseWave PWLWave SFFMWave SinWave

4.2 Netlist Elements........................................................................................................................................446Resistor Conductance Admittance Impedance Capacitor Inductor OpenCircuit ShortCircuitCurrentSource VoltageSource CCCSource CCVSource VCCSource VCVSource OPAmp OTAmpNullator Norator Fixator SignalSource Amplifier Integrator Differentiator TransmissionLineTransferFunction

4.3 Model Library..........................................................................................................................................460Diode Bipolar Junction Transistor MOS Field-Effect Transistor Junction Field-Effect Transistor

Credits..............................................................................................................................................................492

Index................................................................................................................................................................493

Page 6: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog
Page 7: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

A Short Introduction

1.1 Welcome to Analog Insydes . . . . . . . . . . . . . . . . . 6

1.2 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . 8

1.3 What’s New? . . . . . . . . . . . . . . . . . . . . . . . . . 25

Page 8: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

6 1. A Short Introduction

1.1 Welcome to Analog Insydes

Welcome to Analog Insydes, a Mathematica toolbox for symbolic modeling, analysis, and design ofanalog electronic circuits. With Analog Insydes you can model and analyze linear and nonlinearcircuits, manipulate analysis results mathematically, produce graphical visualizations of circuit char-acteristics, exchange data with commercial circuit simulators, and document your solutions all in oneintegrated environment.

You will always get the latest information concerning Analog Insydes at our home page

http://www.analog−insydes.de

There you will also find a collection of demo notebooks, which show the application of AnalogInsydes on different tasks from the field of electrical engineering.

If you have questions concerning Analog Insydes, please send an email to:

[email protected]

If you want to register to the Analog Insydes newsletter, please write an email to the above men-tioned email address with subject line "Newsletter" and body text "subscribe". You can find thelist of previous newsletters at:

http://www.analog−insydes.de/newsletter.html

1.1.1 How to Read this Book

This book is divided into four parts: an introduction (Part 1), a tutorial (Part 2), a reference manual(Part 3), and an appendix (Part 4).

The introduction part gives an overview of Analog Insydes’ functionality, highlights the new featuresof version 2, and shows the application of Analog Insydes on an practical example. We recommendto read this part, especially Section 1.2.1 and Section 1.2.3, before working with Analog Insydes.

The tutorial part explains dedicated topics of Analog Insydes in detail. Although entitled Tutorial, itis not meant to be read completely before working with Analog Insydes. Rather, each chapter canbe read separately as soon as you need a closer look at special topics.

The reference part explains each Analog Insydes command, shows its argument list, describes theavailable options, and shows the application on small examples. If you need information on a certaincommand, the reference manual is the preferred source.

The appendix part explains all stimuli sources defined in Analog Insydes, shows all available netlistelements, and finally describes the content of the predefined symbolic device model library.

1.1.2 Feature List

The list below shows a summary of Analog Insydes’ main program features.

Page 9: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

1.1 Welcome to Analog Insydes 7

Netlist-based input of electronic circuits and control systems

Available linear circuit elements: resistor, impedance, conductance, admittance, capacitor, induc-tor, independent current and voltage source, all four types of controlled sources (VCVS, CCVS,VCCS, CCCS), operational amplifier (OP), operational transconductance amplifier (OTA), nullator,norator, fixator

Available control network elements: proportional amplifier, differentiator, integrator, ideal trans-mission line, generic transfer function, signal source

Hierarchical netlist entry and device modeling by means of subcircuits and behavioral modeldefinitions

User-extendible device model library which includes bipolar (full Gummel-Poon small-signal andlarge-signal) and MOS (full Level 1-3 and BSIM3v3 small-signal, Level 1 large-signal) transistormodels

Automatic setup of symbolic or mixed symbolic/numeric circuit equations by modified nodal(MNA), sparse tableau (STA), and extended sparse tableau analysis (ESTA) from netlists for linearand nonlinear circuits

Automatic equation setup for AC, DC, transient, and noise analysis

Symbolic calculation of transfer functions, input impedances, two-port parameters, etc.

Design formula extraction by approximation of linear symbolic circuit equations and transferfunctions

Simplification techniques for the approximation of nonlinear circuit descriptions

Support for automated generation of behavioral models for nonlinear circuits

Numerical AC, noise, and pole/zero analysis

Numerical DC, DC-transfer, and transient analysis of nonlinear circuits

Solution of circuit equations not only for currents and voltages but also for design parameters

Graphics functions for Bode, Nyquist, Nichol, Fourier, and root locus plots, transient waveforms,DC-transfer, and parametric analyses

Netlist import for PSpice, Eldo, and Saber netlist files, including small-signal, operating-point, andmodel-card parameters

Import filter for PSpice, Eldo, and Saber simulation data

Export filter of Analog Insydes simulation data for PSpice and Saber

Export filter for Saber MAST model templates

Import filter for circuit schematics and other line graphics from DXF files

Page 10: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

8 1. A Short Introduction

1.2 Getting Started

If this is your first contact with Analog Insydes, this chapter will help you to get familiar withthe system. To get an overview of the functionality of Analog Insydes, the first section providesa list of the most important commands (Section 1.2.1). Next, it is described how to load AnalogInsydes into the Mathematica kernel (Section 1.2.2), and an example application shows one possibleway to use Analog Insydes for solving a specific analysis task (Section 1.2.3). If you have never seenAnalog Insydes before, reading this example will give you a first impression of the system. Finally,Section 1.2.4 explains how to access the Analog Insydes online help system.

1.2.1 Command Overview

The most important Analog Insydes commands are listed in this section. For each command, refer-ences are given where to find more information. A link to the reference manual (Part 3 of this book)is given first, followed by links to related topics described in the tutorial (Part 2 of this book).

Interfaces

Analog Insydes provides import and export filters to PSpice, Eldo, and Saber (Chapter 3.10):

ReadNetlist (Section 3.10.1, Section 2.9.2) translates external netlist files (including model cards,small-signal data, and operating-point information) into the Analog Insydes netlist language.

ReadSimulationData (Section 3.10.3, Section 2.10.2) allows for importing and transforming nu-merical simulation data into Mathematica InterpolatingFunction objects.

WriteSimulationData (Section 3.10.4) exports numerical data calculated with Analog Insydes forfurther postprocessing in external waveform viewers.

WriteModel (Section 3.10.5) generates behavioral model descriptions of symbolic (approximated)equation systems.

Netlists, Circuits, and Models

In Analog Insydes, analog circuits are expressed in terms of Netlist, Circuit, and Model objects:

Netlist (Section 3.1.1, Chapter 2.2) is the basic data structure which contains the elements of aflat netlist.

Circuit (Section 3.1.2, Chapter 2.3, Section 2.3.1) is a data structure which combines netlists,models, model parameters, and global parameters.

Model (Section 3.2.1, Section 2.3.2, Section 2.6.2) is a data structure which defines netlist-based orequations-based models or subcircuits.

AddElements (Section 3.6.1, Section 2.9.4),DeleteElements (Section 3.6.2, Section 2.9.4), GetElements (Section 3.6.3), and RenameNodes (Sec-

Page 11: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

1.2 Getting Started 9

tion 3.6.4) allow for adding, deleting, or extracting netlist entries and changing node names,respectively, in a comfortable way.

Statistics (Section 3.6.17) prints information on the contents of a Netlist or Circuit object.

Analog Insydes provides a predefined symbolic device model library (Chapter 4.3), which can beextended by the user. Several commands allow for accessing the model data base (Chapter 3.3):

LoadModel (Section 3.3.6) loads a specific model from a given model library.

FindModel (Section 3.3.2) searches the default model library for a given name/selector pair.

GlobalSubcircuits (Section 3.3.4, Section 2.3.6) prints the name/selector pairs of all globalmodels currently loaded.

ListLibrary (Section 3.3.1) prints the contents of a specific model library.

Equations

Starting from Circuit or Netlist objects, circuit equations can be set up automatically in differ-ent formulations and analysis modes. They are stored (together with additional information) in aDAEObject.

CircuitEquations (Section 3.5.1, Chapter 2.4, Section 2.4.2, Section 2.6.4) sets up circuit equationsfrom a Circuit or Netlist object and returns a DAEObject.

Solve (Section 3.5.4, Section 2.4.2) can be used to symbolically solve the equations stored in aDAEObject.

GetEquations (Section 3.6.5, Section 2.10.2), GetVariables (Section 3.6.7, Section 2.10.2),GetDesignPoint (Section 3.6.12, Section 2.9.6), and GetParameters (Section 3.6.9, Section 2.10.2)give easy access to the data stored in a DAEObject.

ApplyDesignPoint (Section 3.6.13), UpdateDesignPoint (Section 3.6.14, Section 2.10.2), andMatchSymbols (Section 3.6.15, Section 2.9.3) allow for modifying the contents of a DAEObject.

GetDAEOptions (Section 3.6.10) and SetDAEOptions (Section 3.6.11) allow for accessing or modi-fying the options stored in a DAEObject.

Statistics (Section 3.6.17, Section 2.9.7) prints information on the complexity of a DAEObject.

Numerical Analyses

The standard numerical circuit analyses can be carried out by the following commands (Chapter 3.7):

NDAESolve (Section 3.7.5, Chapter 2.7) is used to solve nonlinear differential-algebraic equationsystems. It calculates the DC (Section 2.6.6), DC-transfer (Section 2.7.2), and transient solution(Section 2.7.1), also parametric (Section 2.7.2).

ACAnalysis (Section 3.7.3, Section 2.9.7) computes the small-signal solution of a linear equationsystem.

Page 12: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

10 1. A Short Introduction

NoiseAnalysis (Section 3.7.4) computes the output noise and the equivalent input noise of alinear equation system.

Poles and Zeros

Besides the standard numerical analyses, Analog Insydes provides functions for numerically com-puting poles and zeros as well as root loci of linear systems (Chapter 3.8):

PolesAndZerosByQZ (Section 3.8.3), PolesByQZ (Section 3.8.4), and ZerosByQZ (Section 3.8.5) nu-merically compute poles and zeros of a linear system using the QZ algorithm.

RootLocusByQZ (Section 3.8.6) computes the root locus of a linear system.

Graphical Postprocessing

Analog Insydes provides special graphics functions for the most important electrical engineeringplots:

BodePlot (Section 3.9.1, Section 2.5.1)

FourierPlot (Section 3.9.2)

NicholPlot (Section 3.9.3, Section 2.5.3)

NyquistPlot (Section 3.9.4, Section 2.5.2)

RootLocusPlot (Section 3.9.5, Section 2.5.4)

TransientPlot (Section 3.9.6, Section 2.7.1, Section 2.7.6)

Symbolic Approximation

One of the most important features of Analog Insydes is its capability to reduce the complexity ofsymbolic equations and expressions with automatic error control. For linear circuits, Analog Insydesprovides SBG and SAG methods (Chapter 2.8):

ApproximateTransferFunction (Section 3.11.2, Chapter 2.8, Section 2.8.2) approximates a sym-bolic transfer function by removing insignificant terms.

ApproximateMatrixEquation (Section 3.11.3, Chapter 2.8, Section 2.8.3) approximates a symbolicmatrix equation with respect to a certain output variable.

ApproximateDeterminant (Section 3.8.8) approximates a symbolic matrix equation with respectto a certain pole.

As of Analog Insydes Version 2 there are also simplification routines for nonlinear equations (Chap-ter 3.12):

CompressNonlinearEquations (Section 3.12.2, Section 2.10.2) algebraically simplifies nonlinearequations by eliminating irrelevant variables.

Page 13: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

1.2 Getting Started 11

CancelTerms (Section 3.12.3, Section 2.10.2) approximates a symbolic nonlinear equation sys-tem with respect to a certain output variable. The command NonlinearSetup (Section 3.12.1,Section 2.10.2) prepares the application of CancelTerms.

Miscellaneous

DXFGraphics (Section 3.13.2) translates DXF files into Mathematica graphics objects. It can be usedto display circuit schematics in a Mathematica notebook for documentation purposes.

Options[Analog Insydes] (Chapter 3.14) returns the list of global Analog Insydes options. SeeSection 3.14.8 for a description of the option inheritance mechanism in Analog Insydes.

Info[AnalogInsydes] (Section 3.15.6) prints the exact location of your Analog Insydes installationand lists all loaded init files. For a description of init file loading see Section 3.15.1. For furtherinformation on the Analog Insydes environment see Chapter 3.15.

1.2.2 The First Step

To work with Analog Insydes start Mathematica and open a new notebook window. Then loadAnalog Insydes by evaluating the command

<<AnalogInsydes‘

in the first command line (please do not forget to type the quote character "‘").

The above command reads in the Analog Insydes context and sets up autoload declarations for allother Analog Insydes packages. If you have not launched a Mathematica kernel yet, you will have towait a few extra seconds until the kernel is loaded.

If Mathematica complains that it cannot find the master package check your context search path byinspecting the value of the Mathematica variable $Path. The directory in which the Analog Insydessubdirectory resides should be on this list. If this is not the case then add the package path to $Pathby typing AppendTo[$Path, pathspec] and try loading Analog Insydes again. Another common erroris to type the wrong quote character, thus be sure to use "‘".

If you are already familiar with Analog Insydes 1 you probably want to test the new version beforereading the manual. Almost all commands of version 1 are also available in version 2, but pleasenote that the function patterns may have changed (see Section 1.3.3 for more details). If you are notfamiliar with Analog Insydes, please at least go through the example in Section 1.2.3 before usingAnalog Insydes. This section will give you a first impression how to work with Analog Insydes.

Additionally, we recommend to take a look at the demo notebooks which are available for downloadat

http://www.analog−insydes.de/demos2.html

There you will find a number of different problems and tasks from the field of electrical engineeringand how to solve them using Analog Insydes 2.

Page 14: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

12 1. A Short Introduction

Once you have loaded Analog Insydes into the Mathematica kernel you can obtain detailed informa-tion concerning your local Analog Insydes installation by means of the following commands:

ReleaseInfo[AnalogInsydes] prints information about your Analog Insydes license type

ReleaseNumber[AnalogInsydes] returns the release number of your Analog Insydesinstallation

License[AnalogInsydes] returns your Analog Insydes license number

Version[AnalogInsydes] prints a detailed description of your Analog Insydesversion

Info[AnalogInsydes] prints the location of your Analog Insydes installation andthe list of loaded init files

Obtaining Analog Insydes release information.

If you encounter any bug in Analog Insydes, please send a bug report to:

[email protected]

When reporting problems, please proceed as follows: Evaluate all commands in a Mathematicanotebook until your problem occurs and describe it as detailed as possible. Whenever possible,print Netlist and Circuit objects as well as DAEObjects in InputForm. Afterwards, please addthe information concerning your Analog Insydes installation by evaluating each of the followingcommands in separate cells of the Mathematica notebook and attach this notebook to your problemreport:

$VersionId$Path$LicenseIDReleaseInfo[AnalogInsydes]Version[AnalogInsydes]License[AnalogInsydes]Info[AnalogInsydes]

Please be sure to evaluate the commands after your problem occurs, because otherwise some mod-ules might not be loaded during the evaluation of Version[AnalogInsydes]. If possible, attachadditional data such as netlist or data files to the email as well.

1.2.3 An Example Application

This example describes the standard way how to use Analog Insydes. It can easily be adapted todifferent analysis tasks and applications. The usage of many different commands, from netlist importto linear simplification techniques, is explained and cross references are given where to find moreinformation. Reading this section should give you a first overview of the capabilities of AnalogInsydes.

Page 15: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

1.2 Getting Started 13

Analysis Task

Following, we want to analyze the ΜA741 operational amplifier. The task is to find an interpretablesymbolic formula for the corner frequency of the small-signal voltage transfer function. This is usefulto identify those circuit elements and parasitics, which have a dominant influence on it. In addition,the symbolic transfer function can be utilized for further investigation, such as the extraction of itspoles and zeros, to find methods for the compensation of certain effects.

Importing Schematics

To import the schematics picture of the operational amplifier, we use the Analog Insydes commandDXFGraphics (Section 3.13.2). This command translates two-dimensional DXF data into Mathematicagraphics objects which can be displayed in a Mathematica notebook. Most schematics entries ofcommercial circuit simulators support the export of schematics in DXF format. DXFGraphics allowsfor importing your schematics into Mathematica for documentation purposes.

Before using DXFGraphics, of course we have to load the Analog Insydes master package as describedin Section 1.2.2.

In[1]:= <<AnalogInsydes‘

In[2]:= DXFGraphics["AnalogInsydes/DemoFiles/OP−741.dxf"]

QNPN741Q1 QNPN741Q2

QPNP741Q3 QPNP741Q4

QNPN741 Q5 QNPN741Q6

QNPN741Q7

QPNP741Q8

1kR1

1kR2

50kR3

QPNP741Q9

QNPN741

Q10QNPN741

Q11

5kR4

QPNP741Q12

QPNP741Q131 QPNP741

Q132

40kR5

QNPN741Q14

QNPN741Q15

QNPN741Q16

QNPN741Q17

27R6

22R7

100R8

50kR9

50k

R10

50kR11

300

R12

QNPN741Q18

QNPN741Q19

QPNP741Q20

QPNP741Q21

QNPN741 Q24

QNPN741 Q23

30pC1

QPNP741

Q222

QPNP741Q221

+-

V1

+-

V2

+-Vid

+- Vos

1k

R13

+ -Vic0

0

V

3

9

10

8

6 7

2

1

15

16 22

25

17

19

18

23

24

26

27

13

11 12 1420

0

4

5

21

Out[2]= Graphics

DXFGraphics provides many options for altering the appearance of imported DXF files. They aredescribed in Section 3.13.2.

Importing Netlist Data

For the application of symbolic analysis, especially symbolic approximation, the next step is to gen-erate a netlist including the numerical reference information. The netlist of the operational amplifierΜA741 consists of 45 elements. Writing the complete circuit in the Analog Insydes netlist language(which is described in Chapter 2.2 and Chapter 2.3) by hand would be a tedious and error-pronetask. Therefore, Analog Insydes provides the command ReadNetlist (Section 3.10.1), which auto-

Page 16: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

14 1. A Short Introduction

matically translates an external netlist description into the Analog Insydes netlist format. You canimport netlists written for or generated by PSpice, Eldo, and Saber.

The first argument to ReadNetlist is the simulator input file. Since this file (*.cir in our case)only contains the numerical values of the elements, the operating-point information and the valuesfor the small-signal parameters of the transistors have to be extracted from the simulator output file(*.out in our case). This is performed automatically by ReadNetlist, too. All we have to do isspecifying the corresponding simulator output file as second argument.

In[3]:= op741 = ReadNetlist["AnalogInsydes/DemoFiles/OP−741.cir","AnalogInsydes/DemoFiles/OP−741.out",Simulator −> "PSpice", KeepPrefix −> False]

Out[3]= Circuit

As the syntax of external netlist files varies for each simulator, you have to specify from whichexternal format you are reading by means of the Simulator option of ReadNetlist.

The return value of ReadNetlist is a Circuit object which contains symbolic values for each netlistelement as well as the corresponding numerical reference information. By default, the Circuit objectis displayed as a single line in your output cell. To view the complete netlist apply the commandDisplayForm to the Circuit object (we will not evaluate the command since the output is too bigto be shown here):

DisplayForm[op741]

Additionally, you can use the command Statistics (Section 3.6.17) to get an impression of thecircuit complexity. This command prints the number of different element types occuring in thecircuit.

In[4]:= Statistics[op741]

Number of Resistors : 13

Number of Capacitors : 1

Number of VoltageSources : 5

Number of models BJT/QNPN741 : 15

Number of models BJT/QPNP741 : 11

Total number of elements : 45

Setting Up Circuit Equations

Once the netlist is imported, the next step is to set up the symbolic circuit equations. In AnalogInsydes this can be done automatically using the command CircuitEquations (Section 3.5.1). TheAnalog Insydes netlist read by ReadNetlist contains generic model references for each transistor anddoes not specifiy a concrete model implementation. Thus, we have to instruct Analog Insydes whichmodel to use during equation setup by means of the option ModelLibrary. Analog Insydes comeswith a predefined SPICE-compatible, symbolic model library in three different complexity levelscalled "FullModels‘", "SimplifiedModels‘" , and "BasicModels‘" (the implemented models areexplained in detail in Chapter 4.3. For special tasks the model library can be extended by the user;this topic is discussed in Chapter 2.3). In the following, we choose a complexity-reduced BJT model

Page 17: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

1.2 Getting Started 15

from the Analog Insydes model library by setting the option ModelLibrary −> "BasicModels‘".Note that a quote mark ("‘") is following the word BasicModels.

In[5]:= mnaAC741 = CircuitEquations[op741,ElementValues −> Symbolic,ModelLibrary −> "BasicModels‘"]

Out[5]= DAEAC, 3333

The additional option ElementValues −> Symbolic tells Analog Insydes to set up equations usingthe symbolic element values instead of the numerical ones. By default, CircuitEquations sets upsmall-signal equations in matrix formulation, but DC or transient equations can be set up, too. SeeSection 3.5.1 and Chapter 2.4 for details. CircuitEquations returns a DAEObject which containsthe equation system as well as additional data which is used and extracted automatically by otherAnalog Insydes commands. As for Circuit objects, a DAEObject is printed in short notation onlyand can be displayed using DisplayForm (we once more omit evaluating the command since theequation system is too big to be printed here):

DisplayForm[mnaAC741]

Again, you can use Statistics (Section 3.6.17) to get an impression of the equation size.

In[6]:= Statistics[mnaAC741]

Number of equations : 33

Number of variables : 33

Number of entries : 1089

Number of non−zero entries : 171

Complexity estimate : 1.6e21

Importing Simulation Data

When using netlists from external simulators we always have to verify that the models used duringequation setup are compatible to the ones used by the simulator. This is done by comparing thenumerical solution calculated by the external simulator with the solution calculated by Analog Insy-des. If both solutions do not coincide within a tolerable error range, we have to go back one stepand choose different models during equation setup before going on with the symbolic analysis. Tosimplify this procedure, Analog Insydes provides the command ReadSimulationData (Section 3.10.3)for importing numerical data generated by an external simulator. As for ReadNetlist we have tospecify from which format we are reading by means of the Simulator option. The list of supportedformats is shown in Section 3.10.1.

In[7]:= op741data = ReadSimulationData["AnalogInsydes/DemoFiles/OP−741.csd",Simulator −> "PSpice"]

Out[7]=V26 InterpolatingFunction0.1, 1.106,

ReadSimulationData returns the result according to the Analog Insydes numerical data formatwhich is described in Section 3.7.1. It consists of a list of rules, where the variables (which arereturned as strings) are assigned InterpolatingFunction objects.

Page 18: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

16 1. A Short Introduction

Graphically Displaying Simulation Data

We can use Mathematica’s ReplaceAll operator (or /. in short notation) to extract a single interpo-lating function from the numerical data and assign it to a new variable.

In[8]:= vout741PSpice = "V(26)" /. First[op741data]

Out[8]= InterpolatingFunction0.1, 1.106,

The variable vout741PSpice now contains the numerical data for the output voltage at node 26.Its waveform can be graphically displayed in a Bode diagram using the function BodePlot (Sec-tion 3.9.1).

In[9]:= BodePlot[vout741PSpice[f], f, 0.1, 10^6]

1.0E-1 1.0E1 1.0E3 1.0E5Frequency

0

20

40

60

80

100

Magnitude (dB)

1.0E-1 1.0E1 1.0E3 1.0E5

1.0E-1 1.0E1 1.0E3 1.0E5Frequency

-80

-60

-40

-20

0

Phase (deg)

1.0E-1 1.0E1 1.0E3 1.0E5

Out[9]= Graphics

Analog Insydes provides several standard graphic functions for visualizing numerical analysis results,see Chapter 2.5 and Chapter 3.9.

Performing Reference Simulation

A numerical reference simulation is performed applying the Analog Insydes function ACAnalysis(Section 3.7.3) in the frequency range of interest. The first argument of ACAnalysis is the DAEObjectcreated by CircuitEquations, which contains the system of equations. The second argument de-notes the output variable to solve for. We are interested in the node voltage at node and accordingto the automatic naming mechanism (which is described in Section 2.4.1) the corresponding variableis called V$26.

In[10]:= reference = ACAnalysis[mnaAC741, V$26, f, 0.1, 10^6]

Out[10]=V$26 InterpolatingFunction0.1, 1.106,

Next, the frequency response calculated with Analog Insydes and the simulation data imported fromPSpice are compared graphically, using the capability of the command BodePlot to display severaltransfer functions within one plot.

Page 19: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

1.2 Getting Started 17

In[11]:= BodePlot[reference, vout741PSpice[f], V$26[f],f, 0.1, 10^6, ShowLegend −> False]

1.0E-1 1.0E1 1.0E3 1.0E5Frequency

0

20

40

60

80

100

Magnitude (dB)

1.0E-1 1.0E1 1.0E3 1.0E5

1.0E-1 1.0E1 1.0E3 1.0E5Frequency

-80

-60

-40

-20

0

Phase (deg)

1.0E-1 1.0E1 1.0E3 1.0E5

Out[11]= Graphics

The curves match perfectly in the frequency range of interest. Hence, the simplified BJT model issufficient for being used in the next step of the symbolic analysis flow.

Calculating the Complexity of the Symbolic Transfer Function

Recall that the task is to calculate the symbolic transfer function in order to extract a formula for thecorner frequency. Thus, at this point it is useful to estimate the complexity of the symbolic transferfunction to find out whether the number of its terms is manageable. This can be done with the helpof the function ComplexityEstimate (Section 3.11.1).

In[12]:= ComplexityEstimate[mnaAC741] // N

Out[12]= 1.618681021

ComplexityEstimate returns an integer value. We use Mathematica‘s N operator to transform thisinteger into a real number. The result shows that the number of terms forming the fully expandedsymbolic transfer function is greater than and thus too large to be handled. Therefore,we will now apply a routine which removes all those terms whose influence on the behavior of thetransfer function is negligible. This drastically reduces the complexity.

Setting Up Circuit Equations for Approximation

To prepare the simplification process we set up the system of circuit equations again. As againstthe previous call to the function CircuitEquations, where the circuit equations were given in themodified nodal analysis format, they are set up in sparse tableau formulation this time. Sparsetableau is the preferred equation formulation when performing linear approximation tasks. Detailsabout the Formulation option are given in Section 3.5.1.

Page 20: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

18 1. A Short Introduction

In[13]:= staAC741 = CircuitEquations[op741,ElementValues −> Symbolic, Formulation −> SparseTableau,ModelLibrary −> "BasicModels‘"]

Out[13]= DAEAC, 402402

The returned equation system is a DAEObject with equations and variables.

In[14]:= Statistics[staAC741]

Number of equations : 402

Number of variables : 402

Number of entries : 161604

Number of non−zero entries : 1392

Complexity estimate : 1.6e21

Although this sparse tableau system is more than 10 times bigger than the modified nodal system,it usually produces better approximation results.

Performing Matrix Approximation

Now we call the matrix approximation routine on the symbolic circuit equations of the ΜA741 circuit.This routine simplifies the equations based on numerical constraints with respect to a given outputvariable. The required information is provided in form of several sampling points, specified incombination with a maximum error constraint each. The approximation routine then processes thematrix such that the sought output function is located within the defined error range around thegiven sampling points. For further information please refer to Section 3.11.3.

To capture the first corner frequency, we place sampling points at Hz and at Hz with a maximumerror of each.

In[15]:= samplingpoints = s −> 2. Pi I 1., MaxError −> 0.3,s −> 2. Pi I 10., MaxError −> 0.3

Out[15]=s 6.28319 I, MaxError 0.3, s 62.8319 I, MaxError 0.3

With the given setup, the approximation routine can be called. The computation is carried outwith respect to the output voltage across the load resistor R13, which in this case is equivalentto the sought transfer function. Again, based on the automatic naming scheme (Section 2.4.1), thecorresponding variable is called V$R13 (note that sparse tableau equations consist of branch voltagesinstead of node voltages).

In[16]:= op741approx = ApproximateMatrixEquation[staAC741, V$R13,samplingpoints]

Out[16]= DAEAC, 402402

Page 21: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

1.2 Getting Started 19

In[17]:= Statistics[op741approx]

Number of equations : 402

Number of variables : 402

Number of entries : 161604

Number of non−zero entries : 455

Complexity estimate : 14

As another call to the function Statistics shows, the approximation routine could considerablyreduce the complexity of the DAEObject (i.e. the number of non-zero entries), although its equationsize did not change. With just a small number of terms remaining, a symbolic computation of thetransfer function is now possible.

Calculating the Transfer Function

To calculate the transfer function, we now solve the approximated system of equations for the outputvoltage:

In[18]:= approximation = Solve[op741approx, V$R13]

Out[18]=V$R13 gm$Q1 gm$Q16 gm$Q17 gm$Q2 gm$Q3

gm$Q4 gm$Q5 R9 Ro$Q131 Ro$Q17 Ro$Q42 Rpi$Q16 Rpi$Q17 VID gm$Q3 gm$Q1 gm$Q2 gm$Q1 gm$Q4 gm$Q5 Ro$Q131 Ro$Q17

gm$Q16 gm$Q17 R8 R9 Ro$Q4 Rpi$Q16 Rpi$Q17 Ro$Q4 R9 Ro$Q4 gm$Q17 R8 Ro$Q4 Rpi$Q17

C1 gm$Q16 gm$Q17 gm$Q3 gm$Q1 gm$Q2 gm$Q1 gm$Q4 gm$Q5 R9

Ro$Q131 Ro$Q17 Ro$Q42 Rpi$Q16 Rpi$Q17 s

Again, we use Mathematica’s ReplaceAll operator to extract the calculated solution and assign it toa new variable.

In[19]:= vout741 = V$R13 /. First[approximation] // Simplify

Out[19]=gm$Q16 gm$Q17

gm$Q2 gm$Q4 R9 Ro$Q131 Ro$Q17 Ro$Q4 Rpi$Q16 Rpi$Q17 VID gm$Q2 gm$Q4 gm$Q17 R8 Ro$Q131 Ro$Q17 Ro$Q4 Rpi$Q17

R9 Ro$Q17 Ro$Q4 gm$Q16 gm$Q17 R8 Rpi$Q16 Rpi$Q17 Ro$Q131 Ro$Q4 gm$Q16 gm$Q17 R8 Rpi$Q16 Rpi$Q17

C1 gm$Q16 gm$Q17 Ro$Q17 Ro$Q4 Rpi$Q16 Rpi$Q17 sThis expression now represents the approximated symbolic transfer function of the ΜA741 circuit. Itcontains only those circuit elements and parasitics that were not removed by the matrix approxima-tion routine. Thus, they have been identified as those elements, which have a major influence onthe behavior of the transfer function.

Verifying Approximation Results

The quality of the approximation can be determined by performing a numerical comparison betweenthe simplified transfer function and the data imported from the numerical simulator (PSpice in thiscase). Therefore, we need to extract the design point from the DAEObject first using the command

Page 22: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

20 1. A Short Introduction

GetDesignPoint (Section 3.6.12). The design point specifies those numerical values for each one ofthe circuit elements that were given in the netlist.

In[20]:= designpoint = GetDesignPoint[staAC741]

Out[20]=Rpi$Q1 755999.9999999999,Ro$Q1 2.19107, Cbc$Q1 3.71013, Cbe$Q1 1.471012,gm$Q1 0.00029, Cbx$Q1 0., Rpi$Q2 753000.,Ro$Q2 2.18107, Cbc$Q2 3.71013, Cbe$Q2 1.471012,gm$Q2 0.000291, Cbx$Q2 0., Rpi$Q3 218999.9999999999,Ro$Q3 8.46106, Cbc$Q3 3.851013, Cbe$Q3 1.421012,gm$Q3 0.000287, Cbx$Q3 0., Rpi$Q4 216999.9999999999,Ro$Q4 8.4106, Cbc$Q4 3.871013, Cbe$Q4 1.421012,gm$Q4 0.0002879999999999999, Cbx$Q4 0., Rpi$Q5 704999.9999999999, Ro$Q5 2.04107, Cbc$Q5 8.281013,Cbe$Q5 1.471012, gm$Q5 0.000285, Cbx$Q5 0., Rpi$Q6 704999.9999999999, Ro$Q6 2.04107, Cbc$Q6 7.931013,Cbe$Q6 1.471012, gm$Q6 0.000285, Cbx$Q6 0.,Rpi$Q7 533000., Ro$Q7 1.55107, Cbc$Q7 2.971013,Cbe$Q7 1.481012, gm$Q7 0.0004469999999999999, Cbx$Q7 0.,Rpi$Q8 89499.99999999999, 86, Cbe$Q19 1.571012,gm$Q19 0.00787, Cbx$Q19 0., Rpi$Q20 5809.999999999999,Ro$Q20 225000., Cbc$Q20 1.111012, Cbe$Q20 4.481012,gm$Q20 0.0111, Cbx$Q20 0., Rpi$Q21 3.341013,Ro$Q21 6.241011, Cbc$Q21 3.661013, Cbe$Q21 1.1012,gm$Q21 3.431013, Cbx$Q21 0., Rpi$Q24 1.861014,Ro$Q24 9.281011, Cbc$Q24 1.1012, Cbe$Q24 1.1012,gm$Q24 3.771018, Cbx$Q24 0., Rpi$Q23 1.861014,Ro$Q23 9.821011, Cbc$Q23 7.131013, Cbe$Q23 1.1012,gm$Q23 6.911014, Cbx$Q23 0., C1 3.1011,Rpi$Q222 7549.999999999999, Ro$Q222 291999.9999999999,Cbc$Q222 3.751013, Cbe$Q222 1.521012,gm$Q222 0.008449999999999999, Cbx$Q222 0.,Rpi$Q221 5.1013, Ro$Q221 7.671011, Cbc$Q221 3.751013,Cbe$Q221 3.881013, gm$Q221 2.681014, Cbx$Q221 0.,R13 1000., VID 1., Simulator PSpice

The numerical representation of the approximated transfer function depending on the Laplace vari-able s is now found by applying the numerical design point data to the symbolic transfer function.

In[21]:= vout741N[s_] = vout741 /. designpoint // Simplify

Out[21]=7.321521022

2.902871017 1.517451016 s

Another Bode plot shows the PSpice simulation data compared with the approximated numerictransfer function in the frequency range from Hz to MHz.

Page 23: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

1.2 Getting Started 21

In[22]:= BodePlot[vout741PSpice[f], vout741N[2. Pi I f],f, 0.1, 10^6, ShowLegend −> False]

1.0E-1 1.0E1 1.0E3 1.0E5Frequency

0

20

40

60

80

100

Magnitude (dB)

1.0E-1 1.0E1 1.0E3 1.0E5

1.0E-1 1.0E1 1.0E3 1.0E5Frequency

-80

-60

-40

-20

0

Phase (deg)

1.0E-1 1.0E1 1.0E3 1.0E5

Out[22]= Graphics

It is apparent that although the number of terms occuring in the transfer function has been re-duced from almost to (!), the curves still match perfectly in the frequency range ofinterest. Therefore, the approximation is qualified to replace the actual transfer function for furthercomputations.

Further Processing

From the approximated transfer function we can now extract additional information, such as thecalculation and graphical representation of its poles and zeros.

The poles of the approximated symbolic transfer function can be found by calculating the zeros ofits denominator.

In[23]:= poles1 = Solve[Denominator[vout741] == 0, s] // Simplify

Out[23]=s Ro$Q131 Ro$Q17 gm$Q17 R8 Ro$Q4 Rpi$Q17

R9 Ro$Q4 gm$Q16 gm$Q17 R8 Rpi$Q16 Rpi$Q17 C1 gm$Q16 gm$Q17 R9 Ro$Q131 Ro$Q17 Ro$Q4 Rpi$Q16 Rpi$Q17

This single pole of the approximated transfer function corresponds to the dominant pole of theoriginal transfer function. To achieve its value, we have to insert the given design-point information.

In[24]:= p1 = poles1 /. designpoint

Out[24]= s 19.1299

We now verify the above result by computing the exact pole locations, employing the functionPolesByQZ (Section 3.8.4) on the original equation system.

Page 24: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

22 1. A Short Introduction

In[25]:= poles = PolesByQZ[mnaAC741]

Out[25]=4.198221010, 3.020541010, 3.97873107 7.96404107 I,

3.97873107 7.96404107 I, 6.47642106,8.33125107 1.17108 I, 8.33125107 1.17108 I,2.53983108, 2.04133108, 2.02066108,3.85479108, 6.26147108, 8.75148108, 19.5077,9.68714108, 1.2364109, 2.15863109 6.82302108 I,2.15863109 6.82302108 I, 2.63327109, 7.93728109,9.89724109, 1.582871010, 1.468981010

Now we sort the poles in ascending order of their absolute values.

In[26]:= Sort[poles, Abs[#1] < Abs[#2] &]

Out[26]=19.5077, 6.47642106, 3.97873107 7.96404107 I,

3.97873107 7.96404107 I, 8.33125107 1.17108 I,8.33125107 1.17108 I, 2.02066108, 2.04133108,2.53983108, 3.85479108, 6.26147108, 8.75148108,9.68714108, 1.2364109, 2.15863109 6.82302108 I,2.15863109 6.82302108 I, 2.63327109, 7.93728109,9.89724109, 1.468981010, 1.582871010, 3.020541010,4.198221010

This yields a list, whose first entry represents the equivalent to the numerical solution which wasfound before with the help of the approximated transfer function. Since both values match well, thisis another indication that the extracted formula for the pole indeed describes the dominant pole ofthe operational amplifier.

For further insights, there are various graphics functions available to visualize the extracted informa-tion, such as the functions RootLocusPlot (Section 3.9.5) or NyquistPlot (Section 3.9.4). For detailsplease refer to the respective sections.

Conclusion

This example showed the application of Analog Insydes on the analysis of the ΜA741 operationalamplifier for extracting a formula for the corner frequency of the small-signal transfer function. In afirst step we imported the netlist and simulation data files from PSpice, set up the equations in Ana-log Insydes and verified the numerical solution. A complexity estimation showed that calculating thetransfer function for the original equation system is not possible, thus we applied an approximationroutine to achieve a simplified equation system. Using this system it was possible to symbolicallycalculate its transfer function. Finally, we achieved a symbolic formula describing the pole of thesimplified transfer function and the dominant pole of the original transfer function. An additionalcomparison of the numerical pole values showed that indeed the formula represents the dominantpole. This symbolic formula now provides deeper insight into the corner frequency location.

Page 25: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

1.2 Getting Started 23

1.2.4 The Online Help System

Because Analog Insydes is a complex system, it comes with a detailed online documentation: Forquick information, a compact help text is available for each Analog Insydes symbol. This text can bedisplayed using the Mathematica ? operator (which is also called Information). For Analog Insydescommands, the purpose and function patterns are printed, for Analog Insydes options, the purposeand possible values are given. For example:

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Get help text for thecommand LoadModel.

In[2]:= ?LoadModel

LoadModel[name, selector] or LoadModel[name1,

selector1, ...] loads one or several models from the

model library. LoadModel[name, selector, Scope −>

scope] assigns local or global scope to the loaded

model.

Get help text for theoption Protocol.

In[3]:= ?Protocol

Protocol is a global Analog Insydes option used by several

functions. It specifies if and where protocols should

be printed. Option values are StatusLine, Notebook,

All, or None, or a list of these symbols.

For more detailed information, the complete Analog Insydes documentation including tutorial andappendix is available in the standard Mathematica online help system. Launch the help browserand select the category Add-ons. In the left column then appears a row labeled Analog Insydes. Bychoosing this item you enter the Analog Insydes online documentation. For searching a certainkeyword, select the Master Index category and type the keyword in the Go To: field. One or morehyperlinks to corresponding sections in the Analog Insydes documentation will then be given.

Note that for the documentation to appear in the help browser, Analog Insydes has to be properlyinstalled on your system and the help index has to be recalculated. For the latter choose the menuitem Help->Rebuild Help Index.

1.2.5 The Analog Insydes Palette

Analog Insydes provides a palette window which allows you to enter nearly all Analog Insydescommands by simply pressing a button.

The palette is divided into subgroups which can be opened by clicking on the triangle symbol.Clicking on a button pastes the corresponding text into your session notebook. Clicking on a buttonmarked with a blue star pastes a more complex skeleton into your notebook. The status line of thepalette window indicates which skeleton is pasted.

Page 26: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

24 1. A Short Introduction

The Analog Insydes palette

By choosing the menu item File->Palettes->AnalogInsydes you launch the Analog Insydes palettewindow.

Alternatively, you can find the Analog Insydes palette in the file

aidir/FrontEnd/Palettes/AnalogInsydes.nb

of your Analog Insydes installation. Use the command Info (Section 3.15.6) to obtain the path ofyour Analog Insydes installation directory.

Page 27: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

1.3 What’s New? 25

1.3 What’s New?

Since the first release in 1998, Analog Insydes has been successfully applied to real-world problemsby our customers. The key algorithms implemented in Analog Insydes – particularly the symbolicapproximation methods – proved to be very effective, but it turned out that improvements regardingtool functionality, user-friendliness, interfaces, processing speed, and the device model library wouldbe desirable. After three years of development, here is the result: Analog Insydes Version 2. Thischapter guides you through the most noticable enhancements of the new version.

1.3.1 New Features: An Overview

New Interfaces for PSpice, Eldo, and Saber

Netlist import including small-signal and model-card parameters

Behavioral model writer

Simulation data import and export

New Device Model Library

PSpice and Eldo compatible models for R, L, C, D, BJT, MOS, and JFET

BJT: full Gummel-Poon small-signal and large-signal models

MOS: full Level 1-3 + BSIM3v3 small-signal models, Level 1 large-signal model

Extended Circuit Description and Modeling Language

Model parameter sets, global parameters, multiple source values

Enhanced modeling language for nonlinear dynamic systems

Improved Circuit Equation Setup

Automatic model library search

Automatic design-point extraction for linear and nonlinear circuits

Consistent data handling through DAEObjects

New and Improved Analysis Modes

AC, noise, pole/zero, DC, DC transfer, temperature, transient, parametric, root locus

Page 28: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

26 1. A Short Introduction

New and Improved Symbolic Approximation Techniques

New and improved linear approximation techniques for AC and pole/zero analysis

New approximation techniques for nonlinear circuits

Full Integration of High-Performance MathLink Binaries

For symbolic matrix approximation and numerical pole/zero analysis (QZ algorithm)

Multi-platform support (Solaris, Linux, HP-UX, Windows)

Graphics Functions

New and improved graphics functions

Improved command interfaces for a more comfortable use

Improved User Interface

Improved user interface allows for setting up and running circuit analyses from PSpice, Eldo, orSaber netlists with as few as three Analog Insydes commands

1.3.2 New Features: A More Detailed Description

The most noticeable changes between Analog Insydes versions 1 and 2 were made to the circuitdescription and modeling language and to the way circuit equations are set up, stored, and presentedto the user:

Netlist Format

The circuit description language (netlist format) was extended by functionality for managing devicemodel parameter sets (model cards), global parameter settings, initial conditions, and multiple sourcevalues for different analysis modes (AC, DC, transient). With these enhancements it is now possi-ble to represent all netlist and device model information contained in a SPICE circuit descriptionconsistently in an Analog Insydes Circuit object.

The netlist fragment shown below illustrates the use of some new language features. Note thatthe unspecific arguments of the keywords Model, Selector, and Parameters in the value fieldof the device reference Q1 permit an easy selection of device models and parameter sets at runtime using Mathematica’s pattern rewriting functionality. The model expansion mechanism of AnalogInsydes 2 makes use of this approach to automatically select appropriate device models according tothe specified analysis mode.

Page 29: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

1.3 What’s New? 27

Analog Insydes 2 netlistfragment

amplifier = Circuit[Netlist[

V1, 1, 0, Symbolic −> V1,Value −> AC −> 1, DC −> 2.5,

Transient−>SinWave[Time, 2.5, 0.1, 1000],Q1, 2 −> C, 1 −> B, 3 −> E,

Model−>Model[BJT, NDEF, Q1],Selector −> Selector[BJT, NDEF, Q1],Parameters −> Parameters[BJT, NDEF, Q1],GM$ac −> 0.02, RPI$ac −> 5.0*10^3, ,

],ModelParameters[Name −> NDEF, Type −> NPN,

IS −> 10^−16, BF −> 100, BR −> 1, VAF −> 150],GlobalParameters[TEMP −> 300, GMIN −> 10^−12]

]

Circuit Equations

In Analog Insydes 1, symbolic circuit equations and corresponding numerical information (designpoint, initial conditions, etc.) were not handled in a consistent fashion. To prevent errors due to po-tentially inconsistent data and to provide a unified and more user-friendly mechanism for managingall additional data associated with a system of symbolic circuit equations, the internal representationof circuit equations was fundamentally changed in version 2. Now, all equation setup and circuitanalysis functionality is centered around a common data structure, the DAEObject.

A DAEObject is generated by means of the command CircuitEquations. It represents a linearor nonlinear system of differential-algebraic equations (DAE) along with numerical data needed fornumerical analysis or symbolic approximation. In addition, a DAEObject contains information aboutthe type of equations it represents (AC/DC/transient, MNA/STA) plus a snapshot of all relevantoption settings taken at the point of time when the equations were set up. This data encapsulationapproach ensures the consistency of all data belonging to a particular circuit analysis context andreduces the number of parameters that need to be passed to functions which operate on circuitequations.

Interfaces

Analog Insydes 2 provides several new or improved modules for interfacing with commercial circuitdesign environments. Platform-independent netlist converters with small-signal data and model-card import functionality are now available for a variety of widely used circuit simulators, includingPSpice, Saber, and Eldo. Waveforms can be imported from PSpice, Saber, and Eldo data files. Circuitschematics can be imported into Mathematica via a DXF file converter. Moreover, Analog Insydes 2features a model writer which is capable of generating behavioral model templates (e.g. Saber MAST)automatically from a DAEObject.

Page 30: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

28 1. A Short Introduction

Modeling Language

As a consequence of the requirements identified during recent work on symbolic modeling andanalysis of nonlinear circuits, the behavioral modeling capabilities for nonlinear dynamic systemswere substantially extended. With the enhanced model description format of Analog Insydes 2, it isnow possible to designate model port nodes as optional, to specify default values for model param-eters as well as initial conditions and guesses for model variables, and to control how design-pointinformation is generated for symbolic parameters of model equations.

Library Concept

Based on the modeling language extensions described above, a completely new device model libraryconcept was designed for Analog Insydes 2. PSpice and Eldo compatible models are available for R,L, C, D, BJT, MOS, and JFET devices. Three model simplification levels can be selected when settingup circuit equations to control the complexity of symbolic analysis.

Nonlinear Symbolic Analysis

Completely new functionality has been implemented for symbolic analysis and approximation ofnonlinear circuits. Based on a flexible user interface, the approximation routines allow an arbitrarychoice of analysis and error-control functions. In combination with the new model writer, AnalogInsydes 2 can be used for automated generation of nonlinear behavioral models.

Pole/Zero Analysis

Efficient numerical pole/zero and root locus analysis is now supported through two different gen-eralized eigenvalue problem solvers: an enhanced version of the QZ algorithm and a variant of theJacobi orthogonal correction method (JOCM). The introduction of the DAEObject concept reducesthe amount of parameters passed to functions. In addition, a new matrix-based method for sym-bolic pole/zero analysis has been implemented. The algorithm simplifies a symbolic generalizedeigenvalue problem with respect to a selected root, using the JOCM for efficient iterative errortracking.

User Interface

The use of Analog Insydes 2 has been considerably simplified by combining many frequently usedsteps in powerful macro commands and providing more default actions. With as few as three Ana-log Insydes commands it is possible to set up and run circuit analyses from PSpice, Eldo, or Sabernetlists. In addition, the external binaries (QZ algorithm, matrix approximation) have been fullyintegrated into Analog Insydes 2 and can be used transparently like built-in commands.

Page 31: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

1.3 What’s New? 29

Multi-Platform Support

Multi-platform support is available for all binaries: One Analog Insydes installation can be accessedfrom different platforms. Transparently for the user the correct binaries are automatically chosen.This allows for installing Analog Insydes on a site-wide file server and simultaneously using it fromdifferent platforms.

1.3.3 Compatibility

To realize the improvements made in version 2 of Analog Insydes, drastic changes on the internaldata format had to be performed, such that we could not keep 100% compatibility with version 1.As a consequence, version 1 notebooks may not evaluate without errors using Analog Insydes 2.But fortunately, only some minor changes (like modifying function arguments) are usually sufficientto evaluate with version 2. These changes are listed below.

ApproximateMatrixEquation

altered pattern according to ApproximateTransferFunction

former option PrintProtocol now called Protocol, option values changed

CircuitEquations

option DefaultModelLibrary now called ModelLibrary

option DifferentialOperator now called FrequencyVariable

option setting SparseTableauVariant −> Basic | Extended now obtained byFormulation −> SparseTableau | ExtendedTableau

option setting SymbolicValues −> True | False now obtained byElementValues −> Symbolic | Value

option setting TimeDomain −> True | False now obtained by AnalysisMode −> Transient | AC

option UnitValues is obsolete

CSDFRead

former command CSDFRead substituted by new implementation called ReadSimulationData

DXFGraphics

option FillColor now called FillColors, option values modified

options LineThickness, LineAbsoluteThickness, PolylineWidthScale, PrimitivesOut,TextOffsetX, TextOffsetY, and TextAlignBottom are obsolete

Page 32: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

30 1. A Short Introduction

NDAESolve, NDAESolveDC

former command NDAESolveDC substituted by additional pattern for NDAESolve

option AnalysisMethod now called AnalysisMode

modified values for option Protocol

RootLocusPlot

modified values for options PoleStyle and ZeroStyle

SolveCircuitEquations

former command SolveCircuitEquations substituted by Solve

spice2ai.exe, SpiceToAI, WhereIsSpice2ai

former external executable spice2ai.exe and wrapper function SpiceToAI substituted by newimplementation ReadNetlist

options Spice2aiOptions and Spice2aiPath are obsolete

command WhereIsSpice2ai is obsolete

CheckedCircuit, CheckedNetlist, FlatNetlist

replaced by NetlistObject[Checked | Flat]

Page 33: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

Tutorial

2.1 Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

2.2 Netlists . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

2.3 Circuits and Subcircuits . . . . . . . . . . . . . . . . . . . 46

2.4 Setting up and Solving Circuit Equations . . . . . . . . . . 70

2.5 Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

2.6 Modeling and Analysis of Nonlinear Circuits . . . . . . . . 90

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits . . 104

2.8 Linear Symbolic Approximation . . . . . . . . . . . . . . 127

2.9 Frequency-Domain Analysis of Linear Circuits . . . . . . 142

2.10 Nonlinear Symbolic Approximation . . . . . . . . . . . . 164

Page 34: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

32 2. Tutorial

2.1 Preface

2.1.1 How to Read this Tutorial

Whereas Part 3 of this book serves as a reference manual for all Analog Insydes commands, Part 2explains dedicated topics of Analog Insydes in a tutorial manner. Although this part is entitledTutorial, it is not meant to be read entirely at once by the novice user before working with AnalogInsydes. Rather, each chapter can be read separately to get a more detailed insight into the corre-sponding topic. For example, Chapter 2.3 describes how to write your own subcircuits and modelsand how to use them during equation setup. However, in the usual application, netlists are importedautomatically using the command ReadNetlist, and equations are set up using predefined modelsof the Analog Insydes model library. Thus, in most cases there is no need to write netlists andmodels by hand. Nevertheless, you may encounter a task that requires a special hand-written devicemodel. In this case it is recommended to consult Chapter 2.3 (and perhaps Chapter 2.2 as well) tolearn more about the fine points of Analog Insydes’ modeling capabilities. For the novice user werecommend to read Chapter 2.4, Chapter 2.5, Chapter 2.7, and Chapter 2.9.

2.1.2 Loading Analog Insydes

The first thing we need to do before we can use any circuit analysis function is to load the AnalogInsydes master package. This file reads in the context AnalogInsydes‘Main‘ which contains allfunction definitions for working with netlists. In addition, the master package sets up autoloaddeclarations for other Analog Insydes functions which are not defined in the Main context.

Loading of Analog Insydes is performed by evaluating the command

<<AnalogInsydes‘

in a Mathematica notebook window.

If this command fails then check if your package directory is on Mathematica’s list of search paths. For this,evaluate the expression $Path in a Mathematica notebook and inspect the result. If the path to your AnalogInsydes directory is not listed then append it to the list with the command AppendTo[$Path, "your AnalogInsydes path"] and re-execute the above command.

Besides loading the Analog Insydes context and installig autoloaders, the above command ad-ditionally reads several init files which allow for adapting Analog Insydes to your local needs.Section 3.15.1 describes the location of the init files, the loading order, and how to suppress loadingof init files. An init file can for example be used to permanently change default values of options.

Once Analog Insydes is loaded, you can obtain information on your local Analog Insydes installationusing the commands described in Chapter 3.15.

Page 35: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.2 Netlists 33

2.2 Netlists

2.2.1 The Netlist Format

Analog Insydes provides functions which can automatically set up several types of circuit equationsfrom the netlist description of a circuit. Netlists are sequences of Mathematica lists encapsulated bythe Analog Insydes command Netlist (Section 3.1.1). There must be one such list, or netlist entry,for each element in a circuit. Netlist entries are not required to be listed in any particular order.

netlistname =Netlist[

netlist entry 1,netlist entry 2,

]

A Netlist object is the Analog Insydes data structure for representing flat netlists. For hierarchicalcircuit descriptions using subcircuits, the Circuit object is used which is discussed in Chapter 2.3.

For a simple example refer to the voltage divider circuit shown in Figure 2.1.

V0

R2

R1

1

2

Figure 2.1: Voltage divider circuit

An Analog Insydes netlist desribing the circuit looks as follows:

In[1]:= <<AnalogInsydes‘

In[2]:= voltageDivider =Netlist[

V0, 1, 0, 10,R1, 1, 2, R1,R2, 2, 0, R2

]

Out[2]= NetlistRaw, 3

Page 36: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

34 2. Tutorial

The Netlist command returns a raw netlist object which prints its content in short notation, i.e.only the number of elements is shown. To get a more detailed view of the netlist content use thecommand DisplayForm:

In[3]:= DisplayForm[voltageDivider]

Out[3]//DisplayForm= Netlist Raw, 3 Entries:V0, 1, 0, 10R1, 1, 2, R1R2, 2, 0, R2

The netlist entry format (see Section 3.1.3) bears some remote similarity to that of the well-known andwidely used numerical circuit simulator SPICE in that circuit elements are specified by an individualname, a list of nodes, and a value. In Analog Insydes, netlist entries must be lists of three fieldswhich are called the reference designator, the connectivity list, and the value field:

reference designator, connectivity list, value field

This global scheme describes the only valid syntax for netlist entries – there is no exception to thisformat.

Reference Designators

The reference designator is a unique name by which a particular circuit element can be distinguishedfrom all other elements in the same netlist. Typically, the leading one, two, or three characters of areference designator implicitly determine the type of the corresponding element. Hence, V0 denotesa voltage source (type tag V), R1 and R2 denote resistors (type tag R), and VCCS a voltage-controlledcurrent source (type tag VC).

There are mechanisms to override automatic type detection from reference designators explicitly but this andother related advanced topics will be discussed later.

Unlike Mathematica variables, type tags are not case sensitive. Therefore, two circuit elements withreference designators R1 and r1 are both recognized as resistors. However, the symbols R1 and r1represent two entirely different elements.

Connectivity Lists and Node Identifiers

The connectivity list specifies the nodes of the circuit to which the terminals of an element areconnected. For that purpose, every node in a circuit must be given a unique name, a node identifier,by which it can be referenced. While some circuit simulators require the nodes to be enumeratedby consecutive nonnegative integers, Analog Insydes lets you choose node identifiers quite freely.You do not have to number your nodes consecutively, nor do you need to use numbers as nodeidentifiers at all. In addition to nonnegative integers, you may also use symbols or strings as nodelabels. The only requirement is that the circuit’s ground node must be identified by the label 0(zero). Internally all node identifiers are converted to strings. Thus, the node identifiers OUT and"OUT" refer to the same node. Moreover, node identifiers are case sensitive. Thus, OUT and Out referto different nodes.

Page 37: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.2 Netlists 35

V1

gm*V1

R

1

2 6

4 out1

out2

Figure 2.2: Resistor and voltage-controlled current source

For a two-terminal element, such as a resistor (Section 4.2.1), the connectivity list must containexactly two node identifiers whereas a controlled source, i.e. a four-terminal element, requires fournode identifiers: two for the controlling branch and two for the controlled branch. Netlist entries forthe resistor and the voltage-controlled current source (Section 4.2.13) shown in Figure 2.2 thus haveto be written as follows:

R1, 1, 2, RVC2, 4, 6, out1, out2, gm

Reference Directions for Currents and Voltages

In Analog Insydes netlists, the order of the nodes in a connectivity list determines the positivereference direction for both the associated branch voltage and the branch current. In other words,the reference directions for voltages and currents always have the same orientation.

V0

I$V0

2

1

Figure 2.3: Voltage source, reference directions for branch voltage and current

In Figure 2.3, the positive terminal of the voltage source (Section 4.2.10) is connected to node 1,and the negative terminal is connected to node 2. The corresponding netlist entry then defines thepositive reference direction for the branch voltage as well as for the current I$V0 to be oriented fromnode 1 to node 2:

Page 38: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

36 2. Tutorial

V0, 1, 2, V0

Hence, a positive value for the branch current, I$V0 , denotes a current flowing from node 1 tonode 2. So whenever a circuit analysis yields a negative result for I$V0 there is nothing wrong. Thisjust means that the current is in fact flowing into the opposite direction, i.e. from node 2 to node 1.

Element Values

As opposed to SPICE, the values of circuit elements need not be purely numerical quantities. SinceMathematica is capable of performing mathematical calculations symbolically, the element values mayalso be any symbolic or mixed symbolic/numeric expressions. In the voltage-divider example (seeFigure 2.1) we assigned a numerical value of 10 (Volts) to the voltage source whereas we used thesymbolic values R1 and R2 for the two resistors. (Note that you don’t have to specify any unitslike Volts for numerical values.) In this case, the symbols used for the values of the resistors areidentical to the reference designators, but we could also have supplied any other valid Mathematicaexpression.

V0

R2=2*R

R1=R

1

out

Figure 2.4: Voltage divider circuit with different node names and resistor values

Let’s make use of some of the facts presented in the preceding paragraphs by renaming node 2 ofthe voltage divider to out, arbitrarily making the assignments R1 R and R2 R, and rewritingthe netlist accordingly (see Figure 2.4):

In[4]:= voltageDivider2 =Netlist[

V0, 1, 0, 10,R1, 1, out, R,R2, out, 0, 2 R

]

Out[4]= NetlistRaw, 3

Page 39: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.2 Netlists 37

2.2.2 Circuit Elements

Element Types

Having learned the basics about the netlist format we will now take a look at the circuit elementtypes (see Chapter 4.2) which are supported by Analog Insydes. The names of all available typesare stored in a globally accessible list named ElementTypes (Section 3.1.5):

In[5]:= ElementTypes

Out[5]=Resistor, Conductance, Admittance, Impedance, Capacitor,Inductor, CurrentSource, VoltageSource, CCCSource, CCVSource,VCCSource, VCVSource, Nullator, Norator, Fixator, OpAmp, OTAmp,ABModel, OpenCircuit, ShortCircuit, SignalSource, Amplifier,Integrator, Differentiator, TransmissionLine, TransferFunction

To obtain information about the netlist format for a particular circuit element, type ?element. Thiswill print the corresponding usage message to the screen. For example, let’s find out more aboutthe elements Capacitor (Section 4.2.5) and VCCSource (Section 4.2.13):

In[6]:= ?Capacitor

Capacitor (type tag "C") denotes a linear capacitor. The

netlist format is Cname, N1, N2, value. Network

equation setup for capacitors is influenced by the

value field option Pattern.

In[7]:= ?VCCSource

VCCSource (type tag "VC") denotes a linear

voltage−controlled current source. The netlist format

is VCname, C1, C2, N1, N2, value. Note that the

nodes of the controlling branch, C1 and C2, are listed

before those of the controlled branch, N1 and N2. As

compared to Spice, the order is reversed!

You may have noticed that there are no such elements as diodes, bipolar or MOS transistors containedin ElementTypes.

Nevertheless, Analog Insydes comes with a predefined library of symbolic semiconductor device models (seeChapter 4.3), which contains full-precision SPICE-compatible models for the most important devices such asDiodes, BJTs, MOSFETs, and JFETs.

In addition to the linear electric circuit elements like resistors and capacitors the list of element typescontains six elements from control theory, namely signal sources, amplifiers, integrators, etc. This isbecause Analog Insydes is capable of analyzing linear control circuits as well. You can even performsymbolic analyses of systems which contain both electrical and control components, allowing you todo behavioral circuit modeling across different levels of abstraction.

Page 40: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

38 2. Tutorial

Controlled Sources: Some Caveats

If you have worked with SPICE netlists before you will see some differences in the way you haveto formulate the netlist entries for controlled sources in an Analog Insydes netlist. Apart from themore meaningful type tags (VV, CC, VC, CV as opposed to E, F, G, H), Analog Insydes uses a uniformscheme for all four types of controlled sources, i.e. you have to specify two nodes for the controllingbranch and two nodes for the controlled branch for both voltage-controlled and current-controlledsources.

V1gm*V1

1

2 4

3

I1 r*I1

C1

C2 N2

N1

Figure 2.5: Current-controlled voltage source (left) and voltage-controlled current source (right)

For the two controlled sources shown in Figure 2.5 the netlist entries must be written as follows.Note, that the nodes of the controlling branches are listed first.

CV1, C1, C2, N1, N2, rVC2, 1, 2, 3, 4, gm

Analog Insydes treats controlled sources as true two-port elements, so every controlled source addstwo electrical branches to a circuit, a controlling and a controlled branch. In the case of current-controlled sources you have to keep in mind that the controlling branch is nothing else than a shortcircuit (Section 4.2.8). Therefore, do not connect the controlling branch of a current-controlled sourcein parallel to another circuit element. Instead, always use a series connection of the controllingbranch and the circuit element whose branch current controls the source.

Let’s clarify this important point by writing a netlist for the circuit shown in Figure 2.6. The current-controlled current source is controlled by the current flowing through the resistor RB. If we wrotethe netlist entry for the CCCS (Section 4.2.11) as

CC1, 1, 0, 2, 0, beta

the controlling branch would be inserted in parallel to RB and thus short-circuit the resistor.

Page 41: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.2 Netlists 39

CM

RL

beta*IB

2

RB

1

V0

IB

Figure 2.6: Result of incorrectly inserted current-controlled current source

The correct solution to this problem is to add another node to the circuit and connect the controllingbranch in series with RB as shown in Figure 2.7.

CM

RL

beta*IB

2

RB

1

V0

IB3

Figure 2.7: CCCS circuit with correctly inserted controlling branch

We can then write a correct netlist as follows:

In[8]:= cccsCircuit =Netlist[

V0, 1, 0, V0,RB, 1, 3, RB,CM, 1, 2, CM,CC1, 3, 0, 2, 0, beta,RL, 2, 0, RL

]

Out[8]= NetlistRaw, 5

2.2.3 A Brief Preview on Circuit Analysis

There is much more to learn about netlists, but before going into the details let’s get an impression ofAnalog Insydes’ basic symbolic circuit analysis functionality. Computing voltages and currents in acircuit requires essentially two steps: Setting up a system of circuit equations and then solving theseequations. Circuit equations can be set up automatically by applying the function CircuitEquations(Section 3.5.1) to a netlist description.

We set up equations for the voltage divider circuit defined in Section 2.2.1 (see Figure 2.1):

Page 42: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

40 2. Tutorial

In[9]:= vdeqs = CircuitEquations[voltageDivider]

Out[9]= DAEAC, 33

By default, CircuitEquations sets up a system of modified nodal, or MNA, equations (ModifiedNodal Analysis) in the frequency domain. The return value is a DAEObject which contains the threecomponents of the linear matrix equation A x b, where A is the coefficient matrix, x the vectorof unknown voltages and currents, and b the vector of independent sources. To display the systemof equations in a more readable form we can apply the command DisplayForm to the DAEObjectvdeqs:

In[10]:= DisplayForm[vdeqs]

Out[10]//DisplayForm=

1R1 1R1 1

1R11R1 1R2 0

1 0 0

.

V$1V$2I$V0

0010

Here, the vector of unknowns comprises the node voltages V$1 and V$2 at nodes 1 and 2, plus thecurrent I$V0 flowing through the voltage source V0.

We can solve the MNA equations by using the function Solve (Section 3.5.4). Given the systemof equations and no additional arguments, Solve solves for all voltages and currents listed in thevector of unknowns.

In[11]:= Solve[vdeqs]

Out[11]= I$V0 10

R1 R2

, V$2 10 R2

R1 R2

, V$1 10

The values of V$1 and V$2 correspond to what we would expect from a voltage divider. If youwonder about the negative sign of I$V0 remember what has been said about positive referencedirections of branch voltages and currents in Section 2.2.1.

As a second example we will compute the node voltage at node 2 of the CCCS circuit (see Figure 2.7)as a symbolic function of the circuit parameters in the frequency domain.

In[12]:= cccseqs = CircuitEquations[cccsCircuit];DisplayForm[cccseqs]

Out[13]//DisplayForm=

1RB CM s CM s 1RB 1 0

CM s 1RL CM s 0 0 beta

1RB 0 1RB 0 1

1 0 0 0 00 0 1 0 0

.

V$1V$2V$3I$V0IC$CC1

000V00

The last variable in the vector of unknowns, IC$CC1, denotes the controlling current of the controlledsource CC1 (see Section 2.4.1). We can solve for V$2 by explicitly passing this variable as a secondargument to Solve.

In[14]:= Solve[cccseqs, V$2]

Out[14]= V$2 RL beta CM RB s V0

RB 1 CM RL s

Page 43: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.2 Netlists 41

The result represents the Laplace transform of the zero-state response of the voltage at node 2,expressed in terms of the complex frequency variable s.

The zero-state response is the response of a system which was in the zero state at the time just prior to theapplication of the input signal. Zero state means that all initial conditions, i.e. capacitor voltages and inductorcurrents, are zero.

2.2.4 More about Netlists

The General Value-Field Format

As indicated in the previous section, some aspects regarding the netlist format have not yet beenmentioned. So far, we have used only the simplest form of writing netlist entries (see Section 2.2.1).In general, however, the value field of a netlist entry does not need to be a single Mathematicaexpression but may also be a nonempty sequence of options. Netlist entries may thus look like this:

name, nodes, option1 −> value1, option2 −> value2,

There are several value-field option keywords which Analog Insydes understands (see Section 3.1.4):Value, Symbolic, Type, Pattern, InitialCondition, Model (Section 3.2.1), and Subcircuit (Sec-tion 3.2.2). Their meanings will be discussed in the following subsections.

Value

If the value field is written in its general sequence-of-options form then all of its components must beoptions. This necessitates an option which specifies the value of the circuit element, namely Value(see Section 3.1.4). With the Value option we can rewrite a netlist entry such as

R1, 1, 2, R1

in the following semantically equivalent general form:

R1, 1, 2, Value −> R1

Of course, as long as the value field contains no more information than only the element value thesimple form is the preferred form. Note that if the value field is written in option form, then theValue option must be present.

Symbolic

The Symbolic option (see Section 3.1.4) is closely related to the Value option. It allows you tospecify an alternative symbolic element value in addition to a numerical value given as argument tothe Value option, for instance:

R1, 1, 2, Value −> 100, Symbolic −> R1

By default, circuit equations are set up using the arguments of the Value options as element values,but CircuitEquations (Section 3.5.1) can be instructed to use the symbolic values instead wherever

Page 44: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

42 2. Tutorial

the Symbolic option is given. This allows for assigning both a numerical as well as a symbolic valueto a circuit element. You will be able to assess the value of this feature better once you have learnedmore about the topics described in Chapter 2.3 and Chapter 2.8.

Type

The value field option Type (see Section 3.1.4) allows you to specify the type of an element explicitly,thus overriding the automatic type detection from an element’s reference designator. The argumentto the Type option must be the full name of a circuit element type supported by Analog Insydes(see Chapter 4.2). The available types are listed in the global variable ElementTypes. Using theType option we could write a netlist entry for a resistor in the following way even though the nameShunt does not begin with the type tag R.

Shunt, 1, 2, Type −> Resistor, Value −> R1

Moreover, as Analog Insydes generates voltage and current identifiers (see Section 2.4.1) by addingthe prefixes "V$" and "I$" to the reference designators, the Type option gives us some more influ-ence on the names of voltages and currents. In this example, the resistor current would be namedI$Shunt, whereas it would be named I$R1 for the netlist entries from the previous two subsections.

The example below shows a more convincing application of the Type option. Assume that you havean amplifier circuit with an output load connected between nodes out and ground, and that youwish to calculate the amplifier’s frequency responses for both resistive and capacitive loads. Youcould, of course, write two separate netlists for this purpose. On the other hand, the Type optionoffers you the alternative to set up only one single netlist but with a variable load type:

amplifier =Netlist[ Load, out, 0, Type −> loadtype, Value −> loadval,

]

Then, by replacing the type variable with a concrete type name, you can set up circuit equations fora particular type of load, e.g. for a capacitor:

CircuitEquations[amplifier /. loadtype −> Capacitor, loadval −> CL]

Note that in both cases the identifier for the load current will be I$Load, regardless of the loadelement type eventually selected.

Finally, the Type option helps us to correct a frequently made mistake, which usually occurswhen a netlist contains a supply voltage source named VCC. If we relied on automatic typedetection from the reference designator VCC, Analog Insydes would give us the error message"Netlist::numnode: Expected 4 nodes but received 2 for VCCSource VCC". The reason for thiserror is that VC is the type tag for voltage-controlled current sources, so Analog Insydes interpretsVCC as (VC)C and not as a voltage source V(CC). This problem can be easily solved by means of theType directive:

Page 45: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.2 Netlists 43

VCC, 1, 0, Type −> VoltageSource, Value −> VCC

Pattern

The Pattern option (see Section 3.1.4) can be used only in conjunction with two-terminal im-mittances, i.e. impedance and admittance elements such as resistors (Section 4.2.1), conductances(Section 4.2.2), capacitors (Section 4.2.5), and inductors (Section 4.2.6). With this directive you canexplicitly choose whether the contribution of an immittance element to a system of modified nodalequations is entered into the matrix using the fill-in pattern for admittances or the pattern forimpedances. The two associated values of the Pattern option are Impedance and Admittance.

When setting up modified nodal equations, Analog Insydes automatically converts impedance ele-ments such as resistors into their admittance equivalents in order to keep the matrix size as smallas possible. In other words, a resistor with the value R will be treated as an admittance with thevalue R and will be entered into the modified nodal matrix using the fill-in pattern for admittances(see the example in Section 2.2.3). However, if we are interested in computing the current through aparticular resistor it would be better to use the fill-in pattern for impedances as this would augmentthe MNA system by the corresponding branch current. So if we want to calculate the load current ofthe above-mentioned amplifier using the MNA formulation we would have to select the impedancepattern for the load resistor in order to introduce the branch current I$Load:

Load, out, 0, Type −> Resistor, Value −> RL,Pattern −> Impedance

Let’s experiment with some value-field options using the CCCS circuit from Section 2.2.2 (seeFigure 2.7). We replace the resistor RL by a variable load type and select the fill-in pattern forimpedances.

In[15]:= cccsCircuit2 =Netlist[

V0, 1, 0, V0,RB, 1, 3, RB,CM, 1, 2, CM,CC1, 3, 0, 2, 0, beta,Load, 2, 0, Type −> loadtype, Value −> loadval,

Pattern −> Impedance]

Out[15]= NetlistRaw, 5

We choose a resistive load with the symbolic value RL and set up the MNA equations. Due to thePattern directive, the load current I$Load now appears as an additional variable for which we cansolve directly.

Page 46: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

44 2. Tutorial

In[16]:= cccseqs2 = CircuitEquations[cccsCircuit2 /. loadtype −> Resistor, loadval −> RL];

DisplayForm[cccseqs2]

Out[17]//DisplayForm=

1RB CM s CM s 1RB 1 0 0

CM s CM s 0 0 beta 1

1RB 0 1RB 0 1 0

1 0 0 0 0 00 0 1 0 0 00 1 0 0 0 RL

.

V$1V$2V$3I$V0IC$CC1I$Load

000V000

In[18]:= Solve[cccseqs2, I$Load]

Out[18]= I$Load beta CM RB s V0RB 1 CM RL s

Next, we select a capacitive load CL and solve for the load current again.

In[19]:= cccseqs3 = CircuitEquations[cccsCircuit2 /. loadtype −> Capacitor, loadval −> CL];

DisplayForm[cccseqs3]

Out[20]//DisplayForm=

1RB CM s CM s 1RB 1 0 0

CM s CM s 0 0 beta 1

1RB 0 1RB 0 1 0

1 0 0 0 0 00 0 1 0 0 0

0 1 0 0 0 1CL s

.

V$1V$2V$3I$V0IC$CC1I$Load

000V000

In[21]:= Solve[cccseqs3, I$Load]

Out[21]= I$Load CL beta CM RB s V0CL CM RB

InitialCondition

With the InitialCondition option (see Section 3.1.4), you can specify initial currents and voltagesfor the dynamic elements Inductor (Section 4.2.6) and Capacitor (Section 4.2.5), respectively. If noinitial condition is given explicitly, it will be assumed to be zero (AC analysis) or will be calculatedautomatically from the operating-point data (transient analysis).

As an example, we set an initial capacitor voltage of V0 for the netlist entry C1 of the following filtercircuit:

In[22]:= filter =Netlist[

V1, 1, 0, V1,R1, 1, 2, R1,C1, 2, 0, Value −> C1, InitialCondition −> V0

]

Out[22]= NetlistRaw, 3

Page 47: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.2 Netlists 45

In[23]:= filtereqs = CircuitEquations[filter,InitialConditions −> Automatic];

DisplayForm[filtereqs]

Out[24]//DisplayForm=

1R1 1R1 1

1R11R1 C1 s 0

1 0 0

.

V$1V$2I$V1

0C1 V0V1

See Section 2.7.5 for a description of initial condition handling during equation setup.

Model, Subcircuit

The purpose of the Model and Subcircuit directives is to mark a netlist entry as being a referenceto a device model or subcircuit definition. Chapter 2.3 deals with the details.

Page 48: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

46 2. Tutorial

2.3 Circuits and Subcircuits

2.3.1 Circuits, Netlists, and Subcircuits

Hierarchical Netlist Entry

The flat netlist representation we used so far is usually sufficient for small analysis tasks with nomore than a handful of circuit elements. Now imagine that we want to analyze active circuits likethe transistor amplifier shown in Figure 3.1, and want to do several transfer function calculationswith different transistor models. It would be rather inconvenient if we had to edit the netlist everytime we select another semiconductor device model. Therefore, Analog Insydes provides a hier-archical netlist entry scheme which allows us to regard the transistor object as a black box withthree terminals and lets us write a netlist for the circuit containing only a reference to the box butno specification of what’s inside. Separately from this netlist, we can define one or more concreterealizations of the box in the form of equivalent (sub)circuits and let Analog Insydes automaticallyreplace the reference by one of the subcircuit definitions.

V1 R2 RE

R1

Q1

RC

VCC

Vout

1

2

4

3

Figure 3.1: Common-emitter transistor amplifier

The Circuit Object

When structured hierarchically, a circuit description comprises a top-level netlist with subcircuit ormodel references, and a set of subcircuit definitions.

Page 49: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.3 Circuits and Subcircuits 47

Throughout this text, the terms "subcircuit" and "model" shall be used as synonyms because small-signaldevice models are effectively implemented as subcircuits composed of circuit primitives like resistors andcontrolled sources.

Keeping all netlist and subcircuit components of a circuit together is the task of the Analog Insydesdata structure Circuit (Section 3.1.2), whose content sequence may be any number of netlist andsubcircuit definitions.

Circuit[Netlist[top-level netlist with subcircuit references],Model[subcircuit/model definition], Model[subcircuit/model definition]

]

A Circuit object additionally may contain model parameters and global parameters, seeModelParameters (Section 3.1.10) and GlobalParameters (Section 3.1.11).

When a Circuit object is defined, it is printed in short notation only. To view the entire circuitstructure use the command DisplayForm.

2.3.2 Defining Subcircuits and Device Models

The Model Object

Let’s start to work with hierarchically structured netlists by learning how to define subcircuits usingthe Analog Insydes objects Model (Section 3.2.1) or Subcircuit (Section 3.2.2). This section describeshow to write netlist-based models or subcircuits. Section 2.6.2 shows how to write equation-basedmodels.

Model and Subcircuit are semantically equivalent symbols. In fact, Subcircuit is just an alias namefor Model. You may want to use both names in a Circuit if you wish to give visual cues as to whichsubcircuits represent device models by using the Model directive for these and the Subcircuit object for allother subcircuits.

The Model object takes several arguments which must all be written in Mathematica’s option syntaxkeyword −> value. Four of the arguments must always be present whereas the remaining ones areoptional or have default values. Below, the optional arguments are printed in slanted typewriterfont. For now, we will restrict ourselves to the discussion of the required arguments. The optionalones will be introduced later in a step-by-step fashion, as this will help you to better understandwhy and when they are needed.

Page 50: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

48 2. Tutorial

Model[Name −> subcircuit class name,Selector −> selector,Scope −> scope,Ports −> port nodes,Parameters −> parameters,Defaults −> defaults,Translation −> parameter translation rules,Definition −> Netlist[subcircuit netlist]

]

The value of the Name argument must be a symbol which identifies an entire group, or class, ofdifferent subcircuit implementations of a non-primitive object, such as a transistor. The value of theSelector argument, which must also be a symbol, then selects one particular member from thisclass. The Ports argument defines the port nodes of a subcircuit structure. Its value must be a listof the identifiers of the subcircuit nodes which serve as external connection points.

Finally, the netlist of the subcircuit must be specified by means of the Definition argument. Thereis no built-in limit for the nesting depth of subcircuits, so the netlist may itself contain referencesto other Model definitions. However, you may only reference but not define subcircuits withinsubcircuits.

Small-Signal Transistor Models

To fully understand this abstract description of the Model function, let’s examine a practical example.Assume that we want to calculate the AC voltage transfer function of the common-emitter amplifierfrom Section 2.3.1 (see Figure 3.1) and want to replace the transistor by either one of the twosmall-signal equivalent circuits shown in Figure 3.2.

Page 51: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.3 Circuits and Subcircuits 49

IBBB

EE

CC

EE

RB RBbeta*IB beta*IB

X XIB

CM

R0

C

B

E

Figure 3.2: Different transistor small-signal models: simple (left), dynamic (right)

Both circuits have in common that they represent the same object, namely an NPN transistor. Thus,they are two members of a subcircuit class we shall name NPNTransistor:

Name −> NPNTransistor

Within this class, each member must have a unique selector by which it can be identified. We willdenote the simple small-signal model on the left-hand side of Figure 3.2 by

Selector −> ACsimple

and the one on the right-hand side by

Selector −> ACdynamic

From now on we will adopt the notation name/selector for denoting a subcircuit definition. For in-stance, we will refer to the model defined with Name −> NPNTransistor and Selector −> ACsimpleas NPNTransistor/ACsimple . Both subcircuits contain four nodes: B, C, E, and X, where B, C,and E represent the transistor’s base, collector, and emitter terminal respectively. The node X isan internal subcircuit node which is needed for properly connecting the controlling branch of thecurrent-controlled current source in series with the base resistor RB (see also Section 2.2.2). Therefore,we declare only B, C, and E as port nodes of the subcircuits in order to make X invisible from theoutside:

Ports −> "B", "C", "E"

Note that we use strings to denote the port nodes instead of symbols. Although this requires somemore typing this is the recommended way for specifying nodes: If we would have used symbols

Page 52: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

50 2. Tutorial

in the above example, the symbol for the emitter node E could have been mixed up with theMathematica symbol E which denotes the exponential constant e.

Connections to subcircuits can only be made through designated port nodes. Any attempt to inter-face directly with an internal node will cause the generation of an error message when the netlisthierarchy is flattened. However, there is one exception: since the ground node (0) is considered tobe global, elements in subcircuit definitions may be connected directly with global ground withoutthe need to specify 0 as a port node. In fact, 0 cannot be used as port node identifier in AnalogInsydes. Finally, all which remains to do is to write the netlists of the two subcircuits and set up theModel definitions as follows:

Model[Name −> NPNTransistor,Selector −> ACsimple,Ports −> "B", "C", "E",Definition −>

Netlist[RB, "X", "E", RB,CC, "B", "X", "C", "E", beta

]]

Model[Name −> NPNTransistor,Selector −> ACdynamic,Ports −> "B", "C", "E",Definition −>

Netlist[RB, "X", "E", RB,CM, "B", "C", CM,CC, "B", "X", "C", "E", beta,RO, "C", "E", RO

]]

In this example, we used node names for all subcircuit nodes given by strings ("B", "C", "E", "X") butwe could have used positive integers just as well. However, using symbolic names is usually preferable. Thereason is that during subcircuit expansion all internal nodes of subcircuit objects will be instantiated andlabeled with unique identifiers such as X$Q1, which are automatically generated from the node names and thereference designator of the subcircuit instance. If an internal node identifier is an integer, e.g. 2, the generatedinstance identifier 2$Q1 could be confused easily with the product 2*$Q1.

Page 53: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.3 Circuits and Subcircuits 51

2.3.3 Referencing Subcircuits

The Netlist Entry Format for Subcircuit References

Subcircuits or device models defined with the Model command can be referenced from a netlist on ahigher hierarchy level by a netlist entry whose value field contains the options Model and Selector:

subcircuit instance name, port connections,Model −> subcircuit class name, Selector −> selector

To reference a subcircuit object (see Section 3.1.8) the subcircuit class name and the selector mustbe the same identifiers as those given as arguments to the Name and Selector parameters in thecorresponding Model statement. The subcircuit instance name may be any symbol or string which canserve as the unique identifier of this instance of the subcircuit object.

You can even use subcircuit instance names which begin with an element type tag known to Analog Insydes.A subcircuit reference with an instance identifier such as RX will never be confused with a resistor becausethe reference will have been expanded before circuit equations are set up.

A netlist entry which marks a reference to an instance of the NPN transistor modelNPNTransistor/ACsimple , using the instance identifier Q1, would be written as follows:

Q1, connectivity,Model −> NPNTransistor, Selector −> ACsimple

This line does not yet specify how the instance Q1 of NPNTransistor/ACsimple should be embed-ded into the surrounding circuit structure, i.e. which nodes of the latter should be connected to thesubcircuit’s port nodes. Associating external nodes with subcircuit port nodes is done by means ofa special format of the connectivity field. All entries of this field must be written as rules of the form

external node −> subcircuit port node

In our common-emitter amplifier (see Figure 3.1 in Section 2.3.1), node 1 of the top-level netlist isconnected to the base node "B" of the transistor, node 3 to the collector node "C", and node 4 to theemitter node "E", resulting in a node-to-port mapping such as this:

Q1, 1 −> "B", 3 −> "C", 4 −> "E",Model −> NPNTransistor, Selector −> ACsimple

Since the mapping is defined by names, the relative positions of the entries in the connectivity fieldare not important. We could have written the connectivity field as

3 −> "C", 1 −> "B", 4 −> "E"

equally well.

A Hierarchical Netlist Description of the Amplifier

Having learned how to define and how to make references to subcircuits (see Section 3.1.8), we cannow write a hierarchically structured netlist for the common-emitter amplifier from Section 2.3.1 (seeFigure 3.1).

Page 54: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

52 2. Tutorial

In[1]:= <<AnalogInsydes‘

In[2]:= commonEmitterAmplifier=Circuit[

Netlist[V1, 1, 0, inputVoltage,VCC, 2, 0, Type −> VoltageSource,

Value −> supplyVoltage,R1, 2, 1, R1,R2, 1, 0, R2,RC, 2, 3, RC,RE, 4, 0, RE,Q1, 1 −> "B", 3 −> "C", 4 −> "E",

Model −> NPNTransistor, Selector −> BJTModel],

Model[Name −> NPNTransistor,Selector −> ACsimple,Ports −> "B", "C", "E",Definition −>

Netlist[RB, "X", "E", RB,CC, "B", "X", "C", "E", beta

]],

Model[Name −> NPNTransistor,Selector −> ACdynamic,Ports −> "B", "C", "E",Definition −>

Netlist[RB, "X", "E", RB,CM, "B", "C", CM,CC, "B", "X", "C", "E", beta,RO, "C", "E", RO

]]

]

Out[2]= Circuit

Note that in the top-level netlist of this circuit description we used a generic subcircuit selectorBJTModel and not ACsimple or ACdynamic. This allows us to select the model at run time byreplacing BJTModel with ACsimple or ACdynamic just before the subcircuit hierarchy is expanded.In addition, for reasons which will become apparent in the next section, we have used the variablesinputVoltage and supplyVoltage to denote the values of the voltage sources V1 and VCC.

Remember that the Type directive in the value field of VCC prevents Analog Insydes from falsely interpretingthe netlist entry as belonging to a voltage-controlled current source.

Page 55: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.3 Circuits and Subcircuits 53

2.3.4 Subcircuit Expansion

The ExpandSubcircuits Command

Before we can set up circuit equations we must resolve all references to subcircuit objects. Subcircuitinstantiation and flattening the netlist is done by the command ExpandSubcircuits (Section 3.4.1)which accepts a Circuit (Section 3.1.2) or a Netlist (Section 3.1.1) object as argument and returnsa flat netlist object.Such a flat netlist is similar to a Netlist, except that it is guaranteed to containonly circuit primitives and no subcircuit references.

Please note that subcircuit expansion is taken care of automatically by CircuitEquations, so that there isusually no need to call ExpandSubcircuits explicitly, except for inserting models into the global data base.Section 2.3.6 deals with this topic.

We can now use ExpandSubcircuits to generate one flat netlist of the common-emmitter amplifierfrom Section 2.3.1 (see Figure 3.1) for each of the two transistor models we have defined. As thecircuit description is still generic we must first personalize it by replacing its variables according tothe specific analysis task. Our task was to calculate the small-signal voltage transfer function, sobesides choosing an appropriate transistor model we must set the value of the supply voltage sourceVCC to zero and the value of the input signal source to (see Section 2.9.2). Then, the node voltageat the output node 3 will be identical to the transfer function. We apply these variable settings to thenetlist with the Mathematica command ReplaceAll (or /. in short notation) and pass the resultingnetlist to ExpandSubcircuits.

In[3]:= flatAmpSimple = ExpandSubcircuits[commonEmitterAmplifier /.

supplyVoltage −> 0, inputVoltage −> 1,BJTModel −> ACsimple];

DisplayForm[flatAmpSimple]

Out[4]//DisplayForm=Netlist Flat, 8 Entries:

V1, 1, 0, 1VCC, 2, 0, Type VoltageSource, Value 0R1, 2, 1, R1R2, 1, 0, R2RC, 2, 3, RCRE, 4, 0, RERB$Q1, X$Q1, 4, RBCC$Q1, 1, X$Q1, 3, 4, beta

Page 56: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

54 2. Tutorial

In[5]:= flatAmpDyn = ExpandSubcircuits[commonEmitterAmplifier /.

supplyVoltage −> 0, inputVoltage −> 1,BJTModel −> ACdynamic];

DisplayForm[flatAmpDyn]

Out[6]//DisplayForm=Netlist Flat, 10 Entries:

V1, 1, 0, 1VCC, 2, 0, Type VoltageSource, Value 0R1, 2, 1, R1R2, 1, 0, R2RC, 2, 3, RCRE, 4, 0, RERB$Q1, X$Q1, 4, RBCM$Q1, 1, 3, CMCC$Q1, 1, X$Q1, 3, 4, betaRO$Q1, 3, 4, RO

As we can see from the flattened netlists, ExpandSubcircuits has not simply replaced the subcir-cuit references by the original netlists from the Model definitions. The function has also generatedunique symbols for all internal reference designators and node identifiers in the subcircuit netlists byappending a separator character ($) and the subcircuit instance name (Q1) to the original identifiers.This eliminates possible name conflicts with reference designators from the top-level netlist andallows for using multiple instances of a subcircuit definition.

Analysis of the Common-Emitter Amplifier

Now we can analyze the circuit by means of the functions CircuitEquations (Section 3.5.1) andSolve (Section 3.5.4). We start by setting up the modified nodal equations for the simple AC modelfrom the flattened netlist. Note that we could call CircuitEquations on the Circuit object equallywell. We used ExpandSubcircuits for demonstrating the subcircuit expansion mechanism.

Page 57: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.3 Circuits and Subcircuits 55

In[7]:= eqAmpSimple = CircuitEquations[flatAmpSimple];DisplayForm[eqAmpSimple]

Out[8]//DisplayForm=

1R1 1R2 1R1 0 0 0 1 0 1

1R11R1 1RC 1RC 0 0 0 1 0

0 1RC1RC 0 0 0 0 beta

0 0 0 1RB 1RE 1RB 0 0 beta

0 0 0 1RB1RB 0 0 1

1 0 0 0 0 0 0 00 1 0 0 0 0 0 01 0 0 0 1 0 0 0

.

V$1V$2V$3V$4

V$X$Q1I$V1I$VCC

IC$CC$Q1

00000100

To compute the small-signal voltage transfer function we must solve the MNA equations for thenode voltage V$3 at the output node 3.

In[9]:= v3 = Solve[eqAmpSimple, V$3]

Out[9]= V$3 beta RC

RB RE beta RE

The following command extracts the symbolic transfer function expression from the return value ofSolve.

In[10]:= vtf = V$3 /. First[v3]

Out[10]= beta RC

RB RE beta RE

Now, let’s see what happens when we make the (usually realistic) assumption that the transistorcurrent gain is very large:

In[11]:= Limit[vtf, beta −> Infinity]

Out[11]= RCRE

The above result is indeed identical to the well-known approximate formula for the voltage gain ofa common-emitter amplifier. Doing the same calculations for the other transistor model shall be leftto the reader as an exercise.

Page 58: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

56 2. Tutorial

2.3.5 Subcircuit Parameters

Instantiating Element Values in Subcircuit Definitions

Although reference designators and internal node identifiers in subcircuit netlists are always uniquelyinstantiated we still have to cope with one difficulty that arises when working with multiple ref-erences to the same model definition. Consider the following small-signal equivalent circuit of aDarlington amplifier (see Figure 3.3) for which we shall have to compute the overall current gain asa function of the individual current gains of the two transistors Q1 and Q2. The gain can be obtainedby calculating the output response to a unit current I1 applied at the input.

I1

RL

Q11

2

Q23

Iload

Figure 3.3: Darlington amplifier (small-signal equivalent circuit)

Let’s decide to use the transistor model NPNTransistor/ACsimple from Section 2.3.2 (see Figure 3.2)for both transistors. We would then write the circuit description and expand the model referencesas follows.

Remember that the Pattern option in the value field of the netlist entry Load causes the current through theload resistor to be introduced into the modified nodal equations, allowing us to compute the current directly.Alternatively, we could have inserted a short circuit in between RL and node 2 for measuring the current.

Page 59: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.3 Circuits and Subcircuits 57

In[12]:= Circuit[Netlist[

I1, 0, 1, 1,Q1, 1 −> "B", 2 −> "C", 3 −> "E",

Model −> NPNTransistor, Selector −> ACsimple,Q2, 3 −> "B", 2 −> "C", 0 −> "E",

Model −> NPNTransistor, Selector −> ACsimple,Load, 0, 2, Type −> Resistor, Value −> RL,

Pattern −> Impedance],

Model[Name −> NPNTransistor,Selector −> ACsimple,Ports −> "B", "C", "E",Definition −>

Netlist[RB, "X", "E", RB,CC, "B", "X", "C", "E", beta

]]

] // ExpandSubcircuits // DisplayForm

Out[12]//DisplayForm=Netlist Flat, 6 Entries:

I1, 0, 1, 1RB$Q1, X$Q1, 3, RBCC$Q1, 1, X$Q1, 2, 3, betaRB$Q2, X$Q2, 0, RBCC$Q2, 3, X$Q2, 2, 0, betaLoad, 0, 2, Type Resistor, Value RL, Pattern Impedance

While ExpandSubcircuits (Section 3.4.1) has generated unique identifiers for the base resistor RBand the current-controlled current source CC for each instance of the transistor model, it has notmade any changes to the associated symbolic element values RB and beta. Obviously, these havebeen regarded as global symbols, resulting in identical base resistances and current gains of bothtransistors. This is certainly not the result we wanted because the individual current gains of thetransistors in a Darlington stage may be quite different. Instead, ExpandSubcircuits should instan-tiate the element values as well, and thus generate the symbols RB$Q1, RB$Q2, beta$Q1, and beta$Q2for the two resistors and the two current gains respectively.

The reason behind the unwanted behavior exhibited here is that ExpandSubcircuits has not beenexplicitly instructed to treat RB and beta as what they really are, namely as parameters of the model.We can solve this problem by adding the parameter declaration

Parameters −> RB, beta

to our Model definition, which instructs ExpandSubcircuits to replace all occurrences of these sym-bols in the value fields of the subcircuit netlist by different identifiers for each subcircuit instance.

Page 60: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

58 2. Tutorial

In[13]:= darlington =Circuit[

Netlist[I1, 0, 1, 1,Q1, 1 −> "B", 2 −> "C", 3 −> "E",

Model −> NPNTransistor, Selector −> ACsimple,Q2, 3 −> "B", 2 −> "C", 0 −> "E",

Model −> NPNTransistor, Selector −> ACsimple,Load, 0, 2, Type −> Resistor, Value −> RL,

Pattern −> Impedance],

Model[Name −> NPNTransistor,Selector −> ACsimple,Ports −> "B", "C", "E",Parameters −> RB, beta,Definition −>

Netlist[RB, "X", "E", RB,CC, "B", "X", "C", "E", beta

]]

]

Out[13]= Circuit

In[14]:= ExpandSubcircuits[darlington] // DisplayForm

Out[14]//DisplayForm=Netlist Flat, 6 Entries:

I1, 0, 1, 1RB$Q1, X$Q1, 3, RB$Q1CC$Q1, 1, X$Q1, 2, 3, beta$Q1RB$Q2, X$Q2, 0, RB$Q2CC$Q2, 3, X$Q2, 2, 0, beta$Q2Load, 0, 2, Type Resistor, Value RL, Pattern Impedance

After having been defined as parameters, the base resistances and current gains appear properlyinstantiated in the flat netlist. We can now complete our analysis of the Darlington amplifier bysolving the MNA equations for the load current I$Load.

Page 61: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.3 Circuits and Subcircuits 59

In[15]:= eqDarlington = CircuitEquations[darlington];DisplayForm[eqDarlington]

Out[16]//DisplayForm=

0 0 0 0 0 1 0 00 0 0 0 0 beta$Q1 beta$Q2 1

0 0 1RB$Q1 1RB$Q1 0 beta$Q1 1 0

0 0 1RB$Q11RB$Q1 0 1 0 0

0 0 0 0 1RB$Q2 0 1 0

1 0 0 1 0 0 0 00 0 1 0 1 0 0 00 1 0 0 0 0 0 RL

.

V$1V$2V$3

V$X$Q1V$X$Q2IC$CC$Q1IC$CC$Q2I$Load

10000000

In[17]:= Solve[eqDarlington, I$Load]

Out[17]=I$Load beta$Q1 beta$Q2 beta$Q1 beta$Q2

For large current gains beta$Q1 and beta$Q2, the contribution of the product beta$Q1 beta$Q2dominates this sum, resulting in the known current-gain formula for a Darlington stage. Later, inChapter 2.8, we will learn how to let Analog Insydes extract such dominant contributions automati-cally in order to provide compact and interpretable symbolic analysis results.

A Remark on Local and Global Symbols

Critical reading of the preceding text may give rise to the following question: Why are identifiersof internal nodes always instantiated even though they are not explicitly declared as local symbolswhile symbolic element values are assumed to be global symbols unless they are explicitly declaredas parameters? The logic behind this behavior is that it hardly makes sense to regard any internalnode identifier in a generic subcircuit definition as a global symbol – except for rare cases in whichthe global ground node is involved. Whenever we need to connect a subcircuit to a global nodewe must make the connection via a port node. Otherwise, from the point of view of the subcircuitdefinition, we would have to exploit bottom-up knowledge about the set of node names in thetop-level netlist, either to be sure that a certain global node is present or in order to prevent nameclashes. Consequently, the only reasonable option is that all nodes which are not ports must be local,hence they are instantiated individually.

On the other hand, there are some applications where the element values of multiple subcircuitinstances are supposed to be identical, for example in repetitive circuit structures like RLC laddernetworks. If the element values in the subcircuit definition were generally treated as local pa-rameters then, after subcircuit expansion, we would have to go through the tedium of manually

Page 62: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

60 2. Tutorial

assigning the same global symbols to all instances of the corresponding subcircuit element val-ues. This would not be very convenient as it would require typing something along the line ofR$X1 R$X2 R$X3 R for every group of identical elements. By explicitly declaring whichsymbols in a subcircuit denote parameters and quietly assuming all others to be global quantities,cases like that of the Darlington amplifier as well as that of the ladder circuit are both dealt withmost easily. However, Analog Insydes provides the command MatchSymbols which applies match-ing information on a DAEObject. Thus, you can decide which parameters to match even after settingup the equation system.

Passing Parameter Values to Subcircuit Instances

Though intentional and useful, the automatic instantiation of symbolic subcircuit parameters is onlya side effect of the parameter declaration. The original purpose of the Parameters argument in aModel definition is to declare the set of local model variables which can be replaced by instance-specific values given in the value fields of subcircuit references (see Section 3.1.8). In other words,we can pass parameter values to a subcircuit in a similar way as we can pass arguments to a functiondefined in Mathematica. Since we do not have to specify values for model parameters, automaticinstantiation comes into effect whenever a default value is needed for a parameter which has notbeen assigned a value.

If we need to pass parameter values to instances of subcircuit objects we must append a sequenceof replacement rules of the form

parameter symbol −> value

to the value field of the corresponding subcircuit references. The full netlist format of a subcircuitreference is thus

subcircuit instance name, port connections,Model −> subcircuit class name, Selector −> selector,parameter1 −> value1, parameter2 −> value2,

To illustrate the possible cases consider the netlist of the Darlington amplifier from Section 2.3.5 (seeFigure 3.3) once again. Let’s assign the symbolic value RB1 and a numerical value of to theparameters RB and beta of Q1, respectively. In the case of Q2, we assign the symbol beta2 to thecurrent gain whereas we leave the parameter RB unspecified.

Page 63: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.3 Circuits and Subcircuits 61

In[18]:= Circuit[Netlist[

I1, 0, 1, 1,Q1, 1 −> "B", 2 −> "C", 3 −> "E",

Model −> NPNTransistor, Selector −> ACsimple,RB −> RB1, beta −> 150,

Q2, 3 −> "B", 2 −> "C", 0 −> "E",Model −> NPNTransistor, Selector −> ACsimple,beta −> beta2,

Load, 0, 2, Type −> Resistor, Value −> RL,Pattern −> Impedance

],

Model[Name −> NPNTransistor,Selector −> ACsimple,Ports −> "B", "C", "E",Parameters −> RB, beta,Definition −>

Netlist[RB, "X", "E", RB,CC, "B", "X", "C", "E", beta

]]

] // ExpandSubcircuits // DisplayForm

Out[18]//DisplayForm=Netlist Flat, 6 Entries:

I1, 0, 1, 1RB$Q1, X$Q1, 3, RB1CC$Q1, 1, X$Q1, 2, 3, 150RB$Q2, X$Q2, 0, RB$Q2CC$Q2, 3, X$Q2, 2, 0, beta2Load, 0, 2, Type Resistor, Value RL, Pattern Impedance

During subcircuit expansion, the model parameters have now been replaced by the values from thetop-level netlist. As we did not assign a value to the base resistor of Q2, the automatic instantiationmechanism has created the symbol RB$Q2 in order to provide a default value for RB.

2.3.6 The Scope Argument

Local and Global Subcircuit Definitions

In all the preceding examples, the top-level netlist is immediately followed by the definitions ofthe subcircuits referenced from within the netlist. These subcircuit definitions are local and volatilebecause they are neither visible outside the scope of the enclosing Circuit statement nor do they"survive" subcircuit expansion. When doing multiple circuit analyses with a number of frequentlyused device models it would be rather tedious if we always had to include all potentially selectedmodels in the circuit description together with the top-level netlist. Therefore, we have the option tomake any subcircuit definition permanent and accessible from within other netlists by providing an

Page 64: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

62 2. Tutorial

appropriate Scope argument (see Section 3.2.1). Scope has two possible values, Local and Global.To make a subcircuit available globally, we need to set the scope as follows:

Scope −> Global

By expanding a circuit which contains only model definitions with global scope we can imple-ment a globally accessible model library in our current Mathematica environment. For example,let’s set up a model library from the two NPN transistor models NPNTransistor/ACsimple andNPNTransistor/ACdynamic from Section 2.3.2 (see Figure 3.2).

In[19]:= Circuit[Model[

Name −> NPNTransistor,Selector −> ACsimple,Scope −> Global,Ports −> "B", "C", "E",Parameters −> RB, beta,Definition −>

Netlist[RB, "X", "E", RB,CC, "B", "X", "C", "E", beta

]],

Model[Name −> NPNTransistor,Selector −> ACdynamic,Scope −> Global,Ports −> "B", "C", "E",Parameters −> RB, CM, beta, RO,Definition −>

Netlist[RB, "X", "E", RB,CM, "B", "C", CM,CC, "B", "X", "C", "E", beta,RO, "C", "E", RO

]]

] // ExpandSubcircuits;

Both models are now stored in the global subcircuit database and can thus be referenced by anyother netlist. Note that simply defining the models is not sufficient for storing them in the globaldatabase – we have to call ExpandSubcircuits in order to store them into the global database.If the Circuit object contains a top-level Netlist, a call to CircuitEquations stores the mod-els in the global database, too. We can check the contents of the database using the commandGlobalSubcircuits (Section 3.3.4), which will return a list of the names and selectors of the globalsubcircuits.

In[20]:= GlobalSubcircuits[]

Out[20]=NPNTransistor, ACdynamic, NPNTransistor, ACsimple

Page 65: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.3 Circuits and Subcircuits 63

The global definition of the transistor models allows us to write the circuit description of the Dar-lington amplifier from Section 2.3.5 (see Figure 3.3) without the Model commands. Then, duringsubcircuit expansion, the global database will be searched for models which are not defined locally.

In[21]:= darlWithoutModels =Circuit[

Netlist[I1, 0, 1, 1,Q1, 1 −> "B", 2 −> "C", 3 −> "E",

Model −> NPNTransistor, Selector −> ACsimple,RB −> RB1, beta −> 150,

Q2, 3 −> "B", 2 −> "C", 0 −> "E",Model −> NPNTransistor, Selector −> ACsimple,beta −> beta2,

Load, 0, 2, Type −> Resistor, Value −> RL,Pattern −> Impedance

]];

In[22]:= ExpandSubcircuits[darlWithoutModels] // DisplayForm

Out[22]//DisplayForm=Netlist Flat, 6 Entries:

I1, 0, 1, 1RB$Q1, X$Q1, 3, RB1CC$Q1, 1, X$Q1, 2, 3, 150RB$Q2, X$Q2, 0, RB$Q2CC$Q2, 3, X$Q2, 2, 0, beta2Load, 0, 2, Type Resistor, Value RL, Pattern Impedance

Redefining and Removing Global Subcircuits

If ExpandSubcircuits or CircuitEquations is called on a Circuit object containing a global modeldefinition, any previously stored model in the global database with the same Name and Selectorarguments is replaced by the new one. To remove a particular subcircuit from the global databasewe can use the command RemoveSubcircuit (Section 3.3.8). Its arguments must be the name andthe selector of the subcircuit definition to be deleted. The return value is a list of the names andselectors of the remaining subcircuit definitions. For example, let’s remove the transistor modelNPNTransistor/ACdynamic. The only remaining model is then NPNTransistor/ACsimple:

In[23]:= RemoveSubcircuit[NPNTransistor, ACdynamic]

Out[23]= NPNTransistor, ACsimple

Locally Overriding Global Subcircuit Definitions

One further application of the Scope argument is that we can locally override a global subcircuitdefinition. Local subcircuits always take precedence over global definitions with the same name andselector without overwriting the global definition. To illustrate this, let’s temporarily replace theNPNTransistor/ACsimple model with the subcircuit shown in Figure 3.4. The difference betweenthe original implementation of NPNTransistor/ACsimple and this model is that the latter contains a

Page 66: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

64 2. Tutorial

voltage-controlled current source VCCS (Section 4.2.13) instead of a current-controlled current sourceCCCS (Section 4.2.11).

B C

EE

RB

gm*VBE

Figure 3.4: Transistor model with voltage-controlled current source

Although the global subcircuit database still contains a definition of NPNTransistor/ACsimple wecan safely use the same name and selector for a local subcircuit without changing the global defi-nition, provided we specify Scope −> Local. Upon subcircuit expansion, Analog Insydes first looksfor a local subcircuit with the requested name and selector. The global definition is retrieved only ifno matching local definition is present.

In[24]:= darlWithLocalModel =Circuit[

Netlist[I1, 0, 1, 1,Q1, 1 −> "B", 2 −> "C", 3 −> "E",

Model −> NPNTransistor, Selector −> ACsimple,Q2, 3 −> "B", 2 −> "C", 0 −> "E",

Model −> NPNTransistor, Selector −> ACsimple,Load, 0, 2, Type −> Resistor, Value −> RL,

Pattern −> Impedance],

Model[Name −> NPNTransistor,Selector −> ACsimple,Scope −> Local,Ports −> "B", "C", "E",Parameters −> RB, gm,Definition −>

Netlist[RB, "B", "E", RB,VC, "B", "E", "C", "E", gm

]]

];

Now, ExpandSubcircuits will use the local definition of NPNTransistor/ACsimple . The globaldefinition has not been altered, as we can see by expanding the netlist of the Darlington amplifierfrom Section 2.3.5 (see Figure 3.3) without models again.

Page 67: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.3 Circuits and Subcircuits 65

In[25]:= ExpandSubcircuits[darlWithLocalModel] // DisplayForm

Out[25]//DisplayForm=Netlist Flat, 6 Entries:

I1, 0, 1, 1RB$Q1, 1, 3, RB$Q1VC$Q1, 1, 3, 2, 3, gm$Q1RB$Q2, 3, 0, RB$Q2VC$Q2, 3, 0, 2, 0, gm$Q2Load, 0, 2, Type Resistor, Value RL, Pattern Impedance

In[26]:= ExpandSubcircuits[darlWithoutModels] // DisplayForm

Out[26]//DisplayForm=Netlist Flat, 6 Entries:

I1, 0, 1, 1RB$Q1, X$Q1, 3, RB1CC$Q1, 1, X$Q1, 2, 3, 150RB$Q2, X$Q2, 0, RB$Q2CC$Q2, 3, X$Q2, 2, 0, beta2Load, 0, 2, Type Resistor, Value RL, Pattern Impedance

2.3.7 The Translation Argument

Implicit Translation of Parameter Values

Another argument of the Model function which remains to be discussed is the Translation key-word. We can use it to define functional relations between formal subcircuit parameters and internalelement values when there is no one-to-one correspondence between both. The syntax is:

Translation −> symbol1 −> value1, symbol2 −> value2,

The purpose of the Translation argument is best explained by an example. Assume that we wishto analyze the Darlington amplifier from Section 2.3.5 (see Figure 3.3) using the VCCS transistormodel from Section 2.3.6 (see Figure 3.4) instead of a CCCS model. For nodal analysis, the former isusually a better choice than the latter because the VCCS model does not increase the matrix size byintroducing additional controlling currents into the modified nodal equations. However, even witha VCCS model we might like to describe the transistors in terms of their current gains beta insteadof their transconductances gm by making use of the well-known relation gm = beta/RB. With thehelp of the Translation argument we can define a translation rule which maps the formal modelparameters RB and beta to the transconductance gm used internally as the element value of theVCCS:

Page 68: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

66 2. Tutorial

In[27]:= Circuit[Model[

Name −> NPNTransistor,Selector −> ACgm,Scope −> Global,Ports −> "B", "C", "E",Parameters −> RB, beta,Translation −> gm −> beta / RB,Definition −>

Netlist[RB, "B", "E", RB,VC, "B", "E", "C", "E", gm

]]

] // ExpandSubcircuits;

In[28]:= darlNumParams =Circuit[

Netlist[I1, 0, 1, 1,Q1, 1 −> "B", 2 −> "C", 3 −> "E",

Model −> NPNTransistor, Selector −> ACgm,RB −> 400.0, beta −> 150.0,

Q2, 3 −> "B", 2 −> "C", 0 −> "E",Model −> NPNTransistor, Selector −> ACgm,RB −> 100.0, beta −> 50.0,

Load, 0, 2, Type −> Resistor, Value −> RL,Pattern −> Impedance

]];

Just before subcircuit expansion the right-hand sides of the translation rules are evaluated with theparameter values specified in the value fields of the subcircuit references. The evaluated parametertranslation rules are then applied to all value fields in the subcircuit netlist, resulting in the replace-ment of all symbols appearing on the left-hand side of the translations. Thus, gm is automaticallycalculated from RB and beta.

In[29]:= ExpandSubcircuits[darlNumParams] // DisplayForm

Out[29]//DisplayForm=Netlist Flat, 6 Entries:

I1, 0, 1, 1RB$Q1, 1, 3, 400.VC$Q1, 1, 3, 2, 3, 0.375RB$Q2, 3, 0, 100.VC$Q2, 3, 0, 2, 0, 0.5Load, 0, 2, Type Resistor, Value RL, Pattern Impedance

Delayed Translation Rules

In this simple example, using the Translation argument is not absolutely necessary. We could haveachieved the same effect without a translation rule by writing the netlist entry for the VCCS likethis:

Page 69: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.3 Circuits and Subcircuits 67

VC, "B", "E", "C", "E", beta / RB

So why should we use translation rules at all? The answer is that parameter value translations canalso be specified by means of delayed rules, i.e. the RuleDelayed lhs :> rhs instead of the Rulelhs −> rhs. Since delayed rules are left unevaluated until the very moment they are needed, theirright-hand sides also contain calls to external functions which perform calculations depending onthe model parameter values. For instance, let’s define a function which, given values for beta andRB, calculates the transconductance of a transistor by solving the formula gm RB beta numericallyfor gm, using gm as initial guess.

In[30]:= Transconductance[b_Real, r_Real] :=Module[ g,

Print["Computing gm for beta = ", b, " and RB = ", r];g /. FindRoot[g * r == b, g, 1.0]

]

By means of a delayed translation rule for gm we can instruct Mathematica not to execute the functioncall at the time the transistor model is defined but to wait until the rule is used to compute gm for aparticular subcircuit instance.

In[31]:= Circuit[Model[

Name −> NPNTransistor,Selector −> ACgm,Scope −> Global,Ports −> "B", "C", "E",Parameters −> RB, beta,Translation −> gm :> Transconductance[beta, RB],Definition −>

Netlist[RB, "B", "E", RB,VC, "B", "E", "C", "E", gm

]]

] // ExpandSubcircuits;

If we had used an immediate rule above, gm −> Transconductance[beta, RB], Mathematica wouldhave already called Transconductance with the symbolic arguments beta and RB at the time ofmodel definition. On the other hand, the delayed rule permits Analog Insydes to replace the argu-ments with instance-specific values before making the function call. This is done once per subcircuitinstance as can be seen from the following output:

In[32]:= ExpandSubcircuits[darlNumParams] // DisplayForm

Computing gm for beta = 150. and RB = 400.

Computing gm for beta = 50. and RB = 100.

Out[32]//DisplayForm=Netlist Flat, 6 Entries:

I1, 0, 1, 1RB$Q1, 1, 3, 400.VC$Q1, 1, 3, 2, 3, 0.375RB$Q2, 3, 0, 100.VC$Q2, 3, 0, 2, 0, 0.5Load, 0, 2, Type Resistor, Value RL, Pattern Impedance

Page 70: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

68 2. Tutorial

An advanced application of such a parameter translation scheme would be the calculation of transistor small-signal parameters from given operating-point voltages and currents via a set of predefined device equations.

Alternative Ways to Assign Values to Parameters

In combination with the Parameters setting there is one further useful application of the argumentTranslation. Specifying a translation rule for a symbol which is also designated as a parameter ofthe same subcircuit definition allows us to choose whether we let the instance value of the symbol becalculated from other parameters or whether we assign a value to this symbol directly. For example,let’s add the transconductance gm to the list of model parameters while leaving the translation rulefor gm unchanged:

Parameters −> RB, beta, gm,Translation −> gm :> Transconductance[beta, RB],

The value field of a reference to the transistor model can now be written in two alternative ways.Just as in the previous subsection we can assign values to RB and beta only and let Analog Insydescalculate gm from the two quantities automatically. Alternatively, we can bypass the translation ruleby directly assigning a value to gm, such as gm −> 0.5. Any value given for beta is then effectivelyignored because it is not needed anywhere else than in the argument list of the translation rule. Inthe netlist below, we let gm$Q1 be computed from RB and beta by means of the translation rule. Inthe case of Q2, however, we do not specify a value for beta but make a direct assignment to gm:gm −> gm2. Therefore, the parameter translation function Transconductance is not called for gm$Q2:

Page 71: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.3 Circuits and Subcircuits 69

In[33]:= Circuit[Netlist[

I1, 0, 1, 1,Q1, 1 −> "B", 2 −> "C", 3 −> "E",

Model −> NPNTransistor, Selector −> ACgm,RB −> 400.0, beta −> 150.0,

Q2, 3 −> "B", 2 −> "C", 0 −> "E",Model −> NPNTransistor, Selector −> ACgm,RB −> 100.0, gm −> gm2,

Load, 0, 2, Type −> Resistor, Value −> RL,Pattern −> Impedance

],

Model[Name −> NPNTransistor,Selector −> ACgm,Scope −> Global,Ports −> "B", "C", "E",Parameters −> RB, beta, gm,Translation −> gm :> Transconductance[beta, RB],Definition −>

Netlist[RB, "B", "E", RB,VC, "B", "E", "C", "E", gm

]]

] // ExpandSubcircuits // DisplayForm

Computing gm for beta = 150. and RB = 400.

Out[33]//DisplayForm=Netlist Flat, 6 Entries:

I1, 0, 1, 1RB$Q1, 1, 3, 400.VC$Q1, 1, 3, 2, 3, 0.375RB$Q2, 3, 0, 100.VC$Q2, 3, 0, 2, 0, gm2Load, 0, 2, Type Resistor, Value RL, Pattern Impedance

Page 72: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

70 2. Tutorial

2.4 Setting up and Solving Circuit Equations

2.4.1 Naming Conventions

Automatically Generated Voltage and Current Identifiers

From the small circuit analysis examples already presented in the previous chapters you will havenoticed that Analog Insydes automatically creates variables for voltages and currents when settingup circuit equations from a netlist. In order to interpret the equations correctly you need to knoweverything about the identifier naming scheme employed by Analog Insydes.

By default, identifiers for branch voltages and currents associated with two-terminal elements aregenerated by attaching the prefixes V$ and I$ to the reference designator (Section 3.1.3) of the cor-responding circuit element, respectively. For instance, the branch voltage across and branch currentthrough a resistor R1 would be named V$R1 and I$R1.

Similarly, identifiers for node voltages are generated by prefixing the node names with the tag V$,so the node voltage at node 1 would be named V$1. Although the prefix is used for branch voltagesyou will not experience any name clashes among branch and node voltage identifiers, provided thatyour netlists do not contain any symbolic node identifiers (Section 3.1.3) which are identical to somereference designators. However, if you would rather like different prefixes to be used for branchand node voltages then read the following sections to learn how to change the standard settings.

In the case of a controlled source we need to distinguish between the voltages and currents at thecontrolling and at the controlled branch. While the latter quantities are given names according to thesame convention as applied to two-terminal elements, controlling voltages and currents are markedwith the prefixes VC$ and IC$. For example, the voltage across and current through the controlledbranch of a controlled source VC1 would be called V$VC1 and I$VC1 whereas the correspondingquantities at the controlling branch would be called VC$VC1 and IC$VC1.

Changing the Default Identifier Prefixes

All identifier prefix settings can be customized by changing the corresponding option. The currentoption settings can be displayed using the command Options[CircuitEquations] and can bechanged using the Mathematica command SetOptions. For instance, the command

SetOptions[CircuitEquations, BranchVoltagePrefix −> "E$"]

would change the prefix used for branch voltages from V$ to E$. The names of the prefix optionsand their default settings are listed below.

NodeVoltagePrefix −> "V$"BranchVoltagePrefix −> "V$"BranchCurrentPrefix −> "I$"ControllingVoltagePrefix −> "VC$"ControllingCurrentPrefix −> "IC$"

Page 73: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.4 Setting up and Solving Circuit Equations 71

The values of all these options must be strings which can be converted to a single symbol by meansof the command ToExpression. Strings such as "V_" or "@I" cannot be converted to valid symbolsand may therefore not be used for this purpose.

Changing the Instance Name Separator for Reference Designators

Related to the identifier prefix options is the option InstanceNameSeparator (Section 3.14.2). Thisoption determines the character (or string) which Analog Insydes uses to separate name componentsof reference designators generated for instantiated subcircuit elements. With the default setting

InstanceNameSeparator −> "$"

a resistor RB in a subcircuit instance Q1 would be named RB$Q1. Using SetOptions you can changethe separator character to (almost) anything you like, with the same restrictions that apply to thechoice of the prefix options.

2.4.2 Circuit Equations

The Command CircuitEquations

Setting up systems of symbolic circuit equations is done by the Analog Insydes commandCircuitEquations (Section 3.5.1), which takes a Netlist or Circuit object as first argument. Inaddition, the function may be called with a variety of options – to be introduced later – with whichmany aspects of equation setup can be influenced individually:

CircuitEquations[circuit, options]

If the type of the netlist argument is not a flat netlist, then the function ExpandSubcircuits (Sec-tion 3.4.1) is automatically applied to the circuit description in order to produce a flat netlist objectbefore proceeding with equation setup.

This section describes how to set up equations of linear circuits in the Laplace domain.CircuitEquations can also be used to set up DC or transient equations for nonlinear circuits. Thistopic is discussed in Section 2.6.4.

C1

2

RB

1

V0

3

C2

RA L1

Figure 4.1: RLC filter circuit

Page 74: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

72 2. Tutorial

To illustrate equation setup let’s write down the netlist of the RLC filter circuit displayed in Figure 4.1.

In[1]:= <<AnalogInsydes‘

In[2]:= rlcfilter =Netlist[

V0, 1, 0, V0,RA, 1, 2, RA,C1, 2, 0, C1,L1, 2, 3, L1,C2, 3, 0, C2,RB, 3, 0, RB

]

Out[2]= NetlistRaw, 6

By default, CircuitEquations sets up a system of modified nodal (MNA) equations in the fre-quency domain, or, more precisely, the Laplace domain. In the Laplace domain, all linear dynamicelements are described by frequency-dependent complex admittances or impedances, obtained byLaplace-transforming the corresponding constitutive equations. For instance, a linear capacitance Cwith a constitutive equation it C dutdt is represented by its complex admittance s C, where sdenotes the complex Laplace frequency.

Unless specified otherwise (see netlist option Pattern in Section 3.1.4), all impedances, i.e. resistorsand inductors, are automatically converted to their admittance equivalents. Therefore, the compleximpedance s L of an inductor L will be treated as an admittance with the reciprocal value s L.

In[3]:= rlceqs = CircuitEquations[rlcfilter]

Out[3]= DAEAC, 44

The return value of CircuitEquations is a DAEObject which contains the three components ofthe linear matrix equation A x b, where A is the MNA matrix, x the vector of unknown nodevoltages and impedance branch currents, and b the vector of independent source voltages and sourcecurrents. To display the system of equations in a more readable form we can apply the commandDisplayForm to the DAEObject rlceqs:

In[4]:= DisplayForm[rlceqs]

Out[4]//DisplayForm=

1RA 1RA 0 1

1RA1RA 1L1 s C1 s 1L1 s 0

0 1L1 s1RB 1L1 s C2 s 0

1 0 0 0

.

V$1V$2V$3I$V0

000V0

Solving Circuit Equations

Systems of circuit equations generated by Analog Insydes can be solved symbolically by means ofthe command Solve (Section 3.5.4). The sequence of arguments may have one of the following threeforms, depending on which variable or set of variables the equations should be solved for:

Solve[dae]Solve[dae, var]Solve[dae, var, var, ]

Page 75: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.4 Setting up and Solving Circuit Equations 73

If Solve is called with a DAEObject only and no second argument is given then the solutions forall variables contained in the vector x are computed. If, in addition to the DAEObject, one singlevariable of x is specified as second argument then only this variable is solved for. To compute thesolutions for a subset of x containing more than only one variable, the second argument must be alist of the variables of interest.

Solve finds all solutions of an equation system only for linear equations. For nonlinear (dynamic)equations it is in general not possible to find symbolic solutions. Thus, Analog Insydes provides thecommand NDAESolve (Section 3.7.5) to compute the solution of nonlinear DAE systems numerically.See Chapter 2.7 for details.

Just like Mathematica’s built-in Solve function, Solve[dae] returns a list of rulesvar −> solution, † † † which associate the variables with the corresponding solutions. Individualsolutions can be extracted from the list by using Mathematica’s ReplaceAll operator (or /. in shortnotation).

Let’s solve the MNA equations of the RLC filter for the node voltages at nodes 1 and 3. Since weare only interested in solving for two out of all four variables, we must use the third calling format:

In[5]:= rlcsol = Solve[rlceqs, V$1, V$3]

Out[5]=V$3 RB V0 RA RB L1 s C1 RA RB s

C2 RA RB s C1 L1 RA s2 C2 L1 RB s2 C1 C2 L1 RA RB s3,V$1 V0

As indicated above, we can retrieve the solution for a particular variable using the /.-operator. Thefollowing input line serves to extract the value of V$3. The Mathematica command First removes theouter level of list brackets from the set of solutions, so the result is returned as a single expressionand not as a list.

In[6]:= rlcv3 = V$3 /. First[rlcsol]

Out[6]=RB V0 RA RB L1 s C1 RA RB s C2 RA RB s C1 L1 RA s2

C2 L1 RB s2 C1 C2 L1 RA RB s3

Quite frequently, the raw solutions computed from symbolic circuit equations are not presented inan immediately comprehensible form. It usually takes some additional mathematical postprocessingto transform the results into something which is easier to read or technically more meaningful.Mathematica provides several commands for rearranging expressions, such as Simplify, Factor,Together, Apart, or Collect. The choice of which function to use depends heavily on the particu-lar application, and often some experimenting is required until the results are satisfactory.

For example, in the case of the above expression for V$3, we may want to combine all coefficientsbelonging to the same power of s into one single coefficient each. For this purpose, we apply arewrite rule to all Plus subexpressions (i.e. sums) which groups the terms by corresponding powersof s and then pulls out the si. This yields a transfer function with coefficients in the canonicalsum-of-products form.

Page 76: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

74 2. Tutorial

In[7]:= rlcv3 /. p_Plus :> Collect[p, s]

Out[7]=RB V0 RA RB L1 C1 RA RB C2 RA RB s C1 L1 RA C2 L1 RB s2

C1 C2 L1 RA RB s3

2.4.3 Circuit Equation Formulations

Modified Nodal Analysis

The modified nodal analysis method (MNA) has already been introduced as the default formula-tion by which Analog Insydes sets up circuit equations. The MNA formulation is general, yieldsrelatively compact systems of equations, and is easy to implement on a computer. These and a fewother favorable properties have made it the most widely used analysis method in electrical circuitsimulators, including Analog Insydes.

There are a number of user-settable options which have an influence on the way Analog Insydessets up MNA equations. You have already encountered the netlist option Pattern which specifiesexplicitly whether to use the impedance or admittance fill-in pattern for an immittance element, i.e.a two-terminal admittance or impedance. This option allows, for instance, to prevent the implicitconversion of an impedance to an admittance, thereby augmenting the MNA system by the branchcurrent of the impedance. However, the Pattern option pertains only to the element in whosevalue field it is given. To prevent implicit impedance conversion globally you can set the valueof the CircuitEquations option ConvertImmittances to False, either permanently by modifyingOptions[CircuitEquations] using the SetOptions directive, or temporarily by passing the optionConvertImmittances −> False to the function CircuitEquations:

In[8]:= CircuitEquations[rlcfilter,ConvertImmittances −> False] // DisplayForm

Out[8]//DisplayForm=

0 0 0 1 1 0 00 C1 s 0 0 1 1 00 0 C2 s 0 0 1 11 0 0 0 0 0 0

1 1 0 0 RA 0 00 1 1 0 0 L1 s 00 0 1 0 0 0 RB

.

V$1V$2V$3I$V0I$RAI$L1I$RB

000V0000

The Formulation Option

With modified nodal analysis being the default analysis method there is usually no need to requestthis formulation explicitly. However, if you have changed the default settings inOptions[CircuitEquations] or if you wish to use one of the analysis methods to be discussed inthe following subsections you need to specify the formulation as an option to CircuitEquations.The option keyword is Formulation, and the option value can be eitherModifiedNodal, SparseTableau, or ExtendedTableau. Hence, modified nodal analysis can be ex-plicitly selected by this command:

Page 77: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.4 Setting up and Solving Circuit Equations 75

In[9]:= CircuitEquations[rlcfilter,Formulation −> ModifiedNodal] // DisplayForm

Out[9]//DisplayForm=

1RA 1RA 0 1

1RA1RA 1L1 s C1 s 1L1 s 0

0 1L1 s1RB 1L1 s C2 s 0

1 0 0 0

.

V$1V$2V$3I$V0

000V0

Sparse Tableau Analysis: The Basic Formulation

In addition to nodal analysis, Analog Insydes also offers the possibility to set up circuit equationsaccording to two variants of the sparse tableau formulation (STA). For an electrical network contain-ing n electrical branches, the basic variant of the sparse tableau comprises the n topological nodeand loop equations resulting from Kirchhoff’s voltage law (KVL) and current law (KCL), plus the nvoltage-current relations of the circuit elements. Hence, the basic sparse tableau forms the followingn n matrix equation in terms of the branch voltages v and the branch currents i.

B 00 AY Z

v

i

00s

Here, A denotes the nodal incidence matrix of the network graph and B a loop incidence matrix ofmaximum rank. B is derived automatically from A by an algorithm which searches for a tree in thenetwork graph and then extracts the fundamental loop matrix defined by that tree. The matrices Yand Z in the third row of the tableau represent the coefficient matrices of the element relations. Onthe right-hand side, s denotes the contribution of the independent sources. All remaining tableauentries are structurally zero (0).

Page 78: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

76 2. Tutorial

In[10]:= CircuitEquations[rlcfilter,Formulation −> SparseTableau] // DisplayForm

Out[10]//DisplayForm=

1 1 1 0 0 0 0 0 0 0 0 01 1 0 1 1 0 0 0 0 0 0 01 1 0 1 0 1 0 0 0 0 0 00 0 0 0 0 0 1 1 0 0 0 00 0 0 0 0 0 0 1 1 1 0 00 0 0 0 0 0 0 0 0 1 1 11 0 0 0 0 0 0 0 0 0 0 00 1 0 0 0 0 0 RA 0 0 0 00 0 C1 s 0 0 0 0 0 1 0 0 00 0 0 1 0 0 0 0 0 L1 s 0 00 0 0 0 C2 s 0 0 0 0 0 1 00 0 0 0 0 1 0 0 0 0 0 RB

.

V$V0V$RAV$C1V$L1V$C2V$RBI$V0I$RAI$C1I$L1I$C2I$RB

000000V000000

Sparse Tableau Analysis: The Extended Formulation

Analog Insydes also supports an extended sparse tableau formulation in which the vector of un-knowns comprises the branch voltages v, the branch currents i, and the node voltages vn. WithI denoting an identity matrix of rank n and AT the transpose of the nodal incidence matrix A,Kirchhoff’s voltage law is expressed indirectly in terms of the node voltages as I v AT vn 0.Therefore, the extended sparse tableau formulation does not require the calculation of a loop matrix,though at the expense of a larger matrix size than that of the basic variant:

I 0 AT

0 A 0Y Z 0

vI

vn

00s

The extended variant is selected by the option setting Formulation −> ExtendedTableau:

Page 79: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.4 Setting up and Solving Circuit Equations 77

In[11]:= rlcstaext = CircuitEquations[rlcfilter,Formulation −> ExtendedTableau];

DisplayForm[rlcstaext]

Out[12]//DisplayForm=

1 0 0 0 0 0 0 0 0 0 0 0 1 0 00 1 0 0 0 0 0 0 0 0 0 0 1 1 00 0 1 0 0 0 0 0 0 0 0 0 0 1 00 0 0 1 0 0 0 0 0 0 0 0 0 1 10 0 0 0 1 0 0 0 0 0 0 0 0 0 10 0 0 0 0 1 0 0 0 0 0 0 0 0 10 0 0 0 0 0 1 1 0 0 0 0 0 0 00 0 0 0 0 0 0 1 1 1 0 0 0 0 00 0 0 0 0 0 0 0 0 1 1 1 0 0 01 0 0 0 0 0 0 0 0 0 0 0 0 0 00 1 0 0 0 0 0 RA 0 0 0 0 0 0 00 0 C1 s 0 0 0 0 0 1 0 0 0 0 0 00 0 0 1 0 0 0 0 0 L1 s 0 0 0 0 00 0 0 0 C2 s 0 0 0 0 0 1 0 0 0 00 0 0 0 0 1 0 0 0 0 0 RB 0 0 0

.

V$V0V$RAV$C1V$L1V$C2V$RBI$V0I$RAI$C1I$L1I$C2I$RBV$1V$2V$3

000000000V000000

Of course, the solution for a particular quantity in a circuit does not depend on the type of equationsfrom which the solution is computed. So the value for V$3 obtained by an extended sparse tableauanalysis is identical to the one computed by modified nodal analysis:

In[13]:= V$3 /. First[Solve[rlcstaext, V$3]]

Out[13]=

L1 RB s V0

RA RB RA L1 s 1 C1 RA s RB L1 s 1 C2 RB s

Page 80: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

78 2. Tutorial

2.4.4 Additional Options for CircuitEquations

All Analog Insydes options which have an influence on circuit equation setup by the functionCircuitEquations can be accessed through Options[CircuitEquations]. The current option set-tings can be inspected by retrieving the value of this variable:

In[14]:= Options[CircuitEquations]

Out[14]=AnalysisMode AC, BranchCurrentPrefix I$,BranchVoltagePrefix V$, ControllingCurrentPrefix IC$,ControllingVoltagePrefix VC$, ConvertImmittances True,DefaultSelector Automatic, DesignPoint Automatic,ElementValues Value, Formulation ModifiedNodal,FrequencyVariable s, IgnoreMissingGround False,IndependentVariable Automatic, InitialConditions None,InitialGuess Automatic, InitialTime 0,InstanceNameSeparator InheritedAnalogInsydes,LibraryPath InheritedAnalogInsydes, MatrixEquation True,ModelLibrary InheritedAnalogInsydes, ModeValues None,NodeVoltagePrefix V$, Protocol InheritedAnalogInsydes,Symbolic All, TimeVariable t, Value None

Some of these options are discussed in more detail below.

AnalysisMode

CircuitEquations sets up circuit equations for the analysis modes AC, DC, and transient. Whichmode to use is determined by the option AnalysisMode, whose value is one of the symbols AC, DC,and Transient. The default value is AC. Up to now, we used CircuitEquations to create small-signal equations. Section 2.6.4 describes how to set up DC equations and Section 2.7.1 describes howto set up transient equations.

MatrixEquation

Using the option MatrixEquation −> False, we can force CircuitEquations not to use a matrixrepresentation when setting up small-signal circuit equations but to return a list of scalar equationsinstead.

In[15]:= CircuitEquations[rlcfilter,MatrixEquation −> False] // DisplayForm

Out[15]//DisplayForm=

I$V0 V$1 V$2

RA 0, C1 s V$2

V$1 V$2

RAV$2 V$3

L1 s 0,

V$3RB

C2 s V$3 V$2 V$3

L1 s 0, V$1 V0,

V$1, V$2, V$3, I$V0, DesignPoint

When the matrix representation is turned off, the value returned by CircuitEquations is a DAEOb-ject containing the circuit equations as a list of two elements, the first being the system of circuitequations and the second the vector of unknowns. The advantage of the scalar representation is thatit consumes less memory than the matrix representation because Mathematica does not have a special

Page 81: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.4 Setting up and Solving Circuit Equations 79

storage mechanism for sparse matrices. Nevertheless, some commands (e.g. ACAnalysis) rely on thefact that the equation system is formulated in matrix representation.

FrequencyVariable

The option FrequencyVariable −> symbol specifies the symbol which Analog Insydes uses to denotethe differential operator, i.e. the complex frequency, in the Laplace domain. By default, this is thesymbol s, but if you prefer to use another symbol for this purpose, for instance p, you can replaces by p as follows:

In[16]:= CircuitEquations[rlcfilter,FrequencyVariable −> p] // DisplayForm

Out[16]//DisplayForm=

1RA 1RA 0 1

1RA1L1 p C1 p 1RA 1L1 p 0

0 1L1 p1L1 p C2 p 1RB 0

1 0 0 0

.

V$1V$2V$3I$V0

000V0

ElementValues

With ElementValues −> Symbolic we can instruct CircuitEquations to use the symbolic valuesfrom the value fields of netlist entries in which a Symbolic option is given. To demonstrate the effectof this option let’s make some enhancements to the netlist of the RLC filter circuit from Section 2.4.2(see Figure 4.1). Using the extended value-field format (see Section 3.1.4) we specify a numerical aswell as a symbolic value for the circuit elements.

In[17]:= rlcfilter2 =Netlist[

V0, 1, 0, Value −> V0, Symbolic −> V0,RA, 1, 2, Value −> 1000., Symbolic −> RA,C1, 2, 0, Value −> 4.7*10^−6, Symbolic −> C1,L1, 2, 3, Value −> 1.0*10^−3, Symbolic −> L1,C2, 3, 0, Value −> 2.2*10^−5, Symbolic −> C2,RB, 3, 0, Value −> 1000., Symbolic −> RB

];

Note that the value of the Symbolic option needs not to coincide with the reference designatoras this is the case in the example above. You can use any Mathematica expression as value to theSymbolic field.

A call to CircuitEquations without any additional options (i.e. the default value of theElementValues option is used, which is Value) will then cause the numerical values to be enteredinto the matrix as these are given as arguments to the Value rules.

Page 82: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

80 2. Tutorial

In[18]:= rlc2eqs = CircuitEquations[rlcfilter2];DisplayForm[rlc2eqs]

Out[19]//DisplayForm=

0.001 0.001 0 1

0.001 0.001 1000.s 4.7106 s 1000.s 0

0 1000.s 0.001 1000.s 0.000022 s 0

1 0 0 0

.

V$1V$2V$3I$V0

000V0

Alternatively, we can select the symbolic values by means of the option ElementValues −> Symbolic.Note that ElementValues affects only those netlist entries in whose value field a Symbolic rule ispresent.

In[20]:= rlc2eqs2 = CircuitEquations[rlcfilter2,ElementValues −> Symbolic];

DisplayForm[rlc2eqs2]

Out[21]//DisplayForm=

1RA 1RA 0 1

1RA1RA 1L1 s C1 s 1L1 s 0

0 1L1 s1RB 1L1 s C2 s 0

1 0 0 0

.

V$1V$2V$3I$V0

000V0

Page 83: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.5 Graphics 81

2.5 Graphics

Mathematica has proven to be a powerful problem-solving environment for a large variety of engi-neering tasks. One of many reasons which make Mathematica such a useful tool is that it providesexcellent support for visualizing the results of technical computations. Due to its freely programmablegraphics functionality the flexibility of adapting the graphics display to individual applications isvirtually unlimited. Analog Insydes extends Mathematica’s basic graphic capabilities by adding spe-cial plotting functions for circuit analysis and design, including Bode, Nyquist, Nichol, root locusplots, and transient waveforms.

2.5.1 Bode Plots

The Bode plot is perhaps the most commonly used graphing scheme for visualizing frequency re-sponses of linear analog systems. It consists of two separate charts which display magnitude andphase of a transfer function on a logarithmic and a linear scale vs. frequency, the latter being scaledlogarithmically. The magnitude values are usually given in decibels (dB) and the phase values indegrees.

In Analog Insydes, Bode plots are displayed using the command BodePlot (Section 3.9.1). With thebasic syntax

BodePlot[tfunc, frange]

you can plot the transfer function tfunc within the frequency range frange. The transfer functionmust be a complex-valued function of the frequency variable fvar, and the frequency range a list ofthe form fvar, fstart, fend. BodePlot also allows to plot several transfer functions simultaneously.For this purpose, the first argument of BodePlot must be specified as a list of transfer functions.

BodePlot[tfunc, tfunc, , frange]

To demonstrate the Bode plot facility we define the following transfer function in terms of thefrequency variable s.

In[1]:= <<AnalogInsydes‘

In[2]:= H1[s_] := 1000./(1. + 10.1*s + s^2)

We then display a Bode plot of the frequency response by evaluating H1 along the imaginary axis,s I Ω, for a frequency range of sec to sec.

Page 84: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

82 2. Tutorial

In[3]:= BodePlot[H1[I w], w, 0.001, 1000.]

1.0E-3 1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2 1.0E3Frequency

-60

-40

-20

0

20

40

60

Magnitude (dB)

1.0E-3 1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2 1.0E3

1.0E-3 1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2 1.0E3Frequency

-175-150-125-100-75-50-250

Phase (deg)

1.0E-3 1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2 1.0E3

Out[3]= Graphics

BodePlot Options

The output generated by BodePlot is influenced by a number of options listed inOptions[BodePlot], many of which are inherited from Options[LogLinearListPlot] from Mathe-matica’s standard package Graphics‘Graphics‘. Here, we will discuss only some of those optionswhich pertain exclusively to BodePlot or which must be used with a different syntax as comparedto LogLinearListPlot. The relevant options and their default settings are listed below. Defaultsare listed first, followed by the possible alternatives printed in slanted typewriter font.

MagnitudeDisplay −> Decibels | AbsoluteValues | LinearPhaseDisplay −> Degrees | RadiansPlotRange −> Automatic, Automatic

The option MagnitudeDisplay controls the display of the magnitude values. When set toAbsoluteValues, magnitude values are not converted to decibels. Instead the absolute numericalvalues are displayed on a logarithmic scale. When MagnitudeDisplay is set to Linear, magnitudevalues are displayed on a linear scale. In a strict sense, the latter does no longer constitute a trueBode plot, but there exist a few applications where linear magnitude scaling is useful.

With the value of the option PhaseDisplay we can choose whether phase values are shown asdegrees or as radians.

The meaning of the PlotRange option is slightly different for BodePlot than for other Mathematicaplotting commands. Here, the value of PlotRange must be a list of two elements, rangem, rangep,specifying the plot ranges of the y-axes of the magnitude and the phase chart respectively. PlotRangehas no effect on the ranges of the x-axes as these are determined by the given frequency range. Theformat for both y-ranges is the usual one as documented in the Mathematica manual, so any of theforms below are valid syntax:

Page 85: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.5 Graphics 83

Automaticymin, ymaxymin, Automatic

Let’s graph H1 together with a second transfer function H2 and watch the effects of some BodePlotoptions. Other common graphics options such as PlotStyle can be applied just as usual.

In[4]:= H2[s_] := 100./(1.6 + 8.2*s + s^2)

In[5]:= BodePlot[H1[I w], H2[I w], w, 0.001, 1000.,PhaseDisplay −> Radians,PlotRange −> −60, 80, Automatic,PlotStyle −> RGBColor[0, 0, 1], Dashing[0.05],

RGBColor[0, 1, 0]]

1.0E-3 1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2 1.0E3Frequency

-40

-20

0

20

40

60

80

Magnitude (dB)

1.0E-3 1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2 1.0E3

1.0E-3 1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2 1.0E3Frequency

-3

-2.5

-2

-1.5

-1

-0.5

0

Phase (rad)

1.0E-3 1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2 1.0E3

Out[5]= Graphics

2.5.2 Nyquist Plots

Another widely used graphical representation of transfer functions is the Nyquist plot. It is a para-metric plot of the real and imaginary part of a transfer function in the complex plane as the frequencyparameter sweeps through a given interval. Nyquist plots are particularly useful for stability analysisin control system design because one can immediately check whether a negative feedback loop meetsNyquist’s stability criterion: If the Nyquist curve of the open loop system wraps around the point on the real axis then the corresponding closed loop system is unstable.

Nyquist plots are produced by the command NyquistPlot (Section 3.9.4) whose argument sequenceis the same as that of BodePlot (Section 3.9.1). Just as in the case of the latter you can plot onesingle transfer function or several transfer functions simultaneously.

Let’s make a Nyquist plot of the frequency response of a system which is formed by a series connec-tion of the two transfer functions H1 and H2, followed by a dB attenuator (dB ). Theoverall transfer function of the resulting system is given by the product of the individual transferfunctions.

Page 86: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

84 2. Tutorial

In[6]:= H12a[s_] := H1[s] * H2[s] * 0.002

To make the curve look smoother we increase the number of plot points to .

In[7]:= NyquistPlot[H12a[I w], w, 0.001, 1000.,PlotPoints −> 100]

20 40 60 80 100 120Re

-80

-60

-40

-20

Im

Out[7]= Graphics

We determine whether the corresponding closed-loop system is stable or unstable by taking a closerlook at the region around the point using the PlotRange option.

In[8]:= NyquistPlot[H12a[I w], w, 0.1, 1000.,PlotPoints −> 100, PlotRange −> −3, 1, −1, 1]

-3 -2.5 -2 -1.5 -1 -0.5 0.5 1Re

-1

-0.75

-0.5

-0.25

0.25

0.5

0.75

1Im

Out[8]= Graphics

This plot reveals that the point is located to the right of the Nyquist curve, i.e. the curvewraps around the critical point. Hence the closed-loop system is unstable.

Page 87: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.5 Graphics 85

NyquistPlot Options

NyquistPlot inherits its plot options, which are accessible throughOptions[NyquistPlot], from Mathematica’s standard function ListPlot. See the Mathematica bookfor detailed explanations of these options. NyquistPlot has additional options like, for exampleFrequencyScaling which controls the spacing of the frequency points at which the transfer functionis sampled. FrequencyScaling can be set to Linear or Exponential, resulting in equidistant orexponentially spaced sampling points respectively. The default is Exponential.

2.5.3 Nichol Plots

Yet another method of visualizing frequency responses is Nichol’s chart. A Nichol plot is similar toa Nyquist plot but shows gain on a logarithmic scale (dB) vs. phase on a linear scale (degrees), withan axis origin at the point dB . The advantage of Nichol’s chart is the ease by which gainand phase margins can be determined graphically. The gain margin is simply the negative value ofthe gain axis intersect. The phase margin is equal to the distance between the axis origin and thephase axis intersect.

Nichol charts are computed by the function NicholPlot (Section 3.9.3). The argument sequence isthe same as for NyquistPlot (Section 3.9.4) or BodePlot (Section 3.9.1).

Let’s use a Nichol chart to determine the gain and phase margins of a system which is characterizedby the following transfer function.

In[9]:= H3[s_] := 20*(3 + s)/(s*(5 + s)*(20 + 5*s + 2*s^2))

We draw a Nichol chart of H3[I w] for an angular frequency Ω varying from sec to sec.Again, we increase the number of plot points to produce a smooth curve.

In[10]:= NicholPlot[H3[I w], w, 0.1, 5.,AspectRatio −> 0.8, PlotPoints −> 100]

-360 -300 -240 -120 -60 0deg

-20

-15

-10

-5

5

10

15

dB

Out[10]= Graphics

Now, in order to read off the margins better, we zoom in on the part of the curve located in thefourth quadrant.

Page 88: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

86 2. Tutorial

In[11]:= NicholPlot[H3[I w], w, 0.1, 5., AspectRatio −> 0.8,PlotPoints −> 100, PlotRange −> −200, −80, −15, 2]

-150 -120 -90deg

-15

-12.5

-10

-7.5

-5

-2.5

dB

Out[11]= Graphics

The curve crosses the gain axis at a gain of dB, so we have a gain margin of dB. At thephase axis intersect we have a phase value of approximately which is away from the axisorigin. Hence, the phase margin is .

NicholPlot Options

Like NyquistPlot, NicholPlot inherits its options from ListPlot. NicholPlot has additional op-tions like, for example, PhaseDisplay (see Section 2.5.1) and FrequencyScaling (see Section 2.5.2).

2.5.4 Root Locus Plots

Let Hs k denote a rational transfer function whose coefficients depend on the real parameter k. Aroot locus plot shows the locus of the poles and zeros of Hs k in the complex plane as k varieswithin an interval k k.

To draw a root locus plot use the command RootLocusPlot (Section 3.9.5). The calling format is

RootLocusPlot[tfunc, k, k, k]

where tfunc is a transfer function in the frequency variable s and one real parameter k.

Of course, the parameter does not necessarily have to be named k. We can also use any other symbolto denote the parameter. Below, we define the transfer function H4[s, a] with coefficients which arefunctions of the parameter a.

In[12]:= H4[s_, a_] := (a + 2*s + s^2)/(10 + 3*a*s + 4*s^2 + s^3)

Then we graph the root locus of H4 as a varies from to . By default, RootLocusPlot samplesthe parameter interval at five equally spaced points. This number can be increased or decreased by

Page 89: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.5 Graphics 87

means of the PlotPoints option. The poles and zeros of the transfer function are displayed as redcrosses and green circles, respectively.

In[13]:= RootLocusPlot[H4[s, a], a, 3, 5]

a = 3.000e0 .. 5.000e0 (0% .. 100%)

Re s

Im s

2.0E0 -1. -0.5

-2.0E0

-1.

1.

2.0E0

100

0%Poles

100

0%Zeros

Out[13]= Graphics

RootLocusPlot Options

RootLocusPlot inherits its options from Graphics and adds its own options like PoleStyle andZeroStyle to Options[RootLocusPlot]. With these options you can customize the display of polesand zeros, e.g. for better black-and-white printouts. The syntax of the PoleStyle option is

PoleStyle −> mark[size, colorfunc, grstyle]

where mark specifies the marker symbol (e.g. CrossMark, PlusMark, CircleMark, SquareMark, andPointMark), size denotes the size of the marker in scaled coordinates, colorfunc is a pure function thatreturns a color value for an argument between and , and grstyle is a Mathematica graphics styleor a sequence of styles, such as Hue or Thickness. Note that everything mentioned above appliesto the ZeroStyle option as well.

In the following command line we instruct RootLocusPlot to modify the styles for the pole andzero markers:

Page 90: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

88 2. Tutorial

In[14]:= RootLocusPlot[H4[s, a],a, 3, 5,PoleStyle −> PlusMark[0.03, Hue[1−0.3*#] &,

Thickness[0.012]],ZeroStyle −> PointMark[0.03, Hue[0.5−0.3*#] &,

Thickness[0.005]]]

a = 3.000e0 .. 5.000e0 (0% .. 100%)

Re s

Im s

2.0E0 -1. -0.5

-2.0E0

-1.

1.

2.0E0

100

0%Poles

100

0%Zeros

Out[14]= Graphics

Pole-Zero Plots of Transfer Functions Without Parameters

The RootLocusPlot function can also be used to display the pole and zero locations of transferfunctions without parameters. For this purpose, RootLocusPlot must be called with a univariatetransfer function, and no parameter interval must be passed as a second argument.

In[15]:= RootLocusPlot[H3[s]]

Re s

Im s

-2.0E0.0E0 -1. -0.5

-2.0E0

-1.

1.

2.0E0

Out[15]= Graphics

Page 91: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.5 Graphics 89

Animating Root Locus Plots

Sometimes it is helpful to animate a root locus plot because this shows the orientations of thepole and zero trajectories better than a static plot. Let’s demonstrate root locus plot animation onthe transfer function H4[s, a] from above. To prepare the animation we compute a sequence ofpole-zero plots with identical plot ranges by mapping the following RootLocusPlot function to atable of parameter values ranging from to in steps of . This is necessary because we want toproduce one separate plot in every parameter step instead of one single plot in which the solutionsfrom all steps are superimposed.

In[16]:= RootLocusPlot[H4[s, a], a, #, #,PoleStyle −> CrossMark[0.03, Hue[0.7] &,

Thickness[0.007]],ZeroStyle −> CircleMark[0.03, Hue[0.3] &,

Thickness[0.007]],PlotRange −> −6, 1, −4, 4,ShowLegend −> False,LinearRegionStyle −> RGBColor[1, 1, 1]

] & /@ Table[x, x, −3, 5, 2]

Re s

Im sa = 5.000e0

-2.0E0-5.0E0 -1. 1.

-2.0E0

-1.

1.

2.0E0

Out[16]= Graphics , Graphics , Graphics , Graphics , Graphics

We show only one plot here; several plots are generated if the command is evaluated in a Mathematicanotebook.

To animate the root locus plot double-click on one of the images. Alternatively, you can selectthe resulting group of notebook cells containing the images with your mouse and then click onCell | Animate Selected Graphics in Mathematica’s frontend menu.

2.5.5 Transient Waveforms

For displaying transient waveforms, Analog Insydes provides the command TransientPlot (Sec-tion 3.9.6). The usage of this function is demonstrated in Section 2.7.1 and Section 2.7.6.

Page 92: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

90 2. Tutorial

2.6 Modeling and Analysis of Nonlinear Circuits

2.6.1 Behavioral Models

In Chapter 2.3 we implemented small-signal equivalent circuits for semiconductor devices as sub-circuit objects composed of the available linear circuit primitives. We cannot use this approach tomodel the electrical characteristics of nonlinear elements, such as diodes or transistors. However,particularly for nonlinear circuit analysis, Analog Insydes provides special support for modelingarbitrary circuit element characteristics by specifying device equations directly.

Models which are based on sets of mathematical equations describing the behavior of a circuitelement or an analog building block are frequently called (analog) behavioral models, or ABMs. Abehavioral model is similar to a subcircuit object in that it constitutes a box which is connected to acircuit through electrical ports. As indicated above, the difference is that the interior of a behavioralmodel box is implemented in terms of symbolic equations rather than a netlist. With Analog Insydes’behavioral modeling capabilities you can model a large variety of nonlinear element characteristics.You can then use the function CircuitEquations (Section 3.5.1), with which you are already familiar,to set up symbolic systems of nonlinear modified nodal or sparse tableau equations.

2.6.2 Defining Behavioral Models

The Argument Sequence of the Model Command for ABM Definitions

Behavioral models are defined using the Model (Section 3.2.1) command, just like subcircuits (seeSection 2.3.2). Analog Insydes recognizes a request to define a behavioral model by the presence ofthe named parameter Variables and the absence of a subcircuit Netlist on the right-hand side ofthe Definition argument in a Model call. The full syntax for an ABM definition is shown below.Again, slanted typewriter font denotes optional arguments.

Model[Name −> subcircuit class name,Selector −> selector,Scope −> scope,Ports −> port nodes,Parameters −> parameters,Symbolic −> symbolic parameters,Defaults −> defaults,InitialConditions −> initial conditions,InitialGuess −> initial guess,Translation −> parameter translation rules,Variables −> variables,Definition −> Equations[equations]

]

Page 93: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.6 Modeling and Analysis of Nonlinear Circuits 91

Except for the additional arguments and the keyword Definition, all other named arguments ofthe Model function have the same meaning as for subcircuit definitions. Following, we discuss thetwo arguments Definition and Variables.

Example: A Diode

Let’s illustrate the steps which are necessary to define a behavioral model by implementing anonlinear device model for a junction diode.

VD

ID

A

C

id(vd)=I (e -1)vd/vt

s

Figure 6.1: Junction diode

The diode shown in Figure 6.1 has two terminals, the anode and the cathode, denoted by the nodeidentifiers A and C, respectively. The branch voltage vD and the branch current iD satisfy the deviceequation

iD IS evDVt

where IS denotes the reverse-bias saturation current and Vt the thermal voltage. Typical values for ISare A A. Vt is given by k Tq where k denotes Boltzmann’s constant (k WsK).T is the absolute temperature (in Kelvin), and q is the charge of an electron (q As).

In[1]:= <<AnalogInsydes‘

In[2]:= ThermalVoltage[T_] := 1.381*10^−23 * T / (1.602*10^−19)

At a temperature of K ( C), Vt is approximately mV:

In[3]:= ThermalVoltage[300.]

Out[3]= 0.0258614

Since the thermal voltage is only defined in terms of constants and the global quantity temperature,Vt is a global parameter. Thus, we have a local parameter of the diode device equation which isIS, and a global parameter which is Vt. Note that a global parameter param is defined by settingGlobal[param] in the Parameters argument. Assuming Scope −> Local and no Translation rules,the first half of the Model definition is thus given by

Page 94: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

92 2. Tutorial

Model[Name −> Diode,Selector −> DC,Ports −> A, C,Parameters −> Is, Global[Vt],

]

The Definition Argument

For behavioral model definitions, the Definition parameter must be of the form

Definition −> Equations[eq1, eq2, ]

where eq1, eq2, denote the symbolic device equations. (For compatibility reasons the right handside of the Definition parameter may also be a list of equations.) When specifying an arbitraryset of equations we must tell Analog Insydes how the unknowns of the equations relate to the portcurrents and voltages of a model object.

Voltage[node+, node-]

node+

node-

Current[node+, node-]

Figure 6.2: Voltage and current identifiers at a model port branch

Ports of behavioral models are defined in terms of electrical port branches. Every unique pairof node identifiers [node+, node−] introduces an electrical port branch in between the model portnodes node+ and node−. For the associated port voltage and current the positive reference directionis defined to be oriented from node+ to node−, which is illustrated in Figure 6.2.

Port variables in behavioral model equations can be referred to by means of two special keywordswhich are recognized by Analog Insydes and replaced by the corresponding global current or voltageidentifiers during model instantiation and expansion. The keywords provided to make references toport currents and voltages are, respectively:

Current[node+, node-]Voltage[node+, node-]

Note that the above definition of positive reference directions implies that Current[nodeA, nodeB] andCurrent[nodeB, nodeA] are two different quantities and refer to different port branches. Similarly,Current[nodeA, nodeB] and Voltage[nodeB, nodeA] do not refer to the same port branch.

Page 95: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.6 Modeling and Analysis of Nonlinear Circuits 93

In the case of the diode we have two port nodes A and C, which are connected by an electrical portbranch [A, C]. The port current, i.e. iD, is thus designated by Current[A, C] and the port voltage,i.e. vD, is designated by Voltage[A, C]. Hence, the model equation must be written as

Definition −>Equations[Current[A, C] == Is (Exp[Voltage[A, C]/Vt] − 1)]

In this example, the Definition contains only one single equation, but there is no limit to thenumber of equations. We will discuss some more advanced examples in which this will becomeapparent later in this chapter.

A note on interfacing: Some numerical circuit simulators with behavioral model simulation capabilities use thecurrents into the pins (port nodes) of a model object and the node voltages at the pins as symbolic quantitiesby which the model equations are interfaced with the exterior circuit. This approach is not well suited for otheranalysis methods than modified nodal analysis. Using port branches with associated currents and voltagesfacilitates setting up other formulations which involve loop equations, such as the sparse tableau.

The Variables Argument

The Variables argument serves to specify the symbols which are unknowns of the model equations.The diode equation contains two unknowns, Current[A, C] and Voltage[A, C], so the Variablesargument is

Variables −> Current[A, C], Voltage[A, C]

The need for the Variables specification may not be entirely obvious here. One might argue thatAnalog Insydes should know that port current and voltage identifiers are unknowns. However, portcurrents and voltages are not always the only variables of a set of model equations. Similarly toa subcircuit which may have internal nodes, a behavioral model may also contain internal vari-ables which are not of the form Voltage[node+, node−] or Current[node+, node−]. Without theVariables argument, Analog Insydes would not be able to distinguish between internal variablesand global parameters, such as Vt in the diode equation. So, by convention, you must specify allidentifiers in a set of model equations which are neither local nor global parameters, including theport branch quantities. The complete ABM definition for the diode is then given by

Model[Name −> Diode,Selector −> DC,Ports −> A, C,Parameters −> Is, Global[Vt],Variables −> Current[A, C], Voltage[A, C],Definition −>

Equations[Current[A, C] == Is (Exp[Voltage[A, C]/Vt] − 1)]]

Page 96: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

94 2. Tutorial

2.6.3 Referencing Behavioral Models

Behavioral models are referenced exactly like subcircuits. Since we have already learned in Chap-ter 2.3 how to write hierarchical netlists we can start immediately with an example. Let’s write anetlist for the diode circuit in Figure 6.3 using the diode model developed above.

V0

1

2

R1

D1

Figure 6.3: Diode circuit

In[4]:= diodeNetwork =Circuit[

Netlist[V0, 1, 0, V0,R1, 1, 2, R1,D1, 2 −> A, 0 −> C,

Model −> Diode,Selector −> DC

],Model[

Name −> Diode,Selector −> DC,Ports −> A, C,Parameters −> Is, Global[Vt],Variables −> Current[A, C], Voltage[A, C],Definition −>

Equations[Current[A, C] == Is (Exp[Voltage[A, C]/Vt] − 1)

]]

]

Out[4]= Circuit

2.6.4 Nonlinear Circuit Equations

Setting up Nonlinear Equations

Using the command CircuitEquations you can set up modified nodal or sparse tableau equationsfor nonlinear circuits just as for linear circuits. The only restriction is that nonlinear systems of

Page 97: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.6 Modeling and Analysis of Nonlinear Circuits 95

equations cannot be set up in matrix form. Therefore, whenever a netlist contains behavioral models,you must call CircuitEquations with the option MatrixEquation −> False, or as in our case,you need to switch the AnalysisMode to e.g. DC for setting up nonlinear static equations whichautomatically implies the setting MatrixEquation −> False.

In[5]:= dnwmna = CircuitEquations[diodeNetwork,AnalysisMode −> DC];

DisplayForm[dnwmna]

Out[6]//DisplayForm=

I$V0 V$1 V$2

R1 0, I$AC$D1

V$1 V$2

R1 0, V$1 V0,

I$AC$D1 1 EV$2Vt Is$D1, V$1, V$2, I$V0, I$AC$D1,

DesignPoint

Here, we have set up a system of nonlinear modified nodal equations in the unknowns V$1, V$2,I$V0, and I$AC$D1. The latter symbol has been created automatically from the port current identifierCurrent[A, C] in the definition of the diode model. All port branch voltages have been replacedby corresponding differences of node voltages.

Generally, a port current Current[x, y] in a model instance MX will be denoted by symbols of theform I$xy$MX. A port voltage Voltage[x, y] will be denoted by V$xy$MX, provided that branchvoltages appear as unknowns in the selected analysis method. To examine both effects we set upthe sparse tableau equations.

In[7]:= CircuitEquations[diodeNetwork,Formulation −> SparseTableau, AnalysisMode −> DC

] // GetVariables

Out[7]= V$V0, V$R1, V$AC$D1, I$V0, I$R1, I$AC$D1We use the command GetVariables (Section 3.6.7) to extract the list of variables from the equationsystem. As you can see, the corresponding variables are called V$AC$D1 and I$AC$D1

Solving Nonlinear Equations

Solving nonlinear circuit equations analytically is, unfortunately, mathematically impossible in thegeneral case. However, in many applications it is possible to reduce the original set of equations byeliminating a number of variables. This may already yield some qualitative insight into the behaviorof a nonlinear circuit. On the other hand, we can always assign values to symbolic parameters andsolve the equations numerically using NDAESolve (Section 3.7.5).

Let’s derive an expression which relates the diode currentI$AC$D1 to the input voltage V0 by eliminating all other variables. For this task, Analog Insydesprovides the function CompressNonlinearEquations (Section 3.12.2) which removes equations andvariables from a nonlinear DAEObject that are irrelevant for solving for a set of given variables. Theoption setting EliminateVariables −> All additionally allows for eliminating variables that occurlinear somewhere in the equations.

Page 98: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

96 2. Tutorial

In[8]:= dnwsol = CompressNonlinearEquations[dnwmna, I$AC$D1,EliminateVariables −> All];

DisplayForm[dnwsol]

Out[9]//DisplayForm=

I$AC$D1 1 EI$AC$D1 R1V0Vt Is$D1, I$AC$D1, DesignPoint

The implicit equation is what we have been looking for. Without resorting to approximation meth-ods such as Taylor series we cannot simplify the result any further and solve for the diode currentanalytically.

2.6.5 Multi-Dimensional Models

The Ebers-Moll Transistor Model

The procedure for modeling one-dimensional nonlinear element characteristics can be easily extendedto the multi-dimensional case. Let’s demonstrate multi-dimensional device modeling on a practicalexample by defining nonlinear DC models for a bipolar junction transistor (see Figure 6.4).

C

B

E

IB

IE

IC

VCE

VBC

VBE

Figure 6.4: NPN transistor

Our considerations will be based on the BJT model introduced by Ebers and Moll which expressesthe relations between the transistor currents and voltages IC, IE, VBE, and VBC as

IC IS eVBEVt IS

Αr eVBCVt

IE IS

Αf eVBEVt IS eVBCVt

In these equations, the parameter IS represents the transport saturation current, Αr and Αf denote thelarge-signal reverse and forward current gains of the common base configuration, and Vt designatesthe thermal voltage. In integrated circuit design, the saturation current is usually expressed as theproduct of the transport saturation current density JS, which is a process parameter, and the emitterarea A, which is a design parameter:

Page 99: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.6 Modeling and Analysis of Nonlinear Circuits 97

IS JS A

The remaining two unknown voltages and currents at the transistor’s terminals, IB and VCE can becomputed from KCL and KVL (see Figure 6.5) as

IB IC IE

VCE VBE VBC

C

B

E

IB

IE

IC

VCE

VBC

VBE

B

C

E

Voltage[B,C]

Voltage[B,E]

Current[B,C]=-IC

Current[B,E]=-IE

Figure 6.5: NPN transistor and corresponding ABM port branch definition

In most linear applications, bipolar transistors are typically operated in the forward active regionwhich is roughly characterized by VBE V and VBC V. Under these assumptions we cansimplify the Ebers-Moll model to

IC IS eVBEVt

IE IS

Αf eVBEVt

because as compared to the terms involving eVBEVt , all other terms are smaller by several orders ofmagnitude.

A BJT operating in the forward active region acts as a good current amplifier from the base current IB

to the collector current IC with the gain relationship

IC Βf IB

The parameter Βf denotes the large-signal forward current gain in common-emitter configuration.It is often more convenient to think in terms of forward and reverse current gains with respect to

Page 100: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

98 2. Tutorial

the base current, i.e. Βf and Βr, than in terms of the model parameters Αf and Αr in the originalEbers-Moll equations. The relationship between Αf and Βf , as well as between Αr and Βr is given by

Β Α

Α

or, equivalently,

Α Β

Β

By making use of parameter translation rules in the model definition (see Section 2.3.7), we can letAnalog Insydes compute the values for Αf and Αr automatically from given values for Βf and Βr.

Implementation of Nonlinear DC Transistor Models

With the above background information on transistor models we are now ready to define a large-signal BJT model for DC circuit analysis. We start by implementing a global DC model for an NPNtransistor using the unsimplified device equations after Ebers and Moll from the previous subsection.

Name −> NPNBJT,Selector −> EbersMoll,Scope −> Global,Ports −> C, B, E,

Let’s decide that we do not want to characterize a transistor by the Ebers-Moll model parame-ters Is, alphaf, alphar, and Vt but want to use the parameters Js, Area, betaf, betar, andTemperature instead. We do not need to rewrite the model equations if we specify translation ruleswhich translate our model parameters to those of the Ebers-Moll model. Remember that the functionThermalVoltage has already been defined in Section 2.6.2.

Parameters −> betaf, betar, Js, Area, Global[Temperature],Translation −>

alphaf −> betaf/(1+betaf), alphar −> betar/(1+betar),Is −> Js*Area, Vt :> ThermalVoltage[Temperature],

The Ebers-Moll equations describe the functional relations between the voltages and currents attwo electrical branches, the base-collector branch and the base-emitter branch, which we use as theport branches of our model. Associated with the port branches are the variables Voltage[B, E],Current[B, E], Voltage[B, C], and Current[B, C], which must be specified as

Page 101: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.6 Modeling and Analysis of Nonlinear Circuits 99

Variables −>

Current[B, C], Voltage[B, C],Current[B, E], Voltage[B, E],

in the model definition.

It remains to write the model equations in terms of the port branch variables, paying attention tothe different positive reference directions assumed for the port currents as compared to IC and IE inthe Ebers-Moll equations. While the latter are defined to be positive for currents flowing into thecollector and emitter, positive values of Current[B, C] and Current[B, E] denote currents flowingout of these terminals. We account for this difference by changing the sign on the right-hand side ofthe model equations.

Definition −>

Equations[Current[B, C] == −Is*(Exp[Voltage[B, E]/Vt] − 1)

+ Is/alphar*(Exp[Voltage[B, C]/Vt] − 1),Current[B, E] == Is/alphaf*(Exp[Voltage[B, E]/Vt] − 1)

− Is*(Exp[Voltage[B, C]/Vt] − 1)],

To store the transistor model in the global database we wrap the complete Model definition into aCircuit structure and expand it with ExpandSubcircuits (Section 3.4.1).

In[10]:= Circuit[Model[

Name −> NPNBJT,Selector −> EbersMoll,Scope −> Global,Ports −> C, B, E,Parameters −>

betaf, betar, Js, Area, Global[Temperature],Translation −>

alphaf −> betaf/(1+betaf),alphar −> betar/(1+betar),Is −> Js*Area, Vt :> ThermalVoltage[Temperature],

Variables −>Current[B, C], Voltage[B, C],Current[B, E], Voltage[B, E],

Definition −>Equations[

Current[B, C] == −Is*(Exp[Voltage[B, E]/Vt] − 1)+ Is/alphar*(Exp[Voltage[B, C]/Vt] − 1),

Current[B, E] == −Is*(Exp[Voltage[B, C]/Vt] − 1)+ Is/alphaf*(Exp[Voltage[B, E]/Vt] − 1)

]]

] // ExpandSubcircuits;

Page 102: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

100 2. Tutorial

Similarly, we define a simplified Ebers-Moll model for transistors operating in the forward activeregion.

In[11]:= Circuit[Model[

Name −> NPNBJT,Selector −> EbersMollForwardActive,Scope −> Global,Ports −> C, B, E,Parameters −> betaf, Js, Area, Global[Temperature],Translation −>

alphaf −> betaf/(1+betaf),Is −> Js*Area, Vt :> ThermalVoltage[Temperature],

Variables −>Current[B, C], Voltage[B, C],Current[B, E], Voltage[B, E],

Definition −>Equations[

Current[B, C] == −Is*(Exp[Voltage[B, E]/Vt]),Current[B, E] == Is/alphaf*(Exp[Voltage[B, E]/Vt])

]]

] // ExpandSubcircuits;

Both models are now stored in the global database:

In[12]:= GlobalSubcircuits[]

Out[12]=NPNBJT, EbersMoll, NPNBJT, EbersMollForwardActive

2.6.6 Nonlinear DC Circuit Analysis

Calculating the Bias Point of a Transistor Circuit

Analog Insydes’ nonlinear modeling capabilities and numeric equation solver allow for solving cir-cuit analysis problems quickly and reliably without tedious and error-prone hand calculations. Let’sdemonstrate one such application:

Determine the operating-point currents and voltages IB, IC, VBE, VCE for the circuit shown in Fig-ure 6.6, if (a) RB k and (b) RB k . Assume that the transistor has an emitter area ofmil, Βf , Βr , JS ΜAmil, and that it operates at a temperature of K. Thevalues of the supply voltage and the collector resistance are VCC V and RC k .

Page 103: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.6 Modeling and Analysis of Nonlinear Circuits 101

VCC

1

2

RC

VBE

VCEQ1

IB IC

RB

3

Figure 6.6: Bipolar transistor circuit

For didactic reasons we do not use ReadNetlist to automatically import the netlist, but ratherwrite the circuit by hand. Moreover, instead of using a BJT transistor model from the predefinedAnalog Insydes model library, we select a suitable model from the global database which containsthe two NPNBJT models defined in the previous section. By leaving the model selector unspecified,Selector −> BJTModel, we can postpone the final choice of the underlying model equations untilwe set up circuit equations. The option Pattern −> Impedance in the value field of RB introducesthe current I$RB into the MNA equations. The current I$RB is identical to the base current IB, so wecan compute the latter directly from the equations without having to determine it manually from ICand IE by KCL.

In[13]:= bjtbias =Circuit[

Netlist[VCC, 1, 0, Type −> VoltageSource,

Symbolic −> VCC, Value −> 12.,RB, 1, 2, Pattern −> Impedance,

Symbolic −> RB, Value −> 500.*10^3,RC, 1, 3, Symbolic −> RC, Value −> 4000.,Q1, 3 −> C, 2 −> B, 0 −> E,

Model −> NPNBJT, Selector −> BJTModel,betaf −> 100., betar −> 0.2,Js −> 6.*10^−16, Area −> 4., Temperature −> 300.

]]

Out[13]= Circuit

In order to keep model complexity as low as possible, we make the initial assumption that Q1 operatesin the forward active region and set up a system of symbolic static circuit equations using the simpli-fied Ebers-Moll model by setting the options AnalysisMode −> DC and ElementValues −> Symbolic.

Page 104: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

102 2. Tutorial

In[14]:= mnaeqsfa = CircuitEquations[bjtbias /. BJTModel −> EbersMollForwardActive,AnalysisMode −> DC, ElementValues −> Symbolic];

DisplayForm[mnaeqsfa]

Out[15]//DisplayForm=

I$RB I$VCC V$1 V$3

RC 0, I$BC$Q1 I$BE$Q1 I$RB 0,

I$BC$Q1 V$1 V$3

RC 0, V$1 VCC,

I$RB RB V$1 V$2 0, I$BC$Q1 2.41015 E38.6676 V$2,

I$BE$Q1 2.4241015 E38.6676 V$2,V$1, V$2, V$3, I$VCC, I$RB, I$BC$Q1, I$BE$Q1,DesignPoint VCC 12., RB 500000., RC 4000.

This system of equations can be solved by Analog Insydes’ numerical root finding function NDAESolve(Section 3.7.5), which starts from an initial guess for the values of the variables. By default, initialvalues of for all unknowns are chosen which is very often close enough to ensure convergence.

In[16]:= NDAESolve[mnaeqsfa, t, 0]

Out[16]=V$1 12., V$2 0.712996, V$3 2.9704, I$VCC 0.00227997,I$RB 0.000022574, I$BC$Q1 0.0022574, I$BE$Q1 0.00227997

From the result we can immediately read off the operating point. We have

VBE V$2 V

VCE V$3 V

IB I$RB mA

IC I$BC$Q1 mA

Next, we repeat the same calculation for RB k using the command UpdateDesignPoint(Section 3.6.14) to alter the numeric element value for RB.

In[17]:= mnaeqsfa = UpdateDesignPoint[mnaeqsfa, RB −> 1.*10^5];NDAESolve[mnaeqsfa, t, 0]

Out[18]=V$1 12., V$2 0.75452, V$3 32.9819, I$VCC 0.0113579,I$RB 0.000112455, I$BC$Q1 0.0112455, I$BE$Q1 0.0113579

This time, we obtain a physically nonsensical value of V for VCE which indicates that ourinitial assumption about the operating condition of Q1 has been violated. Indeed, for RB k ,Q1 operates in deep saturation. We must therefore select the full Ebers-Moll model to take theseeffects into account.

Page 105: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.6 Modeling and Analysis of Nonlinear Circuits 103

In[19]:= mnaeqssat = CircuitEquations[bjtbias /. BJTModel −> EbersMoll,AnalysisMode −> DC, ElementValues −> Symbolic];

DisplayForm[mnaeqssat]

Out[20]//DisplayForm=

I$RB I$VCC V$1 V$3

RC 0, I$BC$Q1 I$BE$Q1 I$RB 0,

I$BC$Q1 V$1 V$3

RC 0, V$1 VCC,

I$RB RB V$1 V$2 0, I$BC$Q1 2.41015 1 E38.6676 V$2

1.441014 1 E38.6676 V$2V$3 , I$BE$Q1

2.4241015 1 E38.6676 V$2 2.41015 1 E38.6676 V$2V$3 ,V$1, V$2, V$3, I$VCC, I$RB, I$BC$Q1, I$BE$Q1,DesignPoint VCC 12., RB 500000., RC 4000.

Solving these enhanced equations will now deliver a proper result for RB k .

In[21]:= mnaeqssat = UpdateDesignPoint[mnaeqssat, RB −> 1.*10^5];NDAESolve[mnaeqssat, t, 0]

Out[22]=V$1 12., V$2 0.720901, V$3 0.13522, I$VCC 0.00307899,I$RB 0.000112791, I$BC$Q1 0.0029662, I$BE$Q1 0.00307899

We finally obtain:

VBE V$2 V

VCE V$3 V

IB I$RB mA

IC I$BC$Q1 mA

2.6.7 References

The BJT circuit DC analysis example was adapted from the book by R. L. Geiger, P. E. Allen, andN. R. Strader: VLSI Design Techniques for Analog and Digital Circuits, Mc-Graw Hill, 1990.

Page 106: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

104 2. Tutorial

2.7 Time-Domain Analysis of Nonlinear DynamicCircuits

In Chapter 2.6 it was shown how to model and analyze circuits with nonlinear element character-istics. In this chapter, we extend these considerations to the analysis of circuits containing not onlynonlinear but also dynamic components, such as capacitors and inductors. From a mathematicalpoint of view this means that a system of equations which describes a nonlinear dynamic circuit in-volves linear and nonlinear algebraic constraints as well as time derivatives of some circuit variables.Equations with these properties are called system of nonlinear Differential and Algebraic Equations, orDAE.

When analyzing a dynamic circuit we are usually interested in finding the response of the circuit toa given input signal as a function of time. This analysis mode is commonly referred to as transientanalysis. Computing a transient response requires solving an implicit DAE system numerically, start-ing from an initial solution for the voltages and currents known as the DC operating point. WithMathematica’s built-in command NDSolve we cannot handle this type of problem because solving dif-ferential equations with algebraic constraints is not supported. Therefore, Analog Insydes includes aspecial DAE solver for circuit simulation called NDAESolve which will be introduced in the followingsection.

2.7.1 Transient Circuit Analysis

A Diode Rectifier Circuit

Let’s start to demonstrate transient analysis on the half-wave diode rectifier circuit shown in Fig-ure 7.1. This circuit contains both nonlinear as well as dynamic components, namely the diode D1and the capacitor C1. Given numerical element values and input voltage waveform V Vint weshall compute the transient response Voutt across the load resistor R1.

V0 C1 R1 Vout

1 2D1

Figure 7.1: Diode rectifier circuit

Page 107: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits 105

As usual, we prepare our circuit analysis by writing a netlist description of the circuit. For the diode,we use the model from the Analog Insydes model data base (Chapter 4.3). The model parametersIs (saturation current) and Vt (thermal voltage) are set to Is pA and Vt mV. The values ofthe circuit elements are assumed to be R1 and C1 nF.

In[1]:= <<AnalogInsydes‘

In[2]:= rectifier =Circuit[

Netlist[V0, 1, 0, Vin,R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*10^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice",IS −> 1.*10^−12

]]

Out[2]= Circuit

Next, we use the function CircuitEquations (Section 3.5.1) to set up a system of nonlinear differ-ential MNA equations in the time domain. In oder to express all voltages and currents as functionsof time f t and to include time derivatives f !t introduced by dynamic components the optionAnalysisMode −> Transient must be specified in the function call. AnalysisMode −> Transientimplies MatrixEquation −> False, therefore the equations are written as list of equations regard-less of the current setting of MatrixEquation. CircuitEquations returns a Transient DAEObjectwhich can be displayed via the command DisplayForm.

In[3]:= rectifierMNA = CircuitEquations[rectifier,AnalysisMode −> Transient];

DisplayForm[rectifierMNA]

Out[4]//DisplayForm=I$AC$D1t I$V0t 0,

I$AC$D1t 0.01 V$2t 1.107 V$2 t 0,V$1t Vin, I$AC$D1t

1.1012 1 E38.6635 V$1tV$2t 1.1012 V$1t V$2t,V$1t, V$2t, I$V0t, I$AC$D1t, DesignPoint

This set of modified nodal equations is a typical DAE system. It comprises implicit differentialequations as well as both linear and nonlinear algebraic constraints.

The NDAESolve Command

Analog Insydes provides the function NDAESolve (Section 3.7.5) for solving DAE systems numerically.

NDAESolve[dae, tvar, t , t , params , opts]where dae is a DC or Transient DAEObject containing the circuit equations and variables. Theargument tvar denotes the time variable for which the solutions are computed in the time intervaltvar " t t, or at the time instant tvar t. Additionally, params allows for carrying out a para-metric analysis. For possible parameter specifications please refer to Section 3.7.2. Finally, opts is asequence of zero or more solver options of the form option −> value (see Section 2.7.4).

Page 108: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

106 2. Tutorial

Let’s use NDAESolve to compute the transient response Voutt of the diode circuit to a sinusoidalinput voltage Vint V sinΩt. We choose Ω s, replace the symbol Vin which denotes theinput voltage by the sine function, and integrate the circuit equations numerically with respect tothe time variable t from t to t Μs.

In[5]:= solutions = NDAESolve[rectifierMNA /. Vin −> Sin[10^6 t],t, 0., 2.*10^−5]

Out[5]=V$2 InterpolatingFunction0, 0.00002, ,V$1 InterpolatingFunction0, 0.00002, ,I$V0 InterpolatingFunction0, 0.00002, ,I$AC$D1 InterpolatingFunction0, 0.00002,

Like Mathematica’s NDSolve, NDAESolve returns the solutions for the node voltages and currentsin terms of InterpolatingFunction objects. This allows for accessing the numerical values of allvariables at any point of time in the simulation interval. To obtain the voltages and currents at acertain point of time ti, we first have to rewrite the interpolating functions as functions of time.

In[6]:= functions =First[solutions] /. Rule[a_, b_] −> Rule[a, b[t]]

Out[6]=V$2 InterpolatingFunction0, 0.00002, t,V$1 InterpolatingFunction0, 0.00002, t,I$V0 InterpolatingFunction0, 0.00002, t,I$AC$D1 InterpolatingFunction0, 0.00002, t

Then we replace t by a particular value, here t Μs. This yields the solution vector as a list ofrules.

In[7]:= functions /. t −> 10^−5

Out[7]=V$2 0.337585, V$1 0.543881, I$V0 1.881471012,

I$AC$D1 1.881471012

From the result we can immediately extract the voltage values for V(t Μs) and Vout(t Μs),as well as the value for the diode current ID1(t Μs)

V V$1 V

Vout V$2 V

ID1 I$AC$D1 pA

Plotting Transient Waveforms

For graphical display of transient waveforms computed with NDAESolve, Analog Insydes providesthe function TransientPlot (Section 3.9.6). With TransientPlot, several interpolating functionscan be plotted in a single diagram or displayed as graphics array. The command syntax is

TransientPlot[numericaldata, vars, tvar, t, t , opts]where numericaldata is a list of rules of interpolating functions. The format is compatible to the returnvalue of e.g. NDSolve and NDAESolve (see Section 3.7.1). The argument vars is a list of the variablesto be plotted. Besides the variables themselves, this list may also contain mathematical expressions

Page 109: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits 107

in terms of these variables. The symbol tvar denotes the time variable for which the waveforms areplotted from tvar t to tvar t. Zero or more options opts can be specified as sequence of rules ofthe form option −> value (see Section 2.7.6).

To visualize the transient waveforms of the node voltages V$1 and V$2 in the simulated time intervalwe can use TransientPlot as shown below. By default, all waveforms are superimposed in onesingle graph.

In[8]:= TransientPlot[solutions, V$1[t], V$2[t],t, 0., 2.*10^−5]

-65. 10

0.00001 0.000015 0.00002t

-1

-0.5

0.5

1

V$2[t]

V$1[t]

Out[8]= Graphics

Quasi-DC Analysis

To demonstrate the influence of the capacitor C1 on the output voltage we rerun the simulation,but this time we neglect the dynamic components of the circuit equations. This can be achievedby setting the NDAESolve option AnalysisMode from its default value Transient to DC. The DCanalysis method replaces all time derivatives in the circuit equations by zero. Thus, inductors arereplaced by short circuits because all inductor voltages are set to zero, and capacitors are replacedby open circuits because all capacitor currents are set to zero.

Inductor: VLt L#ILt#t

DC $ VLt % Short Circuit

Capacitor: ICt C#UCt#t

DC $ ICt % Open Circuit

Let’s apply quasi-DC analysis to our rectifier circuit by specifying the above-mentioned option in thecall to NDAESolve.

In[9]:= solDC = NDAESolve[rectifierMNA /. Vin −> Sin[10^6 t],t, 0., 10^−5, AnalysisMode −> DC]

Out[9]=V$1 InterpolatingFunction0, 0.00001, ,V$2 InterpolatingFunction0, 0.00001, ,I$V0 InterpolatingFunction0, 0.00001, ,I$AC$D1 InterpolatingFunction0, 0.00001,

Page 110: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

108 2. Tutorial

The influence of the capacitor C1 can be clearly recognized from the plot of the node voltages V$1and V$2.

In[10]:= TransientPlot[solDC, V$1[t], V$2[t], t, 0., 10^−5]

-62. 10

-64. 10

-66. 10

-68. 10

0.00001t

-1

-0.5

0.5

1

V$2[t]

V$1[t]

Out[10]= Graphics

2.7.2 Analysis of a Differential Amplifier

Transient Analysis

In this section, we want to examine a more complicated circuit to demonstrate the features and capa-bilities of the DAE solver. Consider the differential amplifier circuit shown in Figure 7.2 consistingof four bipolar junction transistors. We shall compute the transient response Voutt to a rectangularvoltage pulse applied at node 1.

Page 111: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits 109

VCC

1

2

RC1

V1

VEE

Q1

Cload

RS2

3

Vout

RC2 RBIAS

RS1Q2

Q3 Q4

4 5

6

7

9

8

Figure 7.2: Differential amplifier circuit

Again we start by writing a netlist (of course we could have used ReadNetlist as well). Let thevalues of the circuit elements be given as RS1 RS2 k , RC1 RC2 k , RBIAS k , andCLOAD pF. The supply voltages are VCC V and VEE V. For all transistors Q1, , Q4,we use the full Gummel-Poon transistor model implemented in the Analog Insydes model library(see Section 4.3.2). We assume the following model parameter values: transport saturation currentIS A, large-signal forward and reverse current gains BF and BR , andthe global temperature TEMP K.

Page 112: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

110 2. Tutorial

In[11]:= diffAmp =Circuit[

Netlist[RS1, 1, 2, Symbolic −> RS1, Value −> 1.*10^3,RS2, 3, 0, Symbolic −> RS2, Value −> 1.*10^3,RC1, 4, 8, Symbolic −> RC1, Value −> 1.*10^4,RC2, 5, 8, Symbolic −> RC2, Value −> 1.*10^4,RBIAS, 7, 8, Symbolic −> RBIAS, Value −> 2.*10^4,CLOAD, 4, 5,

Symbolic −> CLOAD, Value −> 5.*10^−12,Q1, 4 −> C, 2 −> B, 6 −> E, Model −> BJT,

Selector −> GummelPoon, Parameters −> BJTNPN,Q2, 5 −> C, 3 −> B, 6 −> E, Model −> BJT,

Selector −> GummelPoon, Parameters −> BJTNPN,Q3, 6 −> C, 7 −> B, 9 −> E, Model −> BJT,

Selector −> GummelPoon, Parameters −> BJTNPN,Q4, 7 −> C, 7 −> B, 9 −> E, Model −> BJT,

Selector −> GummelPoon, Parameters −> BJTNPN,VCC, 8, 0, Type −> VoltageSource,

Symbolic −> VCC, Value −> 12.,VEE, 9, 0, Symbolic −> VEE, Value −> −12.,V1, 1, 0, V1

],ModelParameters[Name −> BJTNPN, Type −> "NPN",

BF −> 255.9, BR −> 6.092, IS −> 14.34*10^−15],GlobalParameters[TEMP −> 300.15]

]

Out[11]= Circuit

Setting up the circuit equations in the time-domain yields the following DAE system of 32 equationsin 32 variables.

In[12]:= diffAmpMNA = CircuitEquations[diffAmp,AnalysisMode −> Transient]

Out[12]= DAETransient, 3232

Next, we define the input signal Vt. We choose a rectangular voltage pulse with an amplitudeof V, a duration of Μs and a delay of Μs. This waveform can be set by the Analog Insydescommand PulseWave (Section 4.1.3).

In[13]:= Vpulse[t_] :=PulseWave[t, 0, 2, 2.5*10^−6, 0, 0, 4.*10^−6, 10^−5]

A graphical representation of the stimulus signal is shown below.

Page 113: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits 111

In[14]:= TransientPlot[Vpulse[t], t, 0., 10^−5,PlotRange −> −1, 3]

-62. 10

-64. 10

-66. 10

-68. 10

0.00001t

-1

-0.5

0.5

1

1.5

2

2.5

3

Vpulse[t]

Out[14]= Graphics

Then, we callNDAESolve to simulate the transient behavior of the differential amplifier for t " Μs. TheNonlinearMethod option allows for choosing between different algorithms for solving systems ofnonlinear algebraic equations numerically. By default, Mathematica’s numerical solver FindRoot isapplied, whereas in this example we want to make use of another implementation of Newton’smethod called NewtonIteration.

In[15]:= transient = NDAESolve[diffAmpMNA /. V1 −> Vpulse[t],t, 0., 10^−5, NonlinearMethod −> NewtonIteration];

Now, we use TransientPlot to plot the waveforms of the input and output voltages V$1 and V$5.

In[16]:= TransientPlot[transient, V$1[t], V$5[t],t, 0., 10^−5]

-62. 10

-64. 10

-66. 10

-68. 10

0.00001t

2

4

6

8

10

12

V$5[t]

V$1[t]

Out[16]= Graphics

DC-Transfer Analysis

Next, we shall compute the DC-transfer characteristic VoutVin V$5[V1] of the differential am-plifier circuit as the input voltage is swept from V to V. Therefore, we first set up thestatic circuit equations by calling CircuitEquations with the option setting AnalysisMode −> DC.

Page 114: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

112 2. Tutorial

Additionally, we formulate symbolic equations by setting ElementValues −> Symbolic. The optionsetting Symbolic −> None causes all device model parameters to be replaced by their numericalvalues.

In[17]:= staticequations = CircuitEquations[diffAmp,AnalysisMode −> DC, ElementValues −> Symbolic,Symbolic −> None];

DisplayForm[staticequations]

Out[18]//DisplayForm=

I$V1 V$1 V$2

RS1 0, I$BS$Q1

V$1 V$2

RS1 0,

I$BS$Q2 V$3RS2

0, I$CS$Q1 V$4 V$8

RC1 0,

I$CS$Q2 V$5 V$8

RC2 0, I$CS$Q3 I$ES$Q1 I$ES$Q2 0,

I$BS$Q3 I$BS$Q4 I$CS$Q4 V$7 V$8RBIAS

0,

I$VCC V$4 V$8

RC1

V$5 V$8

RC2

V$7 V$8

RBIAS 0,

I$ES$Q3 I$ES$Q4 I$VEE 0, I$BS$Q1 I$CS$Q1 I$ES$Q1 0,I$BS$Q1 ib$Q1, I$BS$Q1 I$ES$Q1 ic$Q1,ic$Q1 1.4341014 1. E38.6635 V$2V$6 1.16415

1.4341014 1. E38.6635 V$2V$4 1.1012 V$2 V$4

1.1012 V$2 V$6, ib$Q1 0.16415

1.4341014 1. E38.6635 V$2V$4 1.1012 V$2 V$4 0.00390778

1.4341014 1. E38.6635 V$2V$6 1.1012 V$2 V$6,I$BS$Q2 I$CS$Q2 I$ES$Q2 0,I$BS$Q2 ib$Q2, I$BS$Q2 I$ES$Q2 ic$Q2,ic$Q2 1.4341014 1. E38.6635 V$3V$6 1.16415

1.4341014 1. E38.6635 V$3V$5 1.1012 V$3 V$5

1.1012 V$3 V$6, ib$Q2 0.16415

1.4341014 1. E38.6635 V$3V$5 1.1012 V$3 V$5 0.00390778

1.4341014 1. E38.6635 V$3V$6 1.1012 V$3 V$6,I$BS$Q3 I$CS$Q3 I$ES$Q3 0,I$BS$Q3 ib$Q3, I$BS$Q3 I$ES$Q3 ic$Q3,ic$Q3 1.4341014 1. E38.6635 V$7V$9 1.16415

1.4341014 1. E38.6635 V$6V$7 1.1012 V$6 V$7

1.1012 V$7 V$9, ib$Q3 0.16415

1.4341014 1. E38.6635 V$6V$7 1.1012 V$6 V$7 0.00390778

1.4341014 1. E38.6635 V$7V$9 1.1012 V$7 V$9,I$BS$Q4 I$CS$Q4 I$ES$Q4 0,I$BS$Q4 ib$Q4, I$BS$Q4 I$ES$Q4 ic$Q4, ic$Q4 0. 1.4341014 1. E38.6635 V$7V$9 1.1012 V$7 V$9,ib$Q4 0. 0.00390778

1.4341014 1. E38.6635 V$7V$9 1.1012 V$7 V$9,V$8 VCC, V$9 VEE, V$1 V1, 1,

DesignPoint 1

Then, we run NDAESolve sweeping the parameter V1 in the interval V V. Note that thesweep variable can be any network parameter, for instance a voltage or current source parameter, amodel parameter, or even any unknown in the system of equations.

Page 115: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits 113

In[19]:= dctransfer = NDAESolve[staticequations, V1, −0.5, 0.5];

To display the DC-transfer curve graphically we again apply the function TransientPlot. For ourDC-transfer analysis we want to plot the output voltage V$5 versus the input voltage V1:

In[20]:= TransientPlot[dctransfer, V$5[V1], V1, −0.5, 0.5]

-0.4 -0.2 0.2 0.4V1

2

4

6

8

10

12

V$5[V1]

Out[20]= Graphics

The resulting plot shows the typical tanh-shaped transfer characteristic of this type of differentialamplifier.

Parametric Analyses

Finally, we demonstrate the usage of NDAESolve for carrying out parametric analyses. As an exam-ple, we perform a parametric analysis of the above computed DC-transfer characteristic V$5[V1]. Asadditional sweep parameter we choose the positive reference voltage VCC which shall take the valuesVCC " V V V. Note that for parametric analyses NDAESolve returns a multi-dimensionaldata object (see Section 3.7.1).

Page 116: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

114 2. Tutorial

In[21]:= paramdctransfer = NDAESolve[staticequations,V1, −0.5, 0.5, VCC, 10, 11, 12]

Out[21]=V$1 InterpolatingFunction0.5, 0.5, ,V$2 InterpolatingFunction0.5, 0.5, ,V$3 InterpolatingFunction0.5, 0.5, ,V$4 InterpolatingFunction0.5, 0.5, ,V$5 InterpolatingFunction0.5, 0.5, ,V$6 InterpolatingFunction0.5, 0.5, ,V$7 InterpolatingFunction0.5, 0.5, ,V$8 InterpolatingFunction0.5, 0.5, ,V$9 InterpolatingFunction0.5, 0.5, ,I$BS$Q1 InterpolatingFunction0.5, 0.5, ,I$CS$Q1 InterpolatingFunction0.5, 0.5, ,I$ES$Q1 InterpolatingFunction0.5, 0.5, ,ib$Q1 InterpolatingFunction0.5, 0.5, ,8, I$ES$Q3 InterpolatingFunction0.5, 0.5, ,ib$Q3 InterpolatingFunction0.5, 0.5, ,ic$Q3 InterpolatingFunction0.5, 0.5, ,I$BS$Q4 InterpolatingFunction0.5, 0.5, ,I$CS$Q4 InterpolatingFunction0.5, 0.5, ,I$ES$Q4 InterpolatingFunction0.5, 0.5, ,ib$Q4 InterpolatingFunction0.5, 0.5, ,ic$Q4 InterpolatingFunction0.5, 0.5, ,I$VCC InterpolatingFunction0.5, 0.5, ,I$VEE InterpolatingFunction0.5, 0.5, ,I$V1 InterpolatingFunction0.5, 0.5, ,SweepParameters VCC 10., 1,

1The above generated multi-dimensional data format is supported by TransientPlot. Thus, we candisplay all sweep traces of the DC-transfer characteristic in a single plot.

In[22]:= TransientPlot[paramdctransfer, V$5[V1],V1, −0.5, 0.5]

-0.4 -0.2 0.2 0.4V1

2

4

6

8

10

12

V$5[V1]

Out[22]= Graphics

Page 117: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits 115

2.7.3 Flow of Transient Circuit Analysis

A Summary of the Transient Analysis Procedure

In this subsection, we summarize the steps which are necessary to perform a transient analysis of adynamic circuit with Analog Insydes.

1) Write a netlist of the circuit to be simulated, specifying numerical values for all circuit elements oruse ReadNetlist (Section 3.10.1) for automatically importing netlists from external simulator files.

circuit =Circuit[

Netlist[ ],Model[ ],

]

2) Set up a system of time-domain circuit equations using CircuitEquations with the option settingAnalysisMode −> Transient. For numerical circuit simulation you should use modified nodal anal-ysis, which is the default formulation. Modified nodal equations are smaller in size and thereforerequire less simulation time.

mnaequations =CircuitEquations[circuit, AnalysisMode −> Transient]

3) Apply the command NDAESolve to the circuit equations to calculate the transient solution in thetime interval t " t t, where t is usually zero.

transient = NDAESolve[mnaequations, t, t, t]

4) Use TransientPlot for transient waveform display. Select the variables to be plotted by meansof the list vars and specify the display time interval ta tb. The latter need not be the same asthe simulation time interval t t. You can use any other values for ta and tb to zoom in onto aparticular section of a trace as long as the condition t & ta tb & t holds.

TransientPlot[transient, vars, t, ta, tb]

NDAESolve Program Flow

Now, let’s take a closer look at the strategy NDAESolve employs to integrate a system of differentialand algebraic equations. The main idea behind the algorithm is to transform the problem of solvinga nonlinear system of differential and algebraic equations into a sequence of linear and purely algebraicproblems which can be solved rather easily. The transformation is carried out in two stages. Inthe first step, the differential equations are discretized by replacing all time derivatives with a finitedifference approximation. The differential equations are thus evaluated and solved at discrete timesteps only. The finite difference approximation scheme used by NDAESolve is an implicit integrationmethod known as the trapezoidal rule. In a second step the resulting nonlinear algebraic system of

Page 118: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

116 2. Tutorial

equations is then solved for the voltages and currents using the multi-dimensional Newton-Raphsonmethod.

Circuit equations are usually stiff, which means that their solutions involve both very rapid and veryslow transients. To avoid loss of accuracy and convergence problems during rapid transients as wellas excessive computation time requirements for slow transients the step size is chosen adaptively ateach time step according to the curvature of the waveform. Whenever a waveform changes quicklythe step size is cut back whereas it is increased during periods of latency. The behavior of thestep size control algorithm depends on the values of five parameters which will be discussed in thefollowing section. The associated NDAESolve options by which the default parameter settings can bechanged are StartingStepSize, MaxStepSize, MinStepSize, StepSizeFactor, and MaxDelta.

Figure 7.3 shows a flow graph of the algorithm implemented in NDAESolve.

Page 119: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits 117

substitute time derivatives

output of solutions asinterpolated functions

convergenceAND iimax

iterationi

time stepth

solve nonlinear system ofequations at time step t

using Newton’s method

at time step t using trapezoidal method

compute initial transient solution DC operating point

circuit equationsset up timedomain

step size control

h StepSizeFactor

h StepSizeFactor

input of circuit netlist

Y

ttmax

interpolation of data

store solution at time step t

iimaxY

N

Y

N

N

or

no

Figure 7.3: NDAESolve program flow

Page 120: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

118 2. Tutorial

2.7.4 NDAESolve Options

Options[NDAESolve]

Several options are available for NDAESolve most of which need not be changed unless there areproblems with the default settings, such as convergence problems. To list all options associated withNDAESolve inspect the value of Options[NDAESolve]:

In[23]:= Options[NDAESolve]

Out[23]=AccuracyGoal 6, AnalysisMode Transient,BreakOnError False, Compiled True, CompressEquations False,DesignPoint Automatic, InitialConditions Automatic,InitialGuess Automatic, InitialSolution Automatic,InterpolationOrder 1, MaxDelta 1., MaxIterations 100, 20,MaxSteps Automatic, MaxStepSize Automatic,MinStepSize Automatic, NonlinearMethod FindRoot,OutputVariables All, Protocol InheritedAnalogInsydes,RandomFunction RandomReal, 0., 0.1&,ReturnDerivatives False, Simulator InheritedAnalogInsydes,SimulatorExecutable Automatic, StartingStepSize Automatic,StepSizeFactor 1.5, WorkingPrecision 16

Below, a set of NDAESolve options is explained in more detail:

InitialGuess

With the default setting InitialGuess −> Automatic, zero is used as initial guess for all variableswhen solving a system of nonlinear equations by means of Newton iterations. Whenever this set-ting causes numerical problems, such as division-by-zero errors or failure to converge, you can useInitialGuess to specify your own initial guess as a list of rules of the form:

InitialGuess −> var −> value, , varn −> valuen

Note that the variables vari are specified without the time variable tvar.

InitialSolution

With the option InitialSolution we can force NDAESolve to use a certain DC solution as initialoperating point for a transient analysis. A set of initial values must be provided as a list of ruleswhich associate a numerical value with a variable from the system of equations. Missing variablesare then computed consistently.

InitialSolution −> var −> value, , varn −> valuen

Note that the variables vari are specified without the time variable tvar.

MaxDelta

One of the conditions that are checked by the integration step size control mechanism is whether thevalues of some variables change abruptly from one time step to the next. The maximum allowed

Page 121: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits 119

difference between two successive values is controlled by the option MaxDelta. The default settingis MaxDelta −> 1.0. This value is large enough to allow sudden steps of input voltages which arequite usual in the case of pulse excitations.

MaxIterations

The option MaxIterations specifies the maximum number of steps that the nonlinear equationsolver should use in attempting to find a solution. The option setting can either be an integer int ora list of two integers int int. If it is specified as a single integer int then it is equivalent to thelist int int. The first integer value defines the iteration limit for finding a DC operating point andthe second integer value the iteration limit for transient computations, respectively. If the numberof iterations for the operating-point computation exceeds the limit, an error message is generatedand the computation is interrupted. If the iteration limit for transient computations is exceeded,the step size is reduced by the factor given by the option StepSizeFactor. The default setting isMaxIterations −> 100, 20.

MaxSteps

The option MaxSteps limits the total number of integration steps. The simulation is stopped im-mediately if the limit is exceeded. The default setting is MaxSteps −> Automatic, which meansMaxSteps /t t/ StartingStepSize.

MaxStepSize

It is sometimes possible to speed up simulations by allowing a larger maximum integration step size.With the option MaxStepSize the present step size limit can be extended or reduced. The defaultsetting is MaxStepSize −> Automatic, which means MaxStepSize /t t/ .

MinStepSize

The lower limit of the integration step size can be specified by the option MinStepSize. NDAESolvestops a simulation immediately if the integration step size falls below this limit. The default settingis MinStepSize −> Automatic, which means MinStepSize /t t/ .

NonlinearMethod

The option NonlinearMethod chooses among different numerical algorithms for solving the non-linear algebraic systems of equations which arise due to the discretization of DAEs. By default,Mathematica’s numerical solver FindRoot is used for this purpose. Alternatively, you can employAnalog Insydes’ own implementation of the multi-dimensional Newton-Raphson method by speci-fying NonlinearMethod −> NewtonIteration.

Page 122: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

120 2. Tutorial

Protocol

With the option setting Protocol −> Notebook, NDAESolve can be instructed to print protocol in-formation to your notebook as the computation proceeds. The protocol includes an output of theinitial guess, the initial transient solution, shows the percentage of the computation completed, andthe number of time steps which were necessary to carry out the computation. The default setting isProtocol −> Inherited[AnalogInsydes] which means that NDAESolve inherits the option settingfrom the global setting specified in Options[AnalogInsydes] . See also Section 3.14.5.

StartingStepSize

The option StartingStepSize helps to overcome convergence problems at the beginning of a sim-ulation. If NDAESolve fails to converge during the first time step you can use StartingStepSize tospecify a smaller value for the initial integration step size. The default setting isStartingStepSize −> Automatic, which means StartingStepSize /t t/ .

StepSizeFactor

To reduce computation time and increase simulation accuracy NDAESolve employs an automatic stepsize control scheme. If the estimated simulation error in between two integration time steps is verylow then the step size is increased. On the other hand, if the estimated error is too large the stepsize is cut back. Increasing and reducing the step size is performed by multiplying or dividing thecurrent step size by a factor given by the value of the option StepSizeFactor. The default settingis StepSizeFactor −> 1.5.

2.7.5 Transient Analysis with Initial Conditions

Circuits with Initial Conditions

The handling of initial conditions was rather complicated with version 1 of Analog Insydes. There-fore, the netlist format was extended to treat initial conditions of dynamic circuit elements such ascapacitors or inductors. This is done by specifying the setting InitialCondition −> value in theoption field of the particular netlist entry (see Section 3.1.4).

Consider the RLC circuit shown in Figure 7.4. The initial voltage VC1 across the capacitor C1 at t is given as VC1 Vic. Assume that the following numerical values are given for the circuit elements:R1 , L1 ΜH, C1 ΜF, and Vic mV.

Page 123: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits 121

C1 R1Iout

1 2

L1

Vic

Figure 7.4: Oscillator circuit with initial condition

We start with writing a circuit netlist which includes the initial condition of the capacitor C1.

In[24]:= oscillator =Netlist[

L1, 0, 1, Symbolic −> L1, Value −> 1.*10^−5,C1, 1, 2, Symbolic −> C1, Value −> 3.*10^−7,

InitialCondition −> 0.002,R1, 2, 0, Symbolic −> R1, Value −> 1.

]

Out[24]= NetlistRaw, 3

Following, we distinguish two alternatives for considering initial conditions of dynamic circuitelements.

Initial Conditions for some Dynamic Elements

With the option setting InitialConditions −> Automatic the function CircuitEquations can beinstructed to use initial conditions for those elements for which such a condition has been specifiedin the netlist entry. All others are then computed consistently by NDAESolve. For our example, weset up a system of modified nodal equations from the circuit configuration at the time t .

In[25]:= oscillatorMNA1 = CircuitEquations[oscillator,AnalysisMode −> Transient, ElementValues −> Symbolic,InitialConditions −> Automatic];

DisplayForm[oscillatorMNA1]

Out[26]//DisplayForm=

I$L1t C1 V$1 t V$2 t 0,

V$2t

R1 C1 V$1 t V$2 t 0, V$1t L1 I$L1 t 0,

V$10 V$20 0.002, V$1t, V$2t, I$L1t,DesignPoint L1 0.00001, C1 3.107, R1 1.

Page 124: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

122 2. Tutorial

Note that the initial condition for the capacitor C1 is given by the node voltage differenceV$1[0] V$2[0] and is included in the set of time-domain equations. Applying NDAESolve yieldsthe following DC operating-point values for the node voltages and the initial inductor current I$L1:

In[27]:= NDAESolve[oscillatorMNA1, t, 0.]

Out[27]= V$1 0., V$2 0.002, I$L1 0.002

For the DC analysis the inductor was replaced by a short circuit, therefore V$1 is zero. I$L1 hasthe same numerical value as V$2 because the resistor has the unit value . Now, we compute thetransient response:

In[28]:= transient1 = NDAESolve[oscillatorMNA1, t, 0., 10^−4]

Out[28]=V$1 InterpolatingFunction0, 0.0001, ,V$2 InterpolatingFunction0, 0.0001, ,I$L1 InterpolatingFunction0, 0.0001,

Finally, we plot the transient waveform of the output current Iout (given by the inductor current I$L1)in the simulated time interval.

In[29]:= TransientPlot[transient1, I$L1[t], t, 0., 10^−4,PlotRange −> All]

0.00002 0.00004 0.00006 0.00008 0.0001t

-0.002

-0.0015

-0.001

-0.0005

0.0005

0.001

0.0015

I$L1[t]

Out[29]= Graphics

Initial Conditions for all Dynamic Elements

Alternatively, the function CircuitEquations can be instructed to use initial conditions for all dy-namic elements by applying the option setting InitialConditions −> All. Initial conditions whichare not explicitly specified in the netlist are then assumed to be zero. For our example, we again setup a system of modified nodal equations from the circuit configuration at the time t .

Page 125: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits 123

In[30]:= oscillatorMNA2 = CircuitEquations[oscillator,AnalysisMode −> Transient, ElementValues −> Symbolic,InitialConditions −> All];

DisplayForm[oscillatorMNA2]

Out[31]//DisplayForm=

I$L1t C1 V$1 t V$2 t 0,

V$2t

R1 C1 V$1 t V$2 t 0,

V$1t L1 I$L1 t 0, I$L10 0,V$10 V$20 0.002, V$1t, V$2t, I$L1t,DesignPoint L1 0.00001, C1 3.107, R1 1.

Note that this time the time-domain equations contain not only the initial condition for the capaci-tor C1 (given by the node voltage difference V$1[0] V$2[0]) but also an initial condition for theinductor current I$L1[0]. Now, we compute the DC operating point and the transient response byapplying NDAESolve.

In[32]:= NDAESolve[oscillatorMNA2, t, 0.]

Out[32]= V$1 0.002, V$2 0., I$L1 0.

In[33]:= transient2 = NDAESolve[oscillatorMNA2, t, 0., 10^−4]

Out[33]=V$1 InterpolatingFunction0, 0.0001, ,V$2 InterpolatingFunction0, 0.0001, ,I$L1 InterpolatingFunction0, 0.0001,

Finally, we plot the output current.

In[34]:= TransientPlot[transient2, I$L1[t], t, 0., 10^−4,PlotRange −> All]

0.00002 0.00004 0.00006 0.00008 0.0001t

-0.0003

-0.0002

-0.0001

0.0001

0.0002

I$L1[t]

Out[34]= Graphics

Please note the different transient waveforms dependent on the usage of initial conditions.

Page 126: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

124 2. Tutorial

2.7.6 TransientPlot Options

Options[TransientPlot]

As was shown previously, the function TransientPlot provides a convenient way for displayingresults of NDAESolve or NDSolve computations. The appearance of TransientPlot graphics can bechanged with the following set of options:

In[35]:= Options[TransientPlot]

Out[35]=

AspectRatio 1

GoldenRatio

, Axes True,

AxesLabel None, AxesOrigin Automatic, AxesStyle Automatic,Background GrayLevel0.92, ColorOutput Automatic,Compiled True, DefaultColor Automatic,Epilog , Frame False, FrameLabel None,FrameStyle Automatic, FrameTicks Automatic, GridLines None,ImageSize Automatic, MaxBend 10., PlotDivision 30.,PlotLabel None, PlotPoints 30, PlotRange Automatic,PlotRegion Automatic, PlotStyle RGBColor1., 0., 0.,

AbsoluteThickness1., AbsolutePointSize3.,RGBColor0., 0., 1., AbsoluteThickness1.,AbsoluteDashing10., 8., AbsolutePointSize3.,

RGBColor0., 0.8, 0., AbsoluteThickness1.,AbsoluteDashing4., 8., AbsolutePointSize3.,

RGBColor0.7, 0., 0.9, AbsoluteThickness1.,AbsoluteDashing10., 8., 4., 8., AbsolutePointSize3.,

Prolog , RotateLabel True,Ticks Automatic, DefaultFont $DefaultFont,DisplayFunction $DisplayFunction, FormatType $FormatType,TextStyle $TextStyle, GraphicsSpacing 0.1,Parametric False, ShowLegend True, ShowSamplePoints False,SingleDiagram True, SweepParameters Automatic

Most options are standard options of Graphics objects. Therefore, we will restrict ourselves to thediscussion of the remaining keywords Parametric, ShowSamplePoints, and SingleDiagram.

Parametric

With Parametric −> True parametric plots of two interpolating functions can be displayed. In thiscase, TransientPlot requires a list of two display variables xvar and yvar, where xvar denotesthe x-axis variable and yvar the y-axis variable. TransientPlot then shows a trace of the pointsxvar[par], yvar[par] as the parameter par is swept from par to par.

TransientPlot[numericaldata, xvar[par], yvar[par],par, par, par, Parametric −> True]

The axes are automatically labeled by the specified variable names. As an example we perform aparametric plot of the transient response of the diode rectifier circuit introduced in Section 2.7.1 (seeFigure 7.1).

Page 127: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.7 Time-Domain Analysis of Nonlinear Dynamic Circuits 125

In[36]:= TransientPlot[solutions, V$1[t], V$2[t],t, 10^−6, 10^−5, Parametric −> True]

-1 -0.5 0.5 1V$1[t]

0.25

0.3

0.35

0.4

V$2[t]

Out[36]= Graphics

ShowSamplePoints

Changing the default setting of the option ShowSamplePoints from False to True allows for visu-alizing the sample points stored in InterpolatingFunction objects. By this, the variation of thestep size in a computed interval can be observed. The simulation data is displayed via Mathematica’sListPlot.

In[37]:= TransientPlot[solutions, V$1[t], V$2[t],t, 0., 2.*10^−5, ShowSamplePoints −> True]

-65. 10

0.00001 0.000015 0.00002t

-1

-0.5

0.5

1

V$2[t]

V$1[t]

Out[37]= Graphics

SingleDiagram

With the option SingleDiagram you can choose whether to combine the traces of several in-terpolating functions in a single diagram or display them in a separate plot each. The de-fault SingleDiagram −> True causes all traces to be combined. To display an array of plots useSingleDiagram −> False. Note that it is possible to generate not only plots of circuit variables, butalso plots of expressions involving these variables. For example, the following graphics array contains

Page 128: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

126 2. Tutorial

a plot of the voltage across the capacitor Cload of the differential amplifier circuit from Section 2.7.2(see Figure 7.2). The capacitor voltage is given by the difference of the node voltages V$5 and V$4.

In[38]:= TransientPlot[transient, V$4[t], V$5[t] − V$4[t],t, 0., 10^−5, SingleDiagram −> False]

-62. 10

-64. 10

-66. 10

-68. 10

0.00001t

2

4

6

8

10

V$5[

-62. 10

-64. 10

-66. 10

-68. 10

0.00001t

3

4

5

6

V$4[

Out[38]= GraphicsArray

Page 129: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.8 Linear Symbolic Approximation 127

2.8 Linear Symbolic Approximation

2.8.1 Introduction to Symbolic Approximation

The Complexity Problem

If you have previous experiences with symbolic circuit analysis programs or if you have done someexperiments with Analog Insydes before reading this chapter you may have already become awareof a major obstacle which is inherent to symbolic computations. While the carefully selected examplecircuits analyzed in the preceding chapters all yield transfer functions of no more than a few linesin length minor modifications such as adding an element or two to the circuit or choosing a slightlymore complex transistor model may already lead to expressions of incredible size. In fact, expressioncomplexity increases exponentially with the number of symbols in your circuit descriptions, allowingfor full symbolic analysis of very small circuits only.

V1

C1

C2

R2 RE

RL

R1

Q1

RC

1 VCC2

4

6

3 5100k

2.2k

100n

47k 1k

1u

47kVout

Figure 8.1: Common-emitter amplifier with coupling capacitors and resistive load

Let us demonstrate this effect by computing the symbolic voltage transfer function of the common-emitter amplifier displayed in Figure 8.1. This circuit is essentially the same as the common-emitteramplifier from Section 2.3.1 (see Figure 3.1) except that coupling capacitors and a resistive load havebeen added.

Page 130: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

128 2. Tutorial

Following, the netlist description of the circuit is imported via the Analog Insydes commandReadNetlist (Section 3.10.1) from already existing simulator files. For more details refer to Sec-tion 2.9.2.

In[1]:= <<AnalogInsydes‘

In[2]:= ceamp = ReadNetlist["AnalogInsydes/DemoFiles/emitter.cir","AnalogInsydes/DemoFiles/emitter.out",KeepPrefix −> False, Simulator −> "PSpice"]

Out[2]= Circuit

From the netlist description, we set up a system of symbolic sparse tableau equations. Weuse a complexity-reduced transistor model from the Analog Insydes model library by specifying theoption ModelLibrary (Section 3.14.4).

In[3]:= ceampsta = CircuitEquations[ceamp,ElementValues −> Symbolic, Formulation −> SparseTableau,ModelLibrary −> "BasicModels‘"]

Out[3]= DAEAC, 3232

Then we solve the equations for the output voltage V$RL and extract the expression for V$RL fromthe result.

In[4]:= ceampvout = Together[V$RL /. First[Solve[ceampsta, V$RL]]]

Out[4]=C1 R1 R2 s2 C2 RC RE RL

C2 gm$Q1 RC RL Ro$Q1 Rpi$Q1 C2 Cbc$Q1 RC RE RL Ro$Q1 s C2 Cbx$Q1 RC RE RL Ro$Q1 s C2 Cbc$Q1 RC RE RL Rpi$Q1 s C2 Cbe$Q1 RC RE RL Rpi$Q1 s C2 Cbx$Q1 RC RE RL Rpi$Q1 s C2 Cbc$Q1 RC RL Ro$Q1 Rpi$Q1 s C2 Cbx$Q1 RC RL Ro$Q1 Rpi$Q1 s C2 Cbc$Q1 gm$Q1 RC RE RL Ro$Q1 Rpi$Q1 s C2 Cbx$Q1 gm$Q1 RC RE RL Ro$Q1 Rpi$Q1 s C2 Cbc$Q1 Cbe$Q1 RC RE RL Ro$Q1 Rpi$Q1 s2 C2 Cbe$Q1 Cbx$Q1 RC RE RL Ro$Q1 Rpi$Q1 s2 V1

R1 R2 RC R1 R2 RE R1 RC RE R2 RC RE R1 R2 Ro$Q1 R1 RE Ro$Q1 R2 RE Ro$Q1 R1 RC Rpi$Q1 R2 RC Rpi$Q1 R1 RE Rpi$Q1 R2 RE Rpi$Q1 R1 Ro$Q1 Rpi$Q1 R2 Ro$Q1 Rpi$Q1 gm$Q1 R1 RE Ro$Q1 Rpi$Q1 gm$Q1 R2 RE Ro$Q1 Rpi$Q1 C1 R1 R2 RC RE s 153 C2 Cbe$Q1 Cbx$Q1 R1 R2RC RE Ro$Q1 Rpi$Q1 s3 C1 C2 Cbc$Q1 R1 R2 RC RL Ro$Q1 Rpi$Q1 s3 C2 Cbc$Q1 Cbe$Q1 R1 R2 RC RL Ro$Q1 Rpi$Q1 s3 C1 C2 Cbx$Q1 R1 R2 RC RL Ro$Q1 Rpi$Q1 s3 C2 Cbe$Q1 Cbx$Q1 R1 R2RC RL Ro$Q1 Rpi$Q1 s3 C1 C2 Cbe$Q1 R1 R2 RE RL Ro$Q1 Rpi$Q1 s3 C2 Cbc$Q1 Cbe$Q1 R1 R2 RE RL Ro$Q1 Rpi$Q1 s3 C2 Cbe$Q1 Cbx$Q1 R1 R2 RE RL Ro$Q1 Rpi$Q1 s3 C2 Cbc$Q1 Cbe$Q1 R1 RC RE RL Ro$Q1 Rpi$Q1 s3 C2 Cbe$Q1 Cbx$Q1 R1 RC RE RL Ro$Q1 Rpi$Q1 s3 C2 Cbc$Q1 Cbe$Q1 R2 RC RE RL Ro$Q1 Rpi$Q1 s3 C2 Cbe$Q1 Cbx$Q1 R2 RC RE RL Ro$Q1 Rpi$Q1 s3 C1 C2 Cbc$Q1 gm$Q1 R1 R2 RC RE RL Ro$Q1 Rpi$Q1 s3 C1 C2 Cbx$Q1 gm$Q1 R1 R2 RC RE RL Ro$Q1 Rpi$Q1 s3 C1 C2 Cbc$Q1 Cbe$Q1 R1 R2 RC RE RL Ro$Q1 Rpi$Q1 s4 C1 C2 Cbe$Q1 Cbx$Q1 R1 R2 RC RE RL Ro$Q1 Rpi$Q1 s4

Page 131: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.8 Linear Symbolic Approximation 129

Even for this very small circuit we obtain a transfer function which contains more than productterms. If you are not impressed yet try calculating the symbolic transfer function of two amplifierstages connected in series, or rather, use ComplexityEstimate (Section 3.11.1) to get an estimate ofthe expression size.

Analog Insydes provides the command ComplexityEstimate for computing an estimate of the num-ber of product terms in a transfer function computed from a symbolic matrix equation A x b(note that the equations have to be given as a system of AC circuit equations). More precisely, thefunction computes a lower bound for the number of product terms in the determinant of A. For ourcommon-emitter amplifier this yields the following estimate:

In[5]:= ComplexityEstimate[ceampsta]

Out[5]= 185

A primary goal of symbolic circuit analysis is to give us qualitative insight into circuit behavior.From a symbolic formula we can read off which circuit elements have an influence on particularcircuit characteristics, such as voltage gains or poles and zeros, and we can draw conclusions onhow to modify element values in order to make a circuit meet some performance specifications. Itis quite obvious, though, that this requires the formulas to be rather small – ideally no more thanone line on the screen – because an expression as large as the one above hardly yields any insight.Unfortunately, there is little we can do to reduce the size of symbolic analysis results in a purelyalgebraic way. Algebraic simplifications such as factoring and cancelling common terms seldom havea sufficiently large impact on expression complexity because transfer functions are usually composedof irreducible polynomials. In addition, factored or partially factored expressions are not necessarilyeasier to understand than their expanded forms. Exact symbolic analysis is therefore infeasible formost circuits of practical size.

Approximating Symbolic Expressions

There are two ways to cope with the complexity problem. The first one is to keep circuit and devicemodels always as simple as possible. Carefully balancing model accuracy and simplicity holds thekey to obtaining meaningful results from symbolic circuit analysis programs, so any knowledge abouta particular analysis task should be exploited before running the analyzer. For instance, if our taskwas to find a symbolic expression describing the voltage gain of the common-emitter amplifier in thepassband frequency range for a high-impedance load we should short-circuit the coupling capacitors,neglect the load resistor, and use a transistor model which just meets our accuracy requirements.In other words, to obtain compact results we should model and analyze the circuit exactly like wealready did in Chapter 2.3. The major disadvantage of such a-priori simplifications on circuit levelis, however, that we cannot always control the final error in our computations which is invariablyintroduced by neglecting some elements.

The second approach to the generation of interpretable formulas is known as symbolic approximationor symbolic simplification, which refers to a whole family of hybrid symbolic/numeric algorithms forexpression simplification. Symbolic approximation techniques require more numerical knowledgeabout the circuit under examination than manual simplifications but yield compact expressions withpredictable error in a fully automatic way. The basic idea behind all these algorithms is to comparethe magnitudes of symbolic terms in a transfer function or a system of equations on the basis of

Page 132: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

130 2. Tutorial

numerical reference values and then to discard all those terms which have negligible influence onthe result. In most cases, this leads to a dramatic reduction of expression complexity, thus allowingfor approximate symbolic analysis of reasonably large circuits.

2V0 3

R1

R4

R3

R2

1

Figure 8.2: Double voltage divider

To understand how symbolic approximation works let’s look at a simple example – the transferfunction of the double voltage divider shown in Figure 8.2:

In[6]:= doubleVoltageDivider =Netlist[

V0, 1, 0, V0,R1, 1, 2, R1,R2, 2, 0, R2,R3, 2, 3, R3,R4, 3, 0, R4

]

Out[6]= NetlistRaw, 5

In[7]:= dvdmna = CircuitEquations[doubleVoltageDivider];DisplayForm[dvdmna]

Out[8]//DisplayForm=

1R1 1R1 0 1

1R11R1 1R2 1R3 1R3 0

0 1R31R3 1R4 0

1 0 0 0

.

V$1V$2V$3I$V0

000V0

In[9]:= tfdvd = (V$3 / V0) /. First[Solve[dvdmna, V$3]]

Out[9]=R2 R4

R1 R2 R1 R3 R2 R3 R1 R4 R2 R4

Without any additional knowledge about the circuit this transfer function cannot be simplified muchfurther algebraically. Now, let’s assume that in this particular circuit the values of R1 and R2 areapproximately equal, as well as those of R3 and R4, but that R1 and R2 have much smaller values

Page 133: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.8 Linear Symbolic Approximation 131

than R3 and R4: R1 R2 R3R4. Under these conditions we can discard the product term R1 R2 inthe denominator of the transfer function because it is the product of two small quantities and thuscontributes little to the total value of the expression as compared to the other terms:

In[10]:= simptfdvd = tfdvd /. R1*R2 −> 0

Out[10]=R2 R4

R1 R3 R2 R3 R1 R4 R2 R4

The resulting function can now be factored and simplifies to a more meaningful form.

In[11]:= Factor[simptfdvd]

Out[11]=R2 R4

R1 R2 R3 R4

This approximate formula holds for all sets of resistor values for which the condition R1 R2 R3 R4is satisfied, but no longer in the general case. Symbolic approximation thus always implies a trade-offbetween low expression complexity on the one hand and generality and precision on the other.

Numerical Reference Values: Design Points

Deciding on which terms to discard from a symbolic expression on the basis of vague informationsuch as "X is much larger than Y" may be feasible for humans but is virtually impossible to do for acomputer. This is particularly true when an expression contains a large number of symbols in non-trivial combinations. To enable a computer to reduce a symbolic expression to its dominant contentwe must provide input which allows for clear yes-or-no decisions on whether a term is importantor negligible. This input can be given as a set of accompanying numerical reference values for thesymbols, known as a design point, based on which the contributions of compound symbolic termscan be compared numerically. Design-point values need not always be the exact element values forwhich a circuit works within specifications. However, the reference values should reflect the relativemagnitude relations among the symbols in a realistic way.

In the case of the double voltage divider we could express the conditions on the relative magnitudesof the resistors by an (arbitrary) numerical assignment of design-point values such as R1 R2 and R3 R4 . We rewrite the netlist of the double voltage divider keeping both a symbolicelement value and an associated design-point value together in each netlist entry.

In[12]:= doubleVoltageDivider =Netlist[

V0, 1, 0, Symbolic −> V0, Value −> 1.,R1, 1, 2, Symbolic −> R1, Value −> 10.,R2, 2, 0, Symbolic −> R2, Value −> 10.,R3, 2, 3, Symbolic −> R3, Value −> 1000.,R4, 3, 0, Symbolic −> R4, Value −> 1000.

]

Out[12]= NetlistRaw, 5

Now, we set up the corresponding equations using the option setting ElementValues −> Symbolic.The design-point values are then automatically stored in the DAEObject and can be extracted viaGetDesignPoint (Section 3.6.12).

Page 134: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

132 2. Tutorial

In[13]:= dvdmna = CircuitEquations[doubleVoltageDivider,ElementValues −> Symbolic]

Out[13]= DAEAC, 44

In[14]:= designpoint = GetDesignPoint[dvdmna]

Out[14]=V0 1., R1 10., R2 10., R3 1000., R4 1000.

With these reference values we can evaluate the symbolic expression numerically. Below, we applythe function HoldForm to the Plus operation which prevents the denominator from being evaluatedto a single number.

In[15]:= tfdvd /. Plus −> HoldForm[Plus] /. designpoint

Out[15]=10000.

Plus100., 10000., 10000., 10000., 10000.

By comparing the individual numerical values we, as well as a computer, can now clearly see thatthe first argument of the Plus expression, corresponding to the term R1 R2, contributes only tothe total value of the denominator. The term can thus be safely removed from the transfer functionif we allow for an error of, say, or less in the design point.

2.8.2 Solution-Based Symbolic Approximation

Groups of Symbolic Approximation Techniques

Symbolic approximation techniques can be divided into three different groups of methods whichperform Simplifications Before, During, or After the Generation of symbolic formulas (SBG, SDG,and SAG methods). The approach discussed above is thus an SAG, or solution-based, method be-cause we computed the complete transfer function first and then simplified it. While the principlebehind this SAG technique was demonstrated on the transfer function of a non-dynamic system itcan be applied to general transfer functions containing powers of the frequency variable s as well.In this case, all symbolic coefficients of the different powers of s are simplified separately up to agiven maximum error.

Approximating Transfer Functions

Analog Insydes provides the function ApproximateTransferFunction (Section 3.11.2) for solution-based symbolic approximation. The argument sequence is

ApproximateTransferFunction[tfunc, fvar, dp, maxerr]

where tfunc is a rational transfer function in the frequency variable fvar, dp is a design-point speci-fication, and maxerr is the maximum relative error of the simplified coefficients of fvar in the designpoint. The design point must be specified as a list of rules which associate numerical values withthe symbols in tfunc, and maxerr is a real number between and .

Page 135: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.8 Linear Symbolic Approximation 133

Let’s apply solution-based approximation to the transfer function of the common-emitter ampli-fier calculated in the preceding section. First, we extract the list of design-point values from theDAEObject using GetDesignPoint.

In[16]:= dpceamp = GetDesignPoint[ceampsta]

Out[16]=C1 1.107, C2 1.106, R1 100000., RC 2200.,

R2 47000., Rpi$Q1 2200., Ro$Q1 36400., Cbc$Q1 4.391012,Cbe$Q1 7.011011, gm$Q1 0.0808, Cbx$Q1 0., RE 1000.,V1 1., RL 47000., Simulator PSpice

Then we let ApproximateTransferFunction remove all numerical insignificant terms from the co-efficients of the frequency variable s, thereby allowing for a maximum design-point error of ineach coefficient. Note that a coefficient error does not imply error on the magnitude ofthe transfer function in the design point. Ideally, the coefficient error should be a common factorand thus cancel from numerator and denominator, yielding zero overall error in the design point.In practice, however, there is no direct correlation between the overall error and the maximumcoefficient error. The former is usually lower than the latter but may, in some cases, even be larger.

In[17]:= voutsimp = ApproximateTransferFunction[ceampvout,s, dpceamp, 0.1] // Together

Out[17]=C1 C2 gm$Q1 R1 R2 RC RL Rpi$Q1 s2 V1

C1 C2 Cbc$Q1 gm$Q1 R1 R2 RC RE RL Rpi$Q1 s3 V1 C1 C2 Cbc$Q1 Cbe$Q1 R1 R2 RC RE RL Rpi$Q1 s4 V1

R1 R2 gm$Q1 R1 RE Rpi$Q1 gm$Q1 R2 RE Rpi$Q1 C2 R1 R2 RL s C1 gm$Q1 R1 R2 RE Rpi$Q1 s C2 gm$Q1 R1 RE RL Rpi$Q1 s C2 gm$Q1 R2 RE RL Rpi$Q1 s C1C2 gm$Q1 R1 R2 RE RL Rpi$Q1 s2 C1 C2 Cbe$Q1 R1 R2 RE RL Rpi$Q1 s3 C1 C2 Cbc$Q1 gm$Q1 R1 R2 RC RE RL Rpi$Q1 s3 C1 C2 Cbc$Q1 Cbe$Q1 R1 R2 RC RE RL Rpi$Q1 s4

Here, the approximation process reduces the original transfer function to only significant terms.We can check the quality of the approximation by evaluating it with the design-point values andcomparing it graphically with the original function.

In[18]:= voutexactn[s_] = Together[ceampvout /. dpceamp]

Out[18]=470. s2 6.68943108 3.00693 s 2.54816109 s2

1.155761015 5.99391013 s 1.525451011 s2 1543.08 s3

1.19764106 s4

In[19]:= voutsimpn[s_] = voutsimp /. dpceamp

Out[19]=8.63878106 s2 0.0379242 s3 3.290211011 s4

3.083071010 1.53259109 s 3.92672106 s2 0.041331 s3

3.290211011 s4

For the following BodePlot we choose a linear scaling of the magnitude values to get a betterimpression of the true magnitude error. It turns out that the simplified expression (dashed line)approximates the original transfer function (solid line) quite well, although it comprises only aboutone tenth of the terms of the latter.

Page 136: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

134 2. Tutorial

In[20]:= BodePlot[voutexactn[2. Pi I f], voutsimpn[2. Pi I f],f, 1., 1.*10^9, MagnitudeDisplay −> Linear]

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

0

0.5

1

1.5

2

Magnitude

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-350-300-250-200-150-100-500

Phase (deg)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

Out[20]= Graphics

2.8.3 Equation-Based Symbolic Approximation

Coping with the Limit of Solution-Based Approximation Techniques

Solution-based expression approximation techniques have one obvious drawback: they can only beapplied to symbolic transfer functions after these have been computed from systems of circuit equa-tions. This precludes the use of SAG techniques in those cases where calculating an unsimplifiedsymbolic transfer function is technically impossible. In practice, the limit is reached very quickly,because even for small analog building blocks with ten or less active devices the term count of thetransfer functions can be expected to grow into the millions, if not into billions.

To cope with these cases we must resort to simplification-before-generation techniques which sim-plify the problem beforehand, i.e. even before a transfer function is computed symbolically. Suchsimplifications can be done manually on circuit level, for instance by replacing negligible componentswith zero-admittance or zero-impedance elements. However, as controlling the error introduced bymanual simplifications is usually difficult, Analog Insydes provides an automatic and more reliableSBG algorithm which operates on systems of symbolic circuit equations. Hence, it belongs to theclass of equation-based approximation techniques.

Given a system of symbolic linear circuit equations in matrix form A x b and a design point,the equation-based approximation algorithm implemented in Analog Insydes finds and removes allsymbolic matrix entries whose numerical contribution to the design-point value of the transfer func-tion is negligible, thereby keeping track of the accumulated approximation error. As the number ofremoved matrix entries is usually quite large the solution of the resulting simplified matrix equationwill be much less complex than the solution of the unsimplified system. Therefore, we can calculatesimplified symbolic transfer functions without ever having to compute the full expressions at all.

Page 137: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.8 Linear Symbolic Approximation 135

This will be illustrated by an example right after the following explanations on how to specify designpoints for the matrix approximation function.

Design Points for Matrix Approximation

Since the matrix approximation algorithm can work with multiple design points with individualerror bounds, the design points must be specified in a slightly different form as compared to thosefor solution-based approximation:

designpoint = symbol −> value, , MaxError −> maxerr1,symbol −> value, , MaxError −> maxerr2,

Note that for symbols which are not specified here the corresponding design-point value is auto-matically extracted from the design point stored in the DAEObject. Each set of design-point valuesmust be accompanied by a rule with the keyword MaxError on its left-hand side. This rule specifiesthe maximum relative error by which the magnitude of the solution of the approximated system ofequations may deviate from the value of the magnitude of the transfer function in the correspondingdesign point. The error bound maxerr must be a real number greater than zero. Note that the errordefinition used here is different from the one used with ApproximateTransferFunction in that itpertains to the total error on the magnitude of the entire transfer function at certain frequencies andnot to the error on individual coefficients. It is thus a more reliable error measure than the coefficienterror.

Let’s define a design point for applying matrix approximation to our double-voltage-divider example(see Figure 8.2 in Section 2.8.1). We can use the same numerical values for the resistors and thevoltage source as we did for solution-based approximation. If we allow for up to magnitudeerror of the simplified result with respect to the unsimplified solution we must write the error boundspecification as MaxError −> 0.05. Note that although we have only one single design point herewe must wrap the list of rules into an additional level of list braces.

In[21]:= dpdvd = MaxError −> 0.05;

Approximating Symbolic Matrix Equations

Symbolic matrix equations can be approximated by means of the commandApproximateMatrixEquation (Section 3.11.3), which has the following command syntax:

ApproximateMatrixEquation[dae, var, dp, opts]

The first argument dae represents a DAEObject containing small-signal circuit equations in matrixform as returned by CircuitEquations, var specifies the variable for which the equations should besolved after approximation, and dp denotes a list of design points as discussed above. The remainingargument opts is a sequence of options which may also be empty.

We are now ready to try out equation-based approximation on the MNA equations of the voltagedivider. For comparison, here are the original unsimplified equations again.

Page 138: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

136 2. Tutorial

In[22]:= DisplayForm[dvdmna]

Out[22]//DisplayForm=

1R1 1R1 0 1

1R11R1 1R2 1R3 1R3 0

0 1R31R3 1R4 0

1 0 0 0

.

V$1V$2V$3I$V0

000V0

Since we are interested in a simplified solution for the voltage at the output node 3, we specify V$3as the variable for which the equations are to be approximated.

In[23]:= approxdvd = ApproximateMatrixEquation[dvdmna,V$3, dpdvd];

DisplayForm[approxdvd]

Out[24]//DisplayForm=

0 0 0 1

1R11R1 1R2 0 0

0 1R31R3 1R4 0

1 0 0 0

.

V$1V$2V$3I$V0

000V0

The result is a matrix equation from which all numerical irrelevant symbolic terms have been re-moved. We can now compute a simplified transfer function directly by solving the approximatedequations.

In[25]:= Solve[approxdvd, V$3]

Out[25]= V$3 R2 R4 V0

R1 R2 R3 R4

In this case, we obtain identical results from both equation-based and solution-based approximation.However, as opposed to the latter, equation-based approximation does not require an exact symbolicsolution to be computed first. In such a small example this advantage makes nearly no difference,but it will turn out to be a key factor in larger applications.

Approximating the Equations of the Amplifier

As an example for a slightly larger application let’s continue with our well-known common-emitteramplifier once more. Again, we start by setting up a design point forApproximateMatrixEquation , reusing the numerical values we defined for simplifying the exactsolution with ApproximateTransferFunction. For matrix approximation, however, we still needsome more numerical information. While the SAG algorithm approximates the coefficients of a trans-fer function independently, the SBG method uses the total value of a transfer function in a designpoint as reference quantity. Therefore, we must specify one or more particular frequency points atwhich ApproximateMatrixEquation should monitor the change in the value of the transfer functioncaused by the removal of terms.

Here, we might be interested in computing a simplified expression describing the passband voltagegain of the amplifier. The Bode plot above shows that the passband extends from about Hz toseveral MHz, so we choose a design-point value for the operating frequency in the middle of thepassband, e.g. at f kHz. The corresponding value for the Laplace frequency s is then given by

Page 139: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.8 Linear Symbolic Approximation 137

s Π I f . Finally, we limit the approximation error in this frequency point to of the originalmagnitude value.

In[26]:= dpceamp2 = s −> 2. Pi I 10^4, MaxError −> 0.1;

In the next step, we approximate the sparse tableau equations of the amplifier for the given design-point data with respect to the output voltage V$RL.

In[27]:= approxceamp = ApproximateMatrixEquation[ceampsta,V$RL, dpceamp2]

Out[27]= DAEAC, 3232

Then we solve the approximated system for V$RL to obtain a simplified voltage transfer function.

In[28]:= voutsimp2 = (V$RL / V1) /. First[Solve[approxceamp, V$RL]]

Out[28]= RCRE

By equation-based approximation we have reduced the symbolic transfer function to the simplequotient of two resistor values. In comparison to the original transfer function, which is composedof more than terms, this may seem to be a rather surprising result. From a technical point ofview, however, the extreme reduction of complexity is not surprising at all because the amplifierwas designed to have a voltage gain of approximately −RC/RE. Therefore, our approximate symbolicanalysis just extracted knowledge which was put into this circuit structure at the time of its design.

Again, we evaluate the simplified expression with the design-point values and compare the resultwith the original transfer function.

In[29]:= voutsimp2n[s_] = voutsimp2 /. dpceamp

Out[29]= 2.2

In[30]:= BodePlot[voutexactn[2. Pi I f], voutsimp2n[2. Pi I f],f, 1., 1.*10^9, MagnitudeDisplay −> Linear,PlotRange −> 0, 2.5, Automatic]

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

0.5

1

1.5

2

2.5

Magnitude

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-350-300-250-200-150-100-500

Phase (deg)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

Out[30]= Graphics

It becomes immediately apparent from the plots that the result obtained by means of SBG does notconstitute a global description of the frequency response of the amplifier. As opposed to the SAG

Page 140: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

138 2. Tutorial

solution, the SBG solution is only valid in the passband region and does not reflect the behavior theamplifier exhibits for very low or very high frequencies. But remember that such a local approxima-tion was precisely what we asked for because we specified only one reference point on the frequencyaxis at kHz.

Equation-based approximation thus allows us to compute reduced-order circuit models for limitedfrequency ranges. Of course, we can also define several frequency points at whichApproximateMatrixEquation monitors the approximation error in order to extend range of validityof a simplified expression. However, best results in terms of expression complexity are usuallyobtained through local approximations.

2.8.4 Combining SBG and SAG

While equation-based approximation can reduce the complexity of a symbolic expression greatly theresult may still contain some insignificant terms. So it is generally a good idea to apply solution-based simplification to such a transfer function as well in order to remove the remaining irrelevantcontributions. The following example demonstrates the combination of SBG and SAG.

First, we use matrix approximation to compute a reduced-order transfer function of the amplifierfrom Section 2.8.1 (see Figure 8.1) which is valid for the passband and also for low frequencies.Therefore, we add a second reference point at Hz to the list of design points. We allow for an errorof up to in that point because we do not need high precision there.

In[31]:= dpceamp3 = s −> 2. Pi I 10^4, MaxError −> 0.1,s −> 2. Pi I 1, MaxError −> 0.2;

In the subsequent call to ApproximateMatrixEquation we specify the optionCompressEquations −> True. The effect of this option is that all rows and columns of the matrixequation which are not needed to compute the variable of interest will be deleted after approxima-tion. Unlike approximation this is a mathematically exact operation, so no further information willbe lost. The benefit gained from compressing a matrix equation is a speed-up in solving the system.

In[32]:= approxceamp3 = ApproximateMatrixEquation[ceampsta,V$RL, dpceamp3, CompressEquations −> True]

Out[32]= DAEAC, 2525

With the CompressEquations option the approximated equations are reduced from a to a system without changing the symbolic solution for V$RL. The compression factor usuallyincreases with larger matrix sizes and error bounds. Solving the approximated system yields thefollowing expression.

Page 141: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.8 Linear Symbolic Approximation 139

In[33]:= voutsimp3 = Together[V$RL /. First[Solve[approxceamp3, V$RL]]]

Out[33]=C1 C2 R1 R2 RL

RC RE s2 RC Rpi$Q1 s2 gm$Q1 RC Ro$Q1 Rpi$Q1 s2 V1 R1 RC RE R2 RC RE R1 RE Ro$Q1 R2 RE Ro$Q1 R1 RC Rpi$Q1 R2 RC Rpi$Q1 R1 Ro$Q1 Rpi$Q1 R2 Ro$Q1 Rpi$Q1 gm$Q1 R1 RE Ro$Q1 Rpi$Q1 gm$Q1 R2 RE Ro$Q1 Rpi$Q1 C1 R1 R2 RC RE s C2 R1 RC RE RL s C2 R2 RC RE RL s C1 R1 R2 RE Ro$Q1 s Cbc$Q1 R1 R2 RE Ro$Q1 s C2 R1 RC RE Ro$Q1 s C2 R2 RC RE Ro$Q1 s C2 R1 RE RL Ro$Q1 s 22 C2 Cbc$Q1 R1 R2 RC RE Ro$Q1 s2 C1 C2 R1 R2 RE RL Ro$Q1 s2 C2 Cbc$Q1 R1 R2 RE RL Ro$Q1 s2 C2 Cbe$Q1 R1 R2 RC RE Rpi$Q1 s2 C1 C2 R1 R2 RC RL Rpi$Q1 s2 C2 Cbe$Q1 R1 R2 RC RL Rpi$Q1 s2 C2 Cbe$Q1 R1 R2 RE RL Rpi$Q1 s2 C1 C2 R1 R2 RC Ro$Q1 Rpi$Q1 s2 C2 Cbc$Q1 R1 R2 RC Ro$Q1 Rpi$Q1 s2 C2 Cbe$Q1 R1R2 RC Ro$Q1 Rpi$Q1 s2 C1 C2 gm$Q1 R1 R2 RC RE Ro$Q1 Rpi$Q1 s2 C2 Cbc$Q1 gm$Q1 R1 R2 RC RE Ro$Q1 Rpi$Q1 s2 C1C2 R1 R2 RL Ro$Q1 Rpi$Q1 s2 C2 Cbc$Q1 R1 R2 RL Ro$Q1 Rpi$Q1 s2 C2 Cbe$Q1 R1 R2 RL Ro$Q1 Rpi$Q1 s2 C2 Cbc$Q1 gm$Q1 R1 R2RC RL Ro$Q1 Rpi$Q1 s2 C1 C2 gm$Q1 R1 R2 RE RL Ro$Q1 Rpi$Q1 s2 C2 Cbc$Q1 gm$Q1 R1 R2 RE RL Ro$Q1 Rpi$Q1 s2

As compared to the result of our previous equation-based simplification this transfer function is quitelengthy again. Still, approximating the matrix has reduced the degree of the solution. Therefore,we can apply solution-based approximation to compute a simplified transfer function which is morecompact than our SAG-only solution and valid over a larger frequency range than our first SBGresult.

In[34]:= voutSBGSAG = ApproximateTransferFunction[voutsimp3,s, dpceamp, 0.1]

Out[34]=C1 C2 gm$Q1 R1 R2 RC RL Ro$Q1 Rpi$Q1 s2 V1

gm$Q1 R1 RE Ro$Q1 Rpi$Q1 gm$Q1 R2 RE Ro$Q1 Rpi$Q1 C1 gm$Q1 R1 R2 RE Ro$Q1 Rpi$Q1 C2 gm$Q1 R1 RE RL Ro$Q1 Rpi$Q1

C2 gm$Q1 R2 RE RL Ro$Q1 Rpi$Q1 s C1 C2 gm$Q1 R1 R2 RE RL Ro$Q1 Rpi$Q1 s2

The common factor which appears in the coefficients of the numerator and the denominator of thistransfer function can be cancelled by algebraic simplification:

In[35]:= voutsimp3s = Simplify[voutSBGSAG]

Out[35]= C1 C2 R1 R2 RC RL s2 V1

RE R1 R2 C1 R1 R2 s 1 C2 RL s

The above result is very useful because it allows for reading off approximate symbolic expressionsfor the poles. To calculate these explicitly we must solve the denominator of the transfer functionfor s:

In[36]:= poles = Solve[Denominator[voutsimp3s] == 0, s]

Out[36]= s R1 R2C1 R1 R2

, s 1

C2 RL

From our SAG-only approximation (voutsimp) alone we cannot determine the poles so easily becausethe denominator is a polynomial of degree . On the other hand, the SBG-only approximation is

Page 142: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

140 2. Tutorial

too large to yield meaningful expressions for the poles. This shows that combining SBG with SAGtechniques can also be a powerful approach for computing other circuit characteristics than onlytransfer functions.

In[37]:= voutsimp3n[s_] = voutsimp3s /. dpceamp

Out[37]= 48.598 s2

1 0.047 s 147000. 470. sFinally, we plot this simplified transfer function together with the original function to visualize theeffects of our low-and-mid-frequency approximation. The Bode plot shows that the approximationis valid from zero frequency to the upper end of the passband at about MHz. High-frequencyeffects are not described because we did not specify a design point in the frequency region beyondthe passband.

In[38]:= BodePlot[voutexactn[2. Pi I f], voutsimp3n[2. Pi I f],f, 1., 1.*10^9, MagnitudeDisplay −> Linear,PlotRange −> 0, 2.5, Automatic]

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

0.5

1

1.5

2

2.5

Magnitude

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-350-300-250-200-150-100-500

Phase (deg)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

Out[38]= Graphics

2.8.5 Options for ApproximateMatrixEquation

ApproximateMatrixEquation can be called with a number of options, most of which are for veryadvanced usage only and need not be changed unless there appear to be problems with the de-fault settings. Since all options from Options[ApproximateMatrixEquation] are documented inSection 3.11.3, we will restrict ourselves to the discussion of the option SortingMethod. Note thatthe option CompressEquations has already been introduced in Section 2.8.4.

SortingMethod

ApproximateMatrixEquation removes negligible contributions from a matrix equation term by termfollowing a ranking scheme which causes the term with the smallest influence on the solution to beremoved first. The term ranking is obtained by sorting the list of the individual numerical influences

Page 143: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.8 Linear Symbolic Approximation 141

of all terms by least influence. If only one design point is present, the sorting order is obvious, butit is not obvious for two or more design points. For example, if removing matrix entry X causes amagnitude error of in design point and an error of in design point while the errorvalues for matrix entry Y are and respectively, which entry should be removed first?Removing X first would introduce a very small error in design point but an excessively large onein design point . On the other hand, Y has a much larger influence in design point than X butthe total error in both design points would be smaller if Y is removed first.

SortingMethod is an option which selects the sorting strategy that is applied to the influence listto obtain the term rankings. By default, terms are ranked by least influence on the solution inthe primary design point, that is design point . In the above example, this strategy would give Xprecedence over Y. The corresponding option setting in Options[ApproximateMatrixEquation] is

SortingMethod −> PrimaryDesignPoint

The other available strategy ranks terms by least arithmetic mean influence in all design points,which would give Y precedence over X:

SortingMethod −> LeastMeanInfluence

Usually, LeastMeanInfluence is the better choice if the calculations involve more than one designpoint. To examine the effect of selecting a different term ranking method we repeat the previousapproximation run with SortingMethod −> LeastMeanInfluence.

In[39]:= approxceamp4 = ApproximateMatrixEquation[ceampsta,V$RL, dpceamp3, CompressEquations −> True,SortingMethod −> LeastMeanInfluence]

Out[39]= DAEAC, 1919

Solving these approximated equations now yields a much simpler expression.

In[40]:= voutsimp4 = V$RL /. First[Solve[approxceamp4, V$RL]]

Out[40]=C1 C2 gm$Q1 R1 R2 RC RL Rpi$Q1 s2 V1

1 C2 RL s R1 R2 gm$Q1 R1 RE Rpi$Q1 gm$Q1 R2 RE Rpi$Q1 C1 gm$Q1 R1 R2 RE Rpi$Q1 s

Here, we determined the approximation sequence by using the average of the design-point errors assorting criterion. In our first approximation run with two design points the term influences on thesecond design point at Hz were not taken into consideration when the ranking was computed. Theerror bound at design point was reached quickly because some terms were removed first whichhad low influence in design point but large influence in design point .

Page 144: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

142 2. Tutorial

2.9 Frequency-Domain Analysis of Linear Circuits

In the preceding chapters, many aspects of the circuit modeling and analysis functionality providedby Analog Insydes have been introduced in a rather loosely connected fashion. In this chapter wewill now discuss how these techniques and functions can be applied to small-signal analysis (or ACanalysis) of linear or linearized circuits in the frequency domain. Primarily, this includes classicalsymbolic analysis tasks such as computing transfer functions, input and output impedances, or calcu-lating two-port parameters. However, we will see that by making use of Mathematica’s vast symboliccomputation and expression manipulation capabilities it is easy to extend the standard techniquesfor calculating nominal small-signal characteristics to the analysis of many other quantities whichare of interest to circuit designers. Such quantities are, for example, sensitivities or effects caused bynonidealities of circuit elements due to process tolerances or temperature dependence.

2.9.1 Transistor Models

MOS Transistors

We will show how Analog Insydes can be used to solve practical AC circuit analysis problems bydemonstrating the above-mentioned analysis tasks on a number of basic transistor circuits. AlthoughAnalog Insydes has built-in device models (see Chapter 4.3), we start with implementing a set ofsuitable transistor models in order to better understand the modeling language of Analog Insydes.Since bipolar transistor models have already been dealt with to some extent, we begin with adiscussion of MOS field-effect transistor models.

G G

D D

S S

B B

Figure 9.1: NMOS (left) and PMOS (right) transistor

Figure 9.1 shows the schematic representations of an n-channel type (NMOS) and a p-channel type(PMOS) MOSFET on the left-hand side and right-hand side, respectively. The letters D, G, B, andS denote the drain, gate, bulk (substrate), and source connections of the devices. For both NMOSand PMOS transistors, the small-signal operation at DC or low frequencies is characterized by thesmall-signal equivalent circuit shown in Figure 9.2. The symbol VGS represents the gate-source volt-age, which is the main controlling factor for the drain current of the MOSFET, and VBS denotes thebulk-source, or back-gate, voltage. The model parameters of the small-signal equivalent circuits arethe transconductance gm, the drain-source conductance GDS and the back-gate transconductance gmb,which is usually, but not always, considerably smaller than gm.

Page 145: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.9 Frequency-Domain Analysis of Linear Circuits 143

VGS

gmb*VBS

B

VBS

GDS

gm*VGS

D

G

SS

Figure 9.2: Low-frequency small-signal model for MOS transistors

To describe the MOSFET AC operation at higher frequencies more accurately a number of parasiticcapacitances are added to the low-frequency model, namely the gate-source and gate-drain capac-itances CGS and CGD, and the bulk-source and bulk-drain capacitances CBS and CBD. The resultinghigh-frequency AC model is displayed in Figure 9.3. For simplicity, we have neglected the ohmicresistances in the drain and source regions which are usually accounted for by two additional resis-tors in between the physical drain and source connections and the corresponding terminals of theinternal MOSFET device.

VGS

gmb*VBS

B

VBSGDS

CBS

gm*VGS

CBDD

G

SS

CGS

CGD

Figure 9.3: High-frequency small-signal model for MOS transistors

Implementation of Small-Signal MOS Transistor Models

For the following calculations we do not need the high-frequency MOSFET equivalent circuit. There-fore, we only implement the low-frequency model at this point. The former will be dealt with laterwhen you have learned more about advanced techniques for associating numerical design-pointvalues with symbolic subcircuit parameters.

In[1]:= <<AnalogInsydes‘

Page 146: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

144 2. Tutorial

In[2]:= lfMOSmodel =Circuit[

Model[Name −> MOSFET,Selector −> LowFrequency,Scope −> Global,Ports −> D, G, S, B,Parameters −> gm, gmb, Gds,Definition −>

Netlist[VCG, G, S, D, S, gm,VCB, B, S, D, S, gmb,GDS, D, S, Gds

]]

]

Out[2]= Circuit

To store the model definition in the global subcircuit database we expand the Circuit object usingthe function ExpandSubcircuits (Section 3.4.1). The contents of the database can be inspected withthe command GlobalSubcircuits (Section 3.3.4).

In[3]:= ExpandSubcircuits[lfMOSmodel];GlobalSubcircuits[]

Out[4]= MOSFET, LowFrequency

2.9.2 Transfer Functions

A CMOS Differential Amplifier

The most basic application of linear symbolic circuit analysis is to compute transfer functions asanalytic expressions of the circuit parameters and the Laplace frequency s. For instance, consider thesingle-ended CMOS differential amplifier stage shown in Figure 9.4 where we might be interested incomputing the AC transfer function from the input voltage at node 1 to the output voltage acrossthe load capacitor CL.

Page 147: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.9 Frequency-Domain Analysis of Linear Circuits 145

41

3

M1 M2

IBIAS

VDD6

M4M3

V1 V2

5

2

CL

Figure 9.4: Single-ended CMOS differential stage

Following, the netlist description of the circuit is not written by hand, but imported via the AnalogInsydes command ReadNetlist (Section 3.10.1) from already existing simulator files. This func-tion supports the standard application of symbolic analysis which is the extension of a simulationperformed with a numerical circuit simulator. By this, a time-consuming and error-prone data con-version by hand is ruled out. In our case we start from a PSpice simulation. Thus, we need tospecify the PSpice netlist and output file in the ReadNetlist call, as well as the option settingSimulator −> "PSpice" for applying the simulator-specific interface functionality.

In[5]:= cmosdiffamp = ReadNetlist["AnalogInsydes/DemoFiles/CMOSdiffamp.cir","AnalogInsydes/DemoFiles/CMOSdiffamp.out",KeepPrefix −> False, Simulator −> "PSpice"]

Out[5]= Circuit

In[6]:= Statistics[cmosdiffamp]

Number of Capacitors : 1

Number of CurrentSources : 1

Number of VoltageSources : 3

Number of models MOSFET/MODN : 2

Number of models MOSFET/MODP : 2

Total number of elements : 9

The automatically generated netlist description of the amplifier contains generic model references ofthe form

Page 148: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

146 2. Tutorial

refdes, connections,Model −> Model[devtype, parset, refdes],Selector −> Selector[devtype, parset, refdes],Parameters −> Parameters[devtype, parset, refdes],

This allows for an easy exchange of device models and parameter sets for each device or groupof devices by means of pattern matching and rewriting. The command CircuitEquations (Sec-tion 3.5.1) makes use of the above syntax when automatically selecting device models for a specificanalysis mode.

Computing the Single-Input to Single-Ended Voltage Gain

Now, we are ready to analyze the circuit. In order to compute the voltage transfer function fromnode 1 to node 5 we must first set up a system of circuit equations for the small-signal configurationof the amplifier. This means that all DC sources, namely VDD and IBIAS, are set to zero. Moreover,all signal sources whose contribution is not of interest, i.e. V2, are set to zero as well. The resultingequivalent circuit is shown in Figure 9.5.

41

3

M1 M2

IBIAS=0

VDD=06

M4M3

V1=1 V2=0

5

2

CL

Figure 9.5: Differential stage, configuration for small-signal transfer function analysis

In the frequency domain, the relation between a response Ys, an excitation Xs, and the corre-sponding transfer function Hs of a linear system is given by the equation

Page 149: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.9 Frequency-Domain Analysis of Linear Circuits 147

Ys Hs Xs

Hence, the Laplace transform of the output signal, Ys, is identical to the transfer function if we letXs :

Xs $ Ys Hs

Therefore, we can obtain the transfer function of the differential amplifier by applying a unit voltageto the input and computing the output voltage V$5[s] at node 5 because V$5[s] H[s] for V1 .

In the following command line we select the low-frequency small-signal MOSFET model by applica-tion of the CircuitEquations option setting DefaultSelector −> LowFrequency (see Section 3.5.1).Additionally, we set up symbolic circuit equations in modified nodal formulation (which is thedefault for CircuitEquations):

In[7]:= mnacmos = CircuitEquations[cmosdiffamp,ElementValues −> Symbolic,DefaultSelector −> LowFrequency]

Out[7]= DAEAC, 99

Next, we solve the MNA equations for V$5 using the function Solve (Section 3.5.4):

In[8]:= solcmos = V$5 /. First[Solve[mnacmos, V$5]]

Out[8]=Gds$M1 Gds$M2 gm$M2

Gds$M1 Gds$M2 gm$M1 gm$M2 gm$M4gm$M1 Gds$M1 Gds$M2 gm$M1 gm$M2 V1

Gds$M1 gm$M1 gm$M1 V1 gm$M2 V2 Gds$M1 Gds$M1 gm$M1

Gds$M1 Gds$M2 gm$M1 gm$M2 Gds$M1 Gds$M3 gm$M3gm$M2 Gds$M1 Gds$M2 gm$M1 gm$M2 V2

Gds$M2 gm$M2 gm$M1 V1 gm$M2 V2 Gds$M2 Gds$M1 gm$M1 Gds$M1 Gds$M2 gm$M2

Gds$M1 Gds$M2 gm$M1 gm$M2 gm$M4 Gds$M1 Gds$M1 gm$M1

Gds$M1 Gds$M2 gm$M1 gm$M2 Gds$M1 Gds$M3 gm$M3Gds$M2 Gds$M2 gm$M2

Gds$M1 Gds$M2 gm$M1 gm$M2 Gds$M2 Gds$M4 CL s

Finally, we apply a list of replacement rules to replace the values of the DC sources and V2 by zero,set the input voltage V1 to , and rewrite the desired transfer function into canonical sum-of-productsform using the Mathematica function Together:

Page 150: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

148 2. Tutorial

In[9]:= tfcmos = Together[solcmos /. V1 −> 1, V2 −> 0, IBIAS −> 0, VDD −> 0]

Out[9]=Gds$M2 Gds$M3 gm$M1 Gds$M3 gm$M1 gm$M2 Gds$M2 gm$M1 gm$M3

gm$M1 gm$M2 gm$M3 Gds$M2 gm$M1 gm$M4 gm$M1 gm$M2 gm$M4 Gds$M1 Gds$M2 Gds$M3 Gds$M1 Gds$M2 Gds$M4 Gds$M1 Gds$M3 Gds$M4 Gds$M2 Gds$M3 Gds$M4 Gds$M2 Gds$M3 gm$M1 Gds$M3 Gds$M4 gm$M1 Gds$M1 Gds$M4 gm$M2 Gds$M3 Gds$M4 gm$M2 Gds$M1 Gds$M2 gm$M3 Gds$M1 Gds$M4 gm$M3 Gds$M2 Gds$M4 gm$M3 Gds$M2 gm$M1 gm$M3 Gds$M4 gm$M1 gm$M3 Gds$M4 gm$M2 gm$M3 Gds$M1 Gds$M2 gm$M4 Gds$M2 gm$M1 gm$M4 CL Gds$M1 Gds$M2 s CL Gds$M1 Gds$M3 s CL Gds$M2 Gds$M3 s CL Gds$M3 gm$M1 s CL Gds$M1 gm$M2 s CL Gds$M3 gm$M2 s CL Gds$M1 gm$M3 s CL Gds$M2 gm$M3 s CL gm$M1 gm$M3 s CL gm$M2 gm$M3 s

Note that alternatively one could use the functions UpdateDesignPoint (Section 3.6.14) andApplyDesignPoint (Section 3.6.13) to modify or insert design-point values.

Computing Differential Gains

Similarly, we can compute the differential gain of the amplifier by splitting up the input signal intotwo equal parts with opposite phase, i.e. V1 and V2 .

In[10]:= diffgain = Together[solcmos /. V1 −> 1/2, V2 −> −1/2, IBIAS −> 0, VDD −> 0]

Out[10]=Gds$M2 Gds$M3 gm$M1 Gds$M1 Gds$M3 gm$M2 2 Gds$M3 gm$M1 gm$M2

Gds$M2 gm$M1 gm$M3 Gds$M1 gm$M2 gm$M3 2 gm$M1 gm$M2 gm$M3 Gds$M2 gm$M1 gm$M4 Gds$M1 gm$M2 gm$M4 2 gm$M1 gm$M2 gm$M4

2 Gds$M1 Gds$M2 Gds$M3 Gds$M1 Gds$M2 Gds$M4 Gds$M1 Gds$M3 Gds$M4 Gds$M2 Gds$M3 Gds$M4 Gds$M2 Gds$M3 gm$M1 Gds$M3 Gds$M4 gm$M1 Gds$M1 Gds$M4 gm$M2 Gds$M3 Gds$M4 gm$M2 Gds$M1 Gds$M2 gm$M3 Gds$M1 Gds$M4 gm$M3 Gds$M2 Gds$M4 gm$M3 Gds$M2 gm$M1 gm$M3 Gds$M4 gm$M1 gm$M3 Gds$M4 gm$M2 gm$M3 Gds$M1 Gds$M2 gm$M4 Gds$M2 gm$M1 gm$M4 CL Gds$M1 Gds$M2 s CL Gds$M1 Gds$M3 s CL Gds$M2 Gds$M3 s CL Gds$M3 gm$M1 s CL Gds$M1 gm$M2 s CL Gds$M3 gm$M2 s CL Gds$M1 gm$M3 s CL Gds$M2 gm$M3 s CL gm$M1 gm$M3 s CL gm$M2 gm$M3 s

From this formula, the DC gain can be obtained by setting the complex Laplace frequency s :

In[11]:= diffgainDC = diffgain /. s −> 0

Out[11]=Gds$M2 Gds$M3 gm$M1 Gds$M1 Gds$M3 gm$M2 2 Gds$M3 gm$M1 gm$M2

Gds$M2 gm$M1 gm$M3 Gds$M1 gm$M2 gm$M3 2 gm$M1 gm$M2 gm$M3 Gds$M2 gm$M1 gm$M4 Gds$M1 gm$M2 gm$M4 2 gm$M1 gm$M2 gm$M4

2 Gds$M1 Gds$M2 Gds$M3 Gds$M1 Gds$M2 Gds$M4 Gds$M1 Gds$M3 Gds$M4 Gds$M2 Gds$M3 Gds$M4 Gds$M2 Gds$M3 gm$M1 Gds$M3 Gds$M4 gm$M1 Gds$M1 Gds$M4 gm$M2 Gds$M3 Gds$M4 gm$M2 Gds$M1 Gds$M2 gm$M3 Gds$M1 Gds$M4 gm$M3 Gds$M2 Gds$M4 gm$M3 Gds$M2 gm$M1 gm$M3 Gds$M4 gm$M1 gm$M3 Gds$M4 gm$M2 gm$M3 Gds$M1 Gds$M2 gm$M4 Gds$M2 gm$M1 gm$M4

Page 151: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.9 Frequency-Domain Analysis of Linear Circuits 149

2.9.3 Device Mismatch

Applying Matching Information

Many analog circuit designs, including our CMOS differential amplifier, rely upon the theoreticalassumption that some semiconductor devices are perfectly matched. For instance, the transistors M1and M2, as well as M3 and M4, must have equal small-signal characteristics to make the differentialstage function ideally, i.e. with zero offset voltage and infinite common-mode rejection ratio (CMRR).

For applying matching information Analog Insydes provides the function MatchSymbols (Sec-tion 3.6.15). All symbols of a matching group are replaced by a common symbol. In our example,the matching group specification "$M1", "$M2", "12" causes all symbols which end with "$M1"or "$M2" to be replaced by a symbol which ends with "12". Thus, gm$M1 and gm$M2 are replacedby gm12, as well as Gds$M1 and Gds$M2 are replaced by Gds12. For the amplifier stage this yieldsan enormous reduction of the expression size for the differential gain:

In[12]:= dgmatch = Simplify @ MatchSymbols[diffgainDC,"$M1", "$M2", "12", "$M3", "$M4", "34"]

Out[12]=gm12 Gds34 2 gm34

2 Gds12 Gds34 Gds34 gm34

Computing Common-Mode Gains with Mismatch

In practice, however, the matching condition cannot always be fulfilled completely because processtolerances or temperature gradients can cause slight differences in transistor parameters that wereoriginally meant to be identical. The result is a deviation from the nominal circuit behavior whichmay even be unacceptably large. Therefore, it is necessary to take possible performance degradationsdue to device mismatch into account during circuit design.

With a symbolic analyzer we can derive formulas which express circuit characteristics in terms ofnominal parameter values plus mismatch contributions. In Analog Insydes, accounting for mismatchis simply achieved by assigning the same symbolic element value to two nominally equal compo-nents and adding a "delta term" to one of the element values. Two resistors R1 and R2 with the samenominal value R would thus be assigned the values R and R + dR, respectively, where dR representsthe mismatch contribution.

To demonstrate this procedure let’s examine the influence of device mismatch on the common-modegain of the CMOS amplifier from Section 2.9.2 (see Figure 9.4). To consider the correspondingmismatch information, we set up a list of replacement rules. Since M1 and M2 should match, bothtransconductances gm$M1 and gm$M2 are assigned the value gm12. Mismatch is then accountedby adding the delta term dgm12 to the transconductance of gm$M2. Similarly, all other transistorparameter values are expressed in terms of a nominal value plus a mismatch term.

In[13]:= mismatchparams = gm$M1 −> gm12, Gds$M1 −> Gds12,gm$M2 −> gm12 + dgm12, Gds$M2 −> Gds12 + dGds12,gm$M3 −> gm34, Gds$M3 −> Gds34,gm$M4 −> gm34 + dgm34, Gds$M4 −> Gds34 + dGds34;

Page 152: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

150 2. Tutorial

First, we can compute the common-mode gain taking mismatch into account by applying the sameunit signal to both input nodes simultaneously, i.e. V1 V2 and by applying the above definedreplacement rules describing the device mismatch:

In[14]:= cmgmismatch = Together[solcmos /. mismatchparams/. V1 −> 1, V2 −> 1, IBIAS −> 0, VDD −> 0]

Out[14]=dgm12 dgm34 Gds12 dgm12 Gds12 Gds34 dGds12 dgm34 gm12

dGds12 Gds34 gm12 2 dgm12 Gds12 gm34 2 dGds12 gm12 gm34 dGds12 dGds34 Gds12 dGds34 dgm12 Gds12

dGds12 dgm34 Gds12 dGds34 Gds122 dgm34 Gds122 dGds12 dGds34 Gds34 dGds34 dgm12 Gds34 2 dGds12 Gds12 Gds34 2 dGds34 Gds12 Gds34 dgm12 Gds12 Gds34 2 Gds122 Gds34

dGds12 Gds342 dgm12 Gds342 2 Gds12 Gds342 dGds12 dgm34 gm12 dGds34 Gds12 gm12 dgm34 Gds12 gm12 dGds12 Gds34 gm12 2 dGds34 Gds34 gm12 2 Gds12 Gds34 gm12 2 Gds342 gm12 dGds12 dGds34 gm34 dGds34 dgm12 gm34 2 dGds12 Gds12 gm34 2 dGds34 Gds12 gm34 2 Gds122 gm34 dGds12 Gds34 gm34 dgm12 Gds34 gm34 2 Gds12 Gds34 gm34 2 dGds12 gm12 gm34 2 dGds34 gm12 gm34 2 Gds12 gm12 gm34 2 Gds34 gm12 gm34 CL dGds12 Gds12 s CL dgm12 Gds12 s CL Gds122 s CL dGds12 Gds34 s CL dgm12 Gds34 s 2 CL Gds12 Gds34 s CL Gds12 gm12 s 2 CL Gds34 gm12 s CL dGds12 gm34 s CL dgm12 gm34 s 2 CL Gds12 gm34 s 2 CL gm12 gm34 s

Now, we compute the common-mode gain in the ideal case where all mismatch terms are zero:

In[15]:= Simplify[cmgmismatch/. dgm12 −> 0, dGds12 −> 0, dgm34 −> 0, dGds34 −> 0]

Out[15]= 0

Just as expected, for perfectly matching devices the common-mode gain is zero.

In the presence of mismatch terms the common-mode gain is a rather lengthy transfer functionwhose size makes it hard to read off how the tolerances of individual circuit components contributeto the deviation from the nominal behavior. However, we can find out which mismatch terms havedominant influence by employing symbolic approximation methods (see Chapter 2.8). Below, wechoose the design-point values for the MOSFET small-signal parameters gm and Gds taken from thePSpice operating-point simulation. Note that the corresponding data is already included in the aboveimported Circuit object cmosdiffamp.

Assuming a transistor matching precision of the delta terms are given by multiplying the nominalvalues with .

In[16]:= dpcmos = CL −> 1.*10^−13,gm12 −> 6.*10^−5, dgm12 −> 6.*10^−7,Gds12 −> 3.*10^−7, dGds12 −> 3.*10^−9,gm34 −> 6.*10^−5, dgm34 −> 6.*10^−7,Gds34 −> 8.*10^−7, dGds34 −> 8.*10^−9;

With these design-point values we approximate the expression for the common-mode gain to acoefficient error of .

Page 153: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.9 Frequency-Domain Analysis of Linear Circuits 151

In[17]:= cmgSAG = ApproximateTransferFunction[cmgmismatch, s, dpcmos, 0.05] // Simplify

Out[17]=dgm12 Gds12 dGds12 gm12gm12 Gds12 Gds34 CL s

The numerator of the result indicates that the nonideal behavior is largely due to mismatch betweenM1 and M2. On the other hand, tolerances between M3 and M4 have little impact on common-modeoperation.

Computing CMRR

Using the same design point we can also simplify the differential DC gain a bit further, which yieldsthe known approximate gain formula for this amplifier topology:

In[18]:= dgSAG = ApproximateTransferFunction[dgmatch, s, dpcmos, 0.05] // Simplify

Out[18]=gm12

Gds12 Gds34

Having derived expressions for both the differential and the common-mode gain we can now cal-culate the common-mode rejection ratio which is defined as the quotient of both quantities. Welet s to focus on the DC component only.

In[19]:= CMRR = (dgSAG / cmgSAG) /. s −> 0

Out[19]=gm122

dgm12 Gds12 dGds12 gm12

The conclusion that can be drawn from this result is that increasing CMRR requires making thetransconductances gm12 of M1 and M2 larger.

2.9.4 Input and Output Impedances

Circuit Configuration for Impedance Calculations

Since input and output impedances are transfer functions just like voltage gains we can computethe former using the same circuit analysis procedures as for any other transfer function. An inputimpedance is the transfer function from the current flowing into a port to the voltage across thesame port (see Figure 9.6).

Page 154: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

152 2. Tutorial

Iin=1

V$in

circuit

Figure 9.6: Unit current source excitation for input impedance calculations

Likewise, an input admittance is the transfer function from a voltage across the port to the currentinto the port. The same applies to output impedances and admittances which are, in fact, just theinput impedances and admittances at a port which is designated as an output. Consequently, tocalculate an output impedance we must connect a unit current source to the port, set up a system ofcircuit equations, and solve for the port voltage.

Computing the Output Impedance of the CMOS Amplifier

To determine the output impedance of the differential amplifier (see Figure 9.4 in Section 2.9.2) wereplace the load capacitor by a stimulus current source as displayed in Figure 9.7.

41

3

M1 M2

IBIAS=0

VDD=06

M4M3

V1=0 V2=0

5

2

IZOUT=1

Figure 9.7: Differential amplifier, small-signal configuration for computing the output impedance

Page 155: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.9 Frequency-Domain Analysis of Linear Circuits 153

Replacing the load capacitor is done by editing our via ReadNetlist imported netlist. Therefore,we first remove the netlist entry for CL using the Analog Insydes command DeleteElements (Sec-tion 3.6.2) and in a second step we add an independent current source IZ using the commandAddElements (Section 3.6.1).

In[20]:= cmosdiffamp2 = DeleteElements[cmosdiffamp, CL];cmosdiffamp2 = AddElements[cmosdiffamp2,

IZ, 0, 5, IZout];

After the modification of the netlist we set up the modified nodal equations and solve for the voltageat the output port, i.e. V$5.

In[22]:= mnaZout = CircuitEquations[cmosdiffamp2,ElementValues −> Symbolic,DefaultSelector −> LowFrequency]

Out[22]= DAEAC, 99

In[23]:= zout = Together[V$5 /. First[Solve[mnaZout, V$5]]/. IBIAS −> 0, VDD −> 0, V1 −> 0, V2 −> 0, IZout −> 1]

Out[23]=Gds$M1 Gds$M2 Gds$M1 Gds$M3

Gds$M2 Gds$M3 Gds$M3 gm$M1 Gds$M1 gm$M2 Gds$M3 gm$M2 Gds$M1 gm$M3 Gds$M2 gm$M3 gm$M1 gm$M3 gm$M2 gm$M3

Gds$M1 Gds$M2 Gds$M3 Gds$M1 Gds$M2 Gds$M4 Gds$M1 Gds$M3 Gds$M4 Gds$M2 Gds$M3 Gds$M4 Gds$M2 Gds$M3 gm$M1 Gds$M3 Gds$M4 gm$M1 Gds$M1 Gds$M4 gm$M2 Gds$M3 Gds$M4 gm$M2 Gds$M1 Gds$M2 gm$M3 Gds$M1 Gds$M4 gm$M3 Gds$M2 Gds$M4 gm$M3 Gds$M2 gm$M1 gm$M3 Gds$M4 gm$M1 gm$M3 Gds$M4 gm$M2 gm$M3 Gds$M1 Gds$M2 gm$M4 Gds$M2 gm$M1 gm$M4

For matching the MOS transistors forming the differential pair and the current-mirror load we againapply the command MatchSymbols:

In[24]:= zoutmatch = Together @ MatchSymbols[zout,"$M1", "$M2", "12", "$M3", "$M4", "34"]

Out[24]=Gds12 2 Gds34 2 gm34

2 Gds12 Gds34 Gds34 gm34

As usual, this expression contains many numerically small terms which are identified and discardedby ApproximateTransferFunction . The output impedance is then given by the following simpleformula in terms of the drain-source conductances Gds12 and Gds34.

In[25]:= zoutSAG = ApproximateTransferFunction[zoutmatch, s, dpcmos, 0.05] // Simplify

Out[25]=1

Gds12 Gds34

Page 156: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

154 2. Tutorial

2.9.5 Two-Port Parameters

Two-Port Representations

It is easy to extend the analysis procedures for computing transfer functions to two-port parameteranalysis because two-port or, more generally, n-port matrices can be regarded as transfer functionsin several dimensions. Indeed, every single coefficient in a two-port matrix is a transfer functionfrom one port current or voltage to another, so we could obtain the four coefficients of a two-portmatrix by means of four separate transfer function analyses. However, we will apply a more efficientstrategy which allows for calculating complete n-port matrices in only one step.

I1

V2V1

I2

Figure 9.8: Two-port current and voltage reference directions

Figure 9.8 shows the voltages and currents at the terminals of a two port. The relation between theport quantities V, V, I, and I is generally given as a linear mapping of two equations in fourvariables:

p pp p

II

q qq q

VV

Solving these equations for any combination of two-port voltages or currents yields one of six pos-sible two-port representations known as the admittance, impedance, hybrid I and II, and cascade Iand II forms. For example, solving for I and I in terms of V and V results in the admittance, orY-matrix, representation

II

y yy y

VV

whose coefficients y y are known as the Y-parameters of the two port. Similarly, solving forV and V in terms of I and I yields the impedance, or Z-matrix, representation:

VV

z zz z

II

Page 157: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.9 Frequency-Domain Analysis of Linear Circuits 155

Stimulus Sources for Two-Port Calculations

A particular two-port matrix can be computed by connecting appropriate stimulus sources to theports and solving for the opposite port quantities. For instance, if we want to compute a Z-matrix wemust connect current sources to the ports, set up circuit equations and solve for the correspondingport voltages. Likewise, a Y-matrix is obtained by connecting voltage sources V1 and V2 to the portsand determining the port currents I$V1 and I$V2 in terms of these voltages.

V1 V2

I$V2I$V1

Y

Figure 9.9: Voltage source excitation for Y-matrix calculation

Note that a straightforward combination of the two-port circuit and the excitation sources as shownin Figure 9.9 will not yield an entirely correct result. The resulting Y-parameters would have a wrongsign because the positive reference directions for the branch currents of the voltage sources are notoriented according to the reference directions for two-port terminal currents.

Remember that the positive reference direction for the current and voltage in a circuit branch is alwaysdetermined by the order of the nodes in the corresponding netlist entry (see Chapter 2.2).

The reference direction for the port currents can be aligned with the two-port terminal currentdirections by reversing the order of the nodes in the netlist entries belonging to the stimulus sources.However, the voltage reference directions, whose initial settings were correct, are changed by thisoperation as well. Hence, to compensate this unwanted effect, the voltages must be given negativevalues in the netlist (see Figure 9.10).

-V1 -V2

I$V2I$V1

Y

Figure 9.10: Correct voltage source excitation for computing Y-parameters

Computing Y-Parameters

Let’s demonstrate the procedure for two-port analysis by calculating the Y-matrix of the circuit shownin Figure 9.11.

Page 158: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

156 2. Tutorial

I2I1

RBV1

gm*V1

CM

V2RO

Figure 9.11: Two-port circuit

As discussed in the preceding subsection we must connect stimulus voltage sources to the circuit asshown in Figure 9.12 and write the corresponding netlist. If you want to calculate two-port parame-ters of a circuit whose netlist was read by ReadNetlist, you can use DeleteElements (Section 3.6.2)and AddElements (Section 3.6.1) to edit the netlist.

1 2

0

I$V2I$V1

RB-V1

gm*V1

CM

-V2RO

Figure 9.12: Correct voltage source excitation for computing Y-parameters

In[26]:= twoport =Netlist[

V1, 0, 1, −V1,V2, 0, 2, −V2,RB, 1, 0, RB,CM, 1, 2, CM,VC1, 1, 0, 2, 0, gm,RO, 2, 0, RO

]

Out[26]= NetlistRaw, 6

Next, we set up a system of circuit equations and compute the port currents I$V1 and I$V2 asfunctions of the stimulus voltages V1 and V2.

Page 159: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.9 Frequency-Domain Analysis of Linear Circuits 157

In[27]:= twoportmna = CircuitEquations[twoport];DisplayForm[twoportmna]

Out[28]//DisplayForm=

1RB CM s CM s 1 0

gm CM s 1RO CM s 0 1

1 0 0 00 1 0 0

.

V$1V$2I$V1I$V2

00

V1V2

In[29]:= ypar = Solve[twoportmna, I$V1, I$V2]

Out[29]= I$V1 V1 CM RB s V1 CM RB s V2

RB,

I$V2 gm CM s V1 1RO

CM s V2

The Y-parameters of the two-port circuit are given by the coefficients of V1 and V2 on the right-handsides of the solutions.

In[30]:= yrhs = I$V1, I$V2 /. First[ypar];MatrixForm[yrhs]

Out[31]//MatrixForm=

V1CM RB s V1CM RB s V2RB

gm CM s V1 1RO CM s V2

To set up the Y-matrix we must extract the coefficient matrix from these two linear expressions, forexample by computing the Jacobian with respect to V1 and V2.

In[32]:= JacobianMatrix[eqs_, vars_] := Outer[D, eqs, vars]

In[33]:= ymatrix = JacobianMatrix[yrhs, V1, V2];MatrixForm[ymatrix]

Out[34]//MatrixForm=

1CM RB sRB CM s

gm CM s 1RO CM s

2.9.6 Advanced Transistor Modeling

Implementation of MOS Models with Inline Design-Point Information

By using the value-field keywords Value and Symbolic we can provide design-point informationin subcircuit or model definitions. However, directly specifying numerical values in the netlist def-inition of a model object hardly makes sense because, in general, different model instances havedifferent sets of design-point values. Therefore, instead of treating these values as global quantitieswe must pass individual parameter sets to every model instance.

The techniques for passing parameters to subcircuit instances have already been dealt with in Chap-ter 2.3, and the same approaches can be used to handle instance-specific design-point information.Here, we just have to observe the additional requirement that every element in a model netlist nowneeds two symbolic parameters: one that represents the symbolic value of the element and one thatis replaced by the associated numerical value during subcircuit expansion.

Page 160: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

158 2. Tutorial

For standard applications, you do not need to take care of these things as on the one hand Analog Insydesprovides a library with built-in device models and on the other hand there is no need to write netlists by handas this is automatically done by ReadNetlist. Following, we explain the internal model mechanism whichis implemented in the Analog Insydes model library.

Consider the following circuit description which contains a model definition for the high-frequencyMOSFET model introduced in Section 2.9.1 (see Figure 9.3). The symbolic element values are givenas arguments to the Symbolic options while the design-point values, denoted by the names witha trailing $ac, are given as arguments to the Value options. Both sets of symbols must appear inthe parameter lists of the model definitions to allow for passing design-point values from a modelreference to a model instance and to ensure that symbolic parameters are correctly instantiated.

In[35]:= hfMOSmodel =Circuit[

Model[Name −> MOSFET,Selector −> HighFrequency,Scope −> Global,Ports −> D, G, S, B,Parameters −> gm, gmb, Gds, Cgs, Cgd, Cbs, Cbd,

GM$ac, GMB$ac, GDS$ac, CGS$ac, CGD$ac, CBS$ac,CBD$ac,

Definition −> Netlist[CGS, G, S, Value −> CGS$ac, Symbolic −> Cgs,CGD, G, D, Value −> CGD$ac, Symbolic −> Cgd,VCG, G, S, D, S, Value −> GM$ac,

Symbolic −> gm,GDS, D, S, Value −> GDS$ac, Symbolic −> Gds,VCB, B, S, D, S, Value −> GMB$ac,

Symbolic −> gmb,CBD, B, D, Value −> CBD$ac, Symbolic −> Cbd,CBS, B, S, Value −> CBS$ac, Symbolic −> Cbs

]]

]

Out[35]= Circuit

In[36]:= ExpandSubcircuits[hfMOSmodel];GlobalSubcircuits[]

Out[37]=MOSFET, HighFrequency, MOSFET, LowFrequency

Generating Design Points

Please consider the circuit description of the differential amplifier circuit from Section 2.9.2 (see Fig-ure 9.4). From the netlist entries for M1 to M4 it becomes apparent how the design-point information isspecified for each transistor model instance. Values are assigned only to parameters which representnumerical information. No assignments are made to the corresponding symbolic model parametersto let them be instantiated automatically. Note again, that this is all taken care of automatically bythe command ReadNetlist.

Page 161: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.9 Frequency-Domain Analysis of Linear Circuits 159

Let’s examine the effects of the preceding parameter definitions and assignments by recalculating thesingle-input-to-single-ended voltage transfer function of the differential amplifier, this time using thehigh-frequency MOS model we just defined. First, we set up symbolic circuit equations using theoption setting DefaultSelector −> HighFrequency.

In[38]:= eqscmoshf = CircuitEquations[cmosdiffamp,ElementValues −> Symbolic,DefaultSelector −> HighFrequency]

Out[38]= DAEAC, 99

As a result of default parameter instantiation (see Chapter 2.3) unique symbolic values have beengenerated for all instances of the transistor model elements. In addition, the arguments of the Valuekeywords have been replaced by the numerical values specified in the model references. Therefore,we can now use GetDesignPoint to extract the design-point list from the DAEObject.

In[39]:= GetDesignPoint[eqscmoshf]

Out[39]=V2 0.0001, V1 1., CL 1.1013,

Cgs$M3 2.381013, Cgd$M3 0., gm$M3 0.0000654,Gds$M3 7.89107, gmb$M3 0.00002169999999999999, Cbd$M3 0.,Cbs$M3 0., Cgs$M4 2.381013, Cgd$M4 0., gm$M4 0.0000654,Gds$M4 7.89107, gmb$M4 0.00002169999999999999,Cbd$M4 0., Cbs$M4 0., Cgs$M1 2.331013,Cgd$M1 0., gm$M1 0.00005959999999999999, Gds$M1 3.01107,gmb$M1 0.0000441, Cbd$M1 0., Cbs$M1 0., Cgs$M2 2.331013,Cgd$M2 0., gm$M2 0.00005959999999999999, Gds$M2 3.01107,gmb$M2 0.0000441, Cbd$M2 0., Cbs$M2 0., Simulator PSpice

2.9.7 AC Analysis of the CMOS Amplifier

To conclude this chapter let’s carry out an AC analysis of the CMOS amplifier. Our task shall beto determine a symbolic formula which approximates the frequency response of the voltage gainto first order. We begin with importing the numerical data from the PSpice small-signal simulationapplying the Analog Insydes command ReadSimulationData (Section 3.10.3). Note that we have tospecify the simulator-specific option setting Simulator −> "PSpice".

In[40]:= data = ReadSimulationData["AnalogInsydes/DemoFiles/CMOSdiffamp.csd",Simulator −> "PSpice"]

Out[40]=V5 InterpolatingFunction1., 1.109,

In[41]:= tfcmosPSpice := "V(5)" /. First[data]

The Bode diagram of the simulation result shows that the transfer function has a dominant polewhich is responsible for the corner in the magnitude response at MHz.

Page 162: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

160 2. Tutorial

In[42]:= BodePlot[tfcmosPSpice[f], f, 1., 1.*10^9]

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-30

-20

-10

0

10

20

30

Magnitude (dB)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-100

-80

-60

-40

-20

0

Phase (deg)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

Out[42]= Graphics

Next, we set up a system of circuit equations in symbolic form. Remember that this requires speci-fying the optionElementValues −> Symbolic in the call to CircuitEquations. Furthermore, we use a complexity-reduced device model for the transistors by the option setting ModelLibrary −> "BasicModels‘"(see Section 3.14.4) as we shall not be interested in high-frequency parasitic effects.

In[43]:= stacmoshf = CircuitEquations[cmosdiffamp,ElementValues −> Symbolic, Formulation −> SparseTableau,ModelLibrary −> "BasicModels‘"]

Out[43]= DAEAC, 5050

We can now perform a numerical reference simulation within Analog Insydes to ensure that theimported data is correct and that the employed transistor models are sufficient for computing thesmall-signal voltage gain and the subsequent symbolic approximations. The corresponding AnalogInsydes command for carrying out a numerical small-signal analysis is ACAnalysis (Section 3.7.3).

In[44]:= reference = ACAnalysis[stacmoshf, V$CL, f, 1., 1.*^9]

Out[44]=V$CL InterpolatingFunction1., 1.109,

Within the Bode diagram we compare the results of the PSpice simulation and the Analog Insydessimulation. One can see that the curves match perfectly in the computed frequency range.

Page 163: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.9 Frequency-Domain Analysis of Linear Circuits 161

In[45]:= BodePlot[reference, tfcmosPSpice[f], V$CL[f],f, 1., 1.*10^9, ShowLegend −> False]

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-30

-20

-10

0

10

20

30

Magnitude (dB)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-100

-80

-60

-40

-20

0

Phase (deg)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

Out[45]= Graphics

Following, we can proceed with carrying out the symbolic approximation. Note that statistical in-formation concerning DAEObjects can be displayed via the Analog Insydes command Statistics(Section 3.6.17):

In[46]:= Statistics[stacmoshf]

Number of equations : 50

Number of variables : 50

Number of entries : 2500

Number of non−zero entries : 139

Complexity estimate : 184

You may ask yourself why we set up the sparse tableau above instead of modified nodal equations which wouldbe considerably smaller. The reason for this is that, in most cases, equation-based symbolic approximationtends to produce better results when applied to tableau equations.

To capture the corner in the magnitude response we select two representative design points on thefrequency axis, one to the left of the corner at kHz and the other to the right of the corner atMHz (see Chapter 2.8).

In[47]:= dpSBG = s −> 2. Pi 10^4 I, MaxError −> 0.1,s −> 2. Pi 10^6 I, MaxError −> 0.1;

Then, we approximate the tableau matrix with respect to the voltage across the load capacitor CL:

In[48]:= stacmoshfSBG = ApproximateMatrixEquation[stacmoshf, V$CL, dpSBG]

Out[48]= DAEAC, 5050

Please note the reduced complexity of the returned DAEObject inspected via Statistics:

Page 164: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

162 2. Tutorial

In[49]:= Statistics[stacmoshfSBG]

Number of equations : 50

Number of variables : 50

Number of entries : 2500

Number of non−zero entries : 87

Complexity estimate : 48

Next, we solve for the capacitor voltage V$CL to obtain a simplified transfer function:

In[50]:= tfcmoshf = Together[V$CL/. First[Solve[stacmoshfSBG, V$CL]]]

Out[50]=Gds$M2 Gds$M3 gm$M1 V1 Gds$M3 gm$M1 gm$M2 V1

Gds$M2 gm$M1 gm$M3 V1 gm$M1 gm$M2 gm$M3 V1 Gds$M2 gm$M1 gm$M4 V1 gm$M1 gm$M2 gm$M4 V1 Gds$M1 Gds$M3 gm$M2 V2 Gds$M3 gm$M1 gm$M2 V2 Gds$M1 gm$M2 gm$M3 V2 gm$M1 gm$M2 gm$M3 V2 Gds$M1 gm$M2 gm$M4 V2 gm$M1 gm$M2 gm$M4 V2

Gds$M1 Gds$M2 Gds$M3 Gds$M1 Gds$M2 Gds$M4 Gds$M1 Gds$M3 Gds$M4 Gds$M2 Gds$M3 Gds$M4 Gds$M2 Gds$M3 gm$M1 Gds$M3 Gds$M4 gm$M1 Gds$M1 Gds$M4 gm$M2 Gds$M3 Gds$M4 gm$M2 Gds$M1 Gds$M2 gm$M3 Gds$M1 Gds$M4 gm$M3 Gds$M2 Gds$M4 gm$M3 Gds$M2 gm$M1 gm$M3 Gds$M4 gm$M1 gm$M3 Gds$M4 gm$M2 gm$M3 Gds$M1 Gds$M2 gm$M4 Gds$M2 gm$M1 gm$M4 Cgd$M2 Gds$M1 Gds$M2 s CL Gds$M1 Gds$M2 s Cgd$M2 Gds$M1 Gds$M3 s Cgd$M4 Gds$M1 Gds$M3 s CL Gds$M1 Gds$M3 s Cgd$M2 Gds$M2 Gds$M3 s Cgd$M4 Gds$M2 Gds$M3 s CL Gds$M2 Gds$M3 s Cgd$M2 Gds$M3 gm$M1 s Cgd$M4 Gds$M3 gm$M1 s CL Gds$M3 gm$M1 s Cgd$M2 Gds$M1 gm$M2 s CL Gds$M1 gm$M2 s Cgd$M2 Gds$M3 gm$M2 s Cgd$M4 Gds$M3 gm$M2 s CL Gds$M3 gm$M2 s Cgd$M2 Gds$M1 gm$M3 s Cgd$M4 Gds$M1 gm$M3 s CL Gds$M1 gm$M3 s Cgd$M2 Gds$M2 gm$M3 s Cgd$M4 Gds$M2 gm$M3 s CL Gds$M2 gm$M3 s Cgd$M2 gm$M1 gm$M3 s Cgd$M4 gm$M1 gm$M3 s CL gm$M1 gm$M3 s Cgd$M2 gm$M2 gm$M3 s Cgd$M4 gm$M2 gm$M3 s CL gm$M2 gm$M3 s Cgd$M4 Gds$M1 gm$M4 s Cgd$M4 Gds$M2 gm$M4 s Cgd$M4 gm$M1 gm$M4 s Cgd$M4 gm$M2 gm$M4 s

Approximating the tableau equations has reduced the transfer function, which was initially of orderfour, to the first-order formula we were looking for. In a last postprocessing step, we can remove allremaining numerically irrelevant terms by solution-based approximation.

In[51]:= dpcmos2 = GetDesignPoint[stacmoshf];

In[52]:= tfcmoshfSAG = Simplify @ApproximateTransferFunction[tfcmoshf, s, dpcmos2, 0.1]

Out[52]=gm$M1 gm$M2 gm$M3 gm$M4 V1

Gds$M2 gm$M1 gm$M3 gm$M4 gm$M1 gm$M2 Gds$M4 gm$M3 Cgd$M2 gm$M3 Cgd$M4 gm$M3 CL gm$M3 Cgd$M4 gm$M4 s

From the above result we can now easily compute a formula for the pole of the transfer function bysolving the denominator of the expression for s:

Page 165: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.9 Frequency-Domain Analysis of Linear Circuits 163

In[53]:= Solve[Denominator[tfcmoshfSAG] == 0, s] // Simplify

Out[53]=s Gds$M4 gm$M1 gm$M2 gm$M3

Gds$M2 gm$M1 gm$M3 gm$M4 gm$M1 gm$M2Cgd$M2 gm$M3 CL gm$M3 Cgd$M4 gm$M3 gm$M4

Finally, we verify the result by evaluating the approximated formula with the design-point valuesand comparing its frequency response to that of the original PSpice simulation. The simplifiedformula turns out to be a good approximation from DC up to a frequency of about MHz.

In[54]:= tfcmoshf2 = Together[tfcmoshfSAG/. dpcmos2 /. s −> 2 Pi I f]

Out[54]=4.646231013

8.497291015 1.07761020 I f

In[55]:= BodePlot[reference, tfcmosPSpice[f], tfcmoshf2,f, 1., 1.*10^9, ShowLegend −> False]

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-30

-20

-10

0

10

20

30

Magnitude (dB)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-100

-80

-60

-40

-20

0

Phase (deg)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

Out[55]= Graphics

Page 166: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

164 2. Tutorial

2.10 Nonlinear Symbolic Approximation

The linear simplification techniques implemented in Analog Insydes proved to be very effectiveand powerful. As of version 2, simplification routines for nonlinear circuits have been added toAnalog Insydes. They are able to reduce the complexity of symbolic nonlinear differential-algebraicequations systems (DAE) with automated error control and can be used, for example, for behavioralmodel generation.

Section 2.10.1 describes the main principles of the nonlinear simplification techniques in AnalogInsydes. Section 2.10.2 shows their application on an example.

2.10.1 Introduction to Nonlinear Approximation

As opposed to the linear case, for nonlinear approximation techniques there is no distinction betweensimplification-before-generation and simplification-after-generation methods. All nonlinear simplifi-cation commands expect a symbolic DAEObject as input and return an approximated symbolicDAEObject. This simplified system can then be approximated further until the desired complexityreduction is reached. During simplification, the error is measured by numerical simulations and thesimplification is stopped as soon as the error exceeds a user-given error bound. Different user-definednumerical analyses can be performed for error calculation.

Before the nonlinear simplification techniques can be applied, the equation system has to be preparedusing the command NonlinearSetup (Section 3.12.1). The command syntax is as follows:

NonlinearSetup[dae, inputs, outputs, mode1 −> settings1, ]

The first argument of NonlinearSetup is the DAEObject to be simplified. It has to be set up insymbolic formulation for DC or transient analysis mode. See the command CircuitEquations (Sec-tion 3.5.1), especially the options ElementValues and AnalysisMode, for setting up an appropriateequation system.

Then you have to specify the input and output symbols of the equation system. During simplifica-tion, the input symbols are swept in a user-given range, whereas the value of the output symbols isused to calculate the numerical error. All parameters of the DAEObject can be used as input symbols.To get a list of all valid input symbols, use the command GetParameters (Section 3.6.9). On theother hand, all variables of the DAEObject can be used as output symbols. To get a list of all validoutput symbols, use the command GetVariables (Section 3.6.7). Both arguments inputs and outputscan either be a single symbol or a list of symbols. Since several input and output symbols can bespecified, the nonlinear simplification techniques are able to approximate multi-input/multi-output(MIMO) systems.

Finally, the analysis modes used for error calculation have to be given as rules of the formmodei −> settingsi, where modei is either DT (for DC-transfer analysis) or AC (for AC analysis).The argument settingsi is a sequence of rules for specifying the sweep range (using the symbolRange), the simulation function (using the symbol SimulationFunction), and the error function(using the symbol ErrorFunction). The sweep range is a required argument and determines for

Page 167: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.10 Nonlinear Symbolic Approximation 165

each input symbol (as specified by inputs) the numerical range in which to sweep the symbol duringnumerical simulation. The sweep range is given by a standard Analog Insydes parameter sweepspecification as described in Section 3.7.2. Both the simulation function and error function argumentsare optional and for advanced usage only. For usual applications you do not need to specify them.

For example, the argument

DT −> Range −> VIN, 0., 5., 1.

specifies that a DC-transfer analysis has to be performed for error calculation. For this, the inputsymbol VIN has to be swept from 0. to 5. in steps of 1. and the default simulation and errorfunctions have to be used.

NonlinearSetup returns a new DAEObject which is prepared for nonlinear approximation. All datagiven as arguments to NonlinearSetup are stored in the returned DAEObject and automaticallyextracted by subsequent commands, such that there is no need to specify them again. Additionally,NonlinearSetup performs numerical simulations and stores the result as reference values used forerror calculations. You can use the command NonlinearSettings (Section 3.12.5) to inspect whichdata has been added to the DAEObject for nonlinear simplifications.

Once the DAEObject is prepared, there are two major commands for nonlinear simplifications:CompressNonlinearEquations and CancelTerms.

CompressNonlinearEquations

CompressNonlinearEquations (Section 3.12.2) removes equations and eliminates variables from theDAEObject which are irrelevant for solving for the output variables. The general syntax is as follows:

CompressNonlinearEquations[dae, vars]

If the given DAEObject is prepared via NonlinearSetup, the output variables specified in the callto NonlinearSetup are added to the given list vars of variables to hold in the equation system.Note that compressing equations is a mathematically exact operation, there is no need to performnumerical error calculations.

Since CompressNonlinearEquations reduces the number of equations in a DAEObject, it is recom-mended as the first step in a nonlinear simplification procedure.

CancelTerms

CancelTerms (Section 3.12.3) simplifies a DAEObject by successive removal of terms in the equationsystem. The general syntax is as follows:

CancelTerms[dae, maxerrors]

After each each term removal, CancelTerms performs a numeric simulation (as set byNonlinearSetup), calculates the error, and compares it to the user-given error bound maxerrors. Ifthe error caused by a simplification exceeds this error bound, the simplification is undone.

Page 168: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

166 2. Tutorial

CancelTerms returns the simplified DAEObject. All nonlinear options which are stored in dae arecopied to the new system. Thus, the returned system can be used as input for subsequent simplifi-cations.

By default, CancelTerms removes terms in top-level sums of the equation system. Using the optionLevel, removal of terms can be performed in deeper levels, too. The value of this option is eithera non-negative integer, a list of non-negative integers, or the symbol All. For the latter, removal ofterms is performed in all levels, starting on top level.

2.10.2 Analyzing a Square Root Function Block

In this section the application of the nonlinear simplification functions is demonstrated on an exam-ple. Figure 10.1 shows the schematic of a nonlinear square root function block consisting of fourbipolar transistors.

Q1

Q3

I0

II

Q4

VLOAD VCC

Q2

5

Figure 10.1: Square root function block

The input is given by the current source II and the voltage source VLOAD, the output is given by thecurrent through the voltage source VLOAD. Using the nonlinear approximation routines we want togenerate a symbolic expression for the static input output behavior of the circuit.

Importing Numerical Data

In PSpice the numerical simulation is performed as a DC sweep on ii and vload. The correspondingpart of the .cir-file looks as follows:

.op

.dc ii 0.0 0.001 0.00001 vload 0 3.5 0.875

.probe/csdf

.options numdgt=8

Page 169: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.10 Nonlinear Symbolic Approximation 167

As a first step we import the numerical simulation data calculated with PSpice into Mathematicausing ReadSimulationData (Section 3.10.3).

In[1]:= <<AnalogInsydes‘

In[2]:= data = ReadSimulationData["AnalogInsydes/DemoFiles/Sqrt.txt",Simulator −> "PSpice"]

Out[2]=V3 InterpolatingFunction0., 0.001, ,V5 InterpolatingFunction0., 0.001, ,V1 InterpolatingFunction0., 0.001, ,Vout InterpolatingFunction0., 0.001, ,V4 InterpolatingFunction0., 0.001, ,III InterpolatingFunction0., 0.001, ,IIB InterpolatingFunction0., 0.001, ,IVLOAD InterpolatingFunction0., 0.001, ,Ivdc InterpolatingFunction0., 0.001, ,ICQ1 InterpolatingFunction0., 0.001, ,IBQ1 InterpolatingFunction0., 0.001, ,IEQ1 InterpolatingFunction0., 0.001, ,ISQ1 InterpolatingFunction0., 0.001, ,ICQ2 InterpolatingFunction0., 0.001, ,IBQ2 InterpolatingFunction0., 0.001, ,IEQ2 InterpolatingFunction0., 0.001, ,ISQ2 InterpolatingFunction0., 0.001, ,ICQ3 InterpolatingFunction0., 0.001, ,IBQ3 InterpolatingFunction0., 0.001, ,IEQ3 InterpolatingFunction0., 0.001, ,ISQ3 InterpolatingFunction0., 0.001, ,ICQ4 InterpolatingFunction0., 0.001, ,IBQ4 InterpolatingFunction0., 0.001, ,IEQ4 InterpolatingFunction0., 0.001, ,ISQ4 InterpolatingFunction0., 0.001, ,SweepParameters VLOAD 0., 1,

1, 1, V3 InterpolatingFunction0., 0.001, ,V5 InterpolatingFunction0., 0.001, ,V1 InterpolatingFunction0., 0.001, ,Vout InterpolatingFunction0., 0.001, ,V4 InterpolatingFunction0., 0.001, ,III InterpolatingFunction0., 0.001, ,IIB InterpolatingFunction0., 0.001, ,IVLOAD InterpolatingFunction0., 0.001, ,10, IBQ3 InterpolatingFunction0., 0.001, ,IEQ3 InterpolatingFunction0., 0.001, ,ISQ3 InterpolatingFunction0., 0.001, ,ICQ4 InterpolatingFunction0., 0.001, ,IBQ4 InterpolatingFunction0., 0.001, ,IEQ4 InterpolatingFunction0., 0.001, ,ISQ4 InterpolatingFunction0., 0.001, ,SweepParameters VLOAD 3.5

ReadSimulationData returns the two-dimensional sweep data as a list of lists of one-dimensionalinterpolating functions as described in Section 3.7.1. To transform the data into a list of two-dimensional interpolating functions we can use the command ConvertDataTo2D (Section 3.13.1). Inthe following step we extract the interpolating function corresponding to the output value I(VLOAD)and assign it to the function ivloadPSpice.

Page 170: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

168 2. Tutorial

In[3]:= data2d = ConvertDataTo2D[data]

Out[3]=V3 InterpolatingFunction0., 3.5, 0., 0.001, ,V5 InterpolatingFunction0., 3.5, 0., 0.001, ,V1 InterpolatingFunction0., 3.5, 0., 0.001, ,Vout InterpolatingFunction0., 3.5, 0., 0.001, ,V4 InterpolatingFunction0., 3.5, 0., 0.001, ,III InterpolatingFunction0., 3.5, 0., 0.001, ,IIB InterpolatingFunction0., 3.5, 0., 0.001, ,IVLOAD InterpolatingFunction0., 3.5, 0., 0.001, ,Ivdc InterpolatingFunction0., 3.5, 0., 0.001, ,ICQ1 InterpolatingFunction0., 3.5, 0., 0.001, ,IBQ1 InterpolatingFunction0., 3.5, 0., 0.001, ,IEQ1 InterpolatingFunction0., 3.5, 0., 0.001, ,ISQ1 InterpolatingFunction0., 3.5, 0., 0.001, ,ICQ2 InterpolatingFunction0., 3.5, 0., 0.001, ,IBQ2 InterpolatingFunction0., 3.5, 0., 0.001, ,IEQ2 InterpolatingFunction0., 3.5, 0., 0.001, ,ISQ2 InterpolatingFunction0., 3.5, 0., 0.001, ,ICQ3 InterpolatingFunction0., 3.5, 0., 0.001, ,IBQ3 InterpolatingFunction0., 3.5, 0., 0.001, ,IEQ3 InterpolatingFunction0., 3.5, 0., 0.001, ,ISQ3 InterpolatingFunction0., 3.5, 0., 0.001, ,ICQ4 InterpolatingFunction0., 3.5, 0., 0.001, ,IBQ4 InterpolatingFunction0., 3.5, 0., 0.001, ,IEQ4 InterpolatingFunction0., 3.5, 0., 0.001, ,ISQ4 InterpolatingFunction0., 3.5, 0., 0.001,

In[4]:= ivloadPSpice[VLOAD_, II_] ="I(VLOAD)"[VLOAD, II] /. data2d

Out[4]=InterpolatingFunction0., 3.5, 0., 0.001, VLOAD, II

The interpolating function ivloadPSpice can now be plotted in a three-dimensional plot:

In[5]:= Plot3D[ivloadPSpice[VLOAD, II],VLOAD, 0., 3.5, II, 0., 0.001,AxesLabel −> "VLOAD", "II", "",PlotLabel −> "IVLOAD (PSpice)"]

IVLOAD (PSpice)

01

2

3VLOAD

0

0.0002

0.0004

0.0006

0.00080.001

II0

0.0001

0.0002

0.0003

01

2

3VLOAD

Out[5]= SurfaceGraphics

Page 171: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.10 Nonlinear Symbolic Approximation 169

Equation Setup

In the next step the equation system has to be set up. For this we import the PSpice .cir-file andconvert it into an Analog Insydes Circuit object using the command ReadNetlist (Section 3.10.1).

In[6]:= netlist = ReadNetlist["AnalogInsydes/DemoFiles/Sqrt.cir",Simulator −> "PSpice"];

DisplayForm[netlist]

Out[7]//DisplayForm=Circuit:

Netlist Raw, 8 Entries:Q1, 3 C, 5 B, 0 E, Model ModelBJT, BJTNPN, Q1, SelectoQ2, 1 C, 3 B, 5 E, Model ModelBJT, BJTNPN, Q2, SelectoQ3, OUT C, 3 B, 4 E, Model ModelBJT, BJTNPN, Q3, SelecQ4, 4 C, 4 B, 0 E, Model ModelBJT, BJTNPN, Q4, SelectoVLOAD, 1, OUT, Type VoltageSource, Value AC 0, DC Tran

II, 5, 0, Type CurrentSource, Value AC 0, DC Transient

IB, 1, 3, Type CurrentSource, Value AC 0, DC Transient

VDC, 1, 0, Type VoltageSource, Value AC 0, DC Transien

ModelParametersName BJTNPN, Type NPNGlobalParametersSimulator PSpice

Afterwards, we set up a symbolic DC equation system using the modified nodal formulation. Sincewe are not interested in temperature effects, we instruct CircuitEquations (Section 3.5.1) to replaceTEMP, TNOM, the elementary charge $q, and Boltzmann’s constant $k by their numerical values.

In[8]:= mnaFull = CircuitEquations[netlist,AnalysisMode −> DC, ElementValues −> Symbolic,Value −> "*" −> TEMP, TNOM, $q, $k]

Out[8]= DAEDC, 2727

In[9]:= GetVariables[mnaFull]

Out[9]=V$1, V$3, V$4, V$5, V$OUT, I$BS$Q1,I$CS$Q1, I$ES$Q1, ib$Q1, ic$Q1, I$BS$Q2, I$CS$Q2, I$ES$Q2,ib$Q2, ic$Q2, I$BS$Q3, I$CS$Q3, I$ES$Q3, ib$Q3, ic$Q3, I$BS$Q4,I$CS$Q4, I$ES$Q4, ib$Q4, ic$Q4, I$VLOAD, I$VDC

In[10]:= GetParameters[mnaFull]

Out[10]=AREA$Q1, AREA$Q2, AREA$Q3, AREA$Q4, BF$Q1, BF$Q2, BF$Q3, BF$Q4,BR$Q1, BR$Q2, BR$Q3, BR$Q4, GMIN, IB, II, IS$Q1, IS$Q2, IS$Q3,IS$Q4, VDC, VLOAD

Numerical Reference Calculation

Using NDAESolve (Section 3.7.5) we now perform the same numerical simulation as in PSpice, trans-form the result again into a two-dimensional interpolating function, and plot it in a three-dimensionalplot.

In[11]:= data = NDAESolve[mnaFull,II, 0.0, 0.001, VLOAD, 0., 3.5, 0.5];

Page 172: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

170 2. Tutorial

In[12]:= data2d = ConvertDataTo2D[data];

In[13]:= ivload[VLOAD_, II_] = I$VLOAD[VLOAD, II] /. data2d

Out[13]=InterpolatingFunction0., 3.5, 0, 0.001, VLOAD, II

In[14]:= Plot3D[ivload[VLOAD, II],VLOAD, 0., 3.5, II, 0., 0.001,AxesLabel −> "VLOAD", "II", "",PlotLabel −> "IVLOAD (Analog Insydes)"]

IVLOAD (Analog Insydes)

01

2

3VLOAD

0

0.0002

0.0004

0.0006

0.00080.001

II0

0.0001

0.0002

0.0003

01

2

3VLOAD

Out[14]= SurfaceGraphics

Model Validation

One key step is now to check if the numerical simulation in Analog Insydes is identical to the resultof the PSpice simulation, i.e. to check if we have chosen appropriate transistor models. This can forexample be done by comparing the graphical output. We choose some arbitrary value for VLOAD andplot both output values in one graph sweeping II. The plot shows that both curves are identical(for this value of VLOAD). Alternatively, we can calculate the maximum difference of both outputvalues evaluated on a uniform grid. The result shows that the deviation is of order ΜA.

Page 173: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.10 Nonlinear Symbolic Approximation 171

In[15]:= TransientPlot[ivloadPSpice[2., II], ivload[2., II],II, 0., 0.001]

0.00020.00040.00060.0008 0.001II

0.00005

0.0001

0.00015

0.0002

0.00025

0.0003

ivload[2.

ivloadPSp

Out[15]= Graphics

In[16]:= Max @ Map[Abs[Apply[ivload,#] − Apply[ivloadPSpice,#]] &,Flatten[Table[VLOAD, II,

VLOAD, 0., 3.5, 0.1, II,0., 0.001, 0.000025], 1]]

Out[16]= 2.62136107

Starting Nonlinear Simplifications

Now that we have ensured to use the same equation system as PSpice does, we can proceed with thenonlinear simplification routines. The task is to generate a simplified static equation system whichhas the same input-output behavior as the original system mnaFull. To get an impression of thecomplexity of the original system, we use the command Statistics (Section 3.6.17).

In[17]:= Statistics[mnaFull]

Number of equations : 27

Number of variables : 27

Length of equations : 4, 4, 3, 3, 2, 3, 2, 3, 8, 8,

3, 2, 3, 9, 9, 3, 2, 3, 9, 9, 3, 2, 3, 4, 4, 3, 2

Terms with derivatives : 0

Sums in levels : 113, 20

Compressing Equations

In a first step we eliminate irrelevant variables using the function CompressNonlinearEquations(Section 3.12.2). The argument I$VLOAD to CompressNonlinearEquations assures that our vari-able of interest is not eliminated from the equation system. Eliminating variables is a mathematicallyexact operation, thus no error calculation is needed. As in our example, this usually reduces the num-ber of equations drastically (but not necessarily the number of terms) and is therefore recommendedas the first step in the simplification procedure.

Page 174: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

172 2. Tutorial

In[18]:= step1 = CompressNonlinearEquations[mnaFull, I$VLOAD]

Out[18]= DAEDC, 66

In[19]:= Statistics[step1]

Number of equations : 6

Number of variables : 6

Length of equations : 16, 24, 9, 23, 3, 2

Terms with derivatives : 0

Sums in levels : 77, 42

Preparing Approximation Routines

To further reduce the complexity of the DAE system we now cancel terms in the equations. Sincethis operation alters the output of the system, numerical control simulations have to be applied tocheck the current error. We use NonlinearSetup (Section 3.12.1) to prepare the DAEObject for thefollowing simplification steps. Since we are dealing with a static equation system, we choose theDT analysis mode for error checking, specifying sweep ranges for both input values VLOAD and II.NonlinearSetup performs a numerical reference simulation and stores the result in the returnedDAEObject. These numerical values are used automatically to calculate the error in subsequentsimplification steps.

In[20]:= step2 = NonlinearSetup[step1, II, VLOAD, I$VLOAD,DT −> Range −>

VLOAD, 0., 3.5, 0.5, II, 0., 0.001, 0.0002 ]

Out[20]= DAEDC, 66

Cancelling Terms

Once we have set up the DAE system we call CancelTerms (Section 3.12.3) where we specify anerror bound for the output variable. CancelTerms then deletes terms in the equation system usingthis error bound. Afterwards we again use Statistics to inspect the complexity reduction achievedby CancelTerms.

In[21]:= step3 = CancelTerms[step2, DT −> I$VLOAD −> 25.*^−6]

Out[21]= DAEDC, 66

In[22]:= Statistics[step3]

Number of equations : 6

Number of variables : 6

Length of equations : 2, 2, 2, 4, 2, 1

Terms with derivatives : 0

Sums in levels : 12, 4

Note that CancelTerms reduces the number of terms drastically.

Page 175: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.10 Nonlinear Symbolic Approximation 173

Compressing Equations again

Deletion of terms changes the equations in such a way that it is often possible to further solveequations for some variables. Thus, we can again try to eliminate variables usingCompressNonlinearEquations. Here, two more equations can be removed from the system. Notethat CompressNonlinearEquations automatically retrieves the settings made by NonlinearSetup,so there is no need to specify the variable of interest I$VLOAD as a second argument. Afterwards wedrop those parameters from the design point which no longer appear in the equation system usingUpdateDesignPoint (Section 3.6.14).

In[23]:= step4 = CompressNonlinearEquations[step3]

Out[23]= DAEDC, 44

In[24]:= Statistics[step4]

Number of equations : 4

Number of variables : 4

Length of equations : 2, 2, 2, 4

Terms with derivatives : 0

Sums in levels : 10, 4

In[25]:= step5 = UpdateDesignPoint[step4]

Out[25]= DAEDC, 44

In[26]:= step5 // DisplayForm

Out[26]//DisplayForm=

II 1. AREA$Q2 E38.6635 V$3V$5 IS$Q2 0,1. IB 1. AREA$Q1 E38.6635 V$5 IS$Q1 0,1. AREA$Q3 E38.6635 V$3V$4 IS$Q3 1. I$VLOAD 0,1. IB 1. AREA$Q1 E38.6635 V$5 IS$Q1 1. AREA$Q4 E38.6635 V$4 IS$Q4 1. I$VLOAD 0,

V$3, V$4, V$5, I$VLOAD, DesignPoint II 0.0001, IB 0.0001,AREA$Q1 1., IS$Q1 1.1016, AREA$Q2 1., IS$Q2 1.1016,AREA$Q3 1., IS$Q3 1.1016, AREA$Q4 1., IS$Q4 1.1016

Looking at the simplified DAE system one can see that the parameter VLOAD disappeared from theequations. The three-dimensional plot of the output from the beginning shows that the output doesnot depend on VLOAD, thus the simplification procedure automatically removes this parameter fromthe equation system.

Validating the Result

Now we can compare the output of the simplified system step5 with the output of the origi-nal system. Since VLOAD no longer appears in the DAE system, we no longer need to perform amulti-dimensional parametric sweep of NDAESolve. A single sweep on II suffices, resulting in aone-dimensional interpolating function.

In[27]:= data = NDAESolve[step5, II, 0., 0.001];

Page 176: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

174 2. Tutorial

In[28]:= ivloadSimp[II_] = I$VLOAD[II] /. First @ data

Out[28]=InterpolatingFunction0, 0.001, II

In[29]:= Plot3D[ivloadSimp[II],VLOAD, 0., 3.5, II, 0., 0.001,AxesLabel −> "VLOAD", "II", "",PlotLabel −> "IVLOAD (simplified system)"]

IVLOAD (simplified system)

01

2

3VLOAD

0

0.0002

0.0004

0.0006

0.00080.001

II0

0.00010.00020.0003

01

2

3VLOAD

Out[29]= SurfaceGraphics

To show that the requested error bound is met, we plot the deviation of the output comparing theoriginal and the simplified system (note the plot range).

In[30]:= Plot3D[Abs[ivloadSimp[II]−ivload[VLOAD, II]],VLOAD, 0., 3.5, II, 0., 0.001,PlotRange −> 0, 25.*^−6,AxesLabel −> "VLOAD", "II", "",PlotLabel −> "absolute error"]

absolute error

01

2

3VLOAD

0

0.0002

0.0004

0.0006

0.00080.001

II0

0.00001

0.00002

01

2

3VLOAD

Out[30]= SurfaceGraphics

Page 177: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

2.10 Nonlinear Symbolic Approximation 175

Further Postprocessing

In the final step we further reduce the complexity of the equation system by applying some standardMathematica functions to manipulate the equations symbolically. In this example it is possible to solvethe equations for the output variable I$VLOAD symbolically yielding an explicit formula describingthe input-output behavior.

In[31]:= eqs = GetEquations[step5];

In[32]:= eqs2 = Eliminate[eqs, V$3, V$4, V$5]

Eliminate::ifun:Inverse functions are being used by Eliminate, so some

solutions may not be found.

Out[32]=

Log I$VLOADAREA$Q3 IS$Q3

Log IBAREA$Q1 IS$Q1

Log IIAREA$Q2 IS$Q2

1. Log I$VLOADAREA$Q4 IS$Q4

In[33]:= Solve[Map[Exp, eqs2], I$VLOAD]

Out[33]=

I$VLOAD 1.

AREA$Q3

AREA$Q4 IB II

IS$Q3

IS$Q4

AREA$Q1

AREA$Q2

IS$Q1

IS$Q2

,

I$VLOAD 1.

AREA$Q3

AREA$Q4 IB II

IS$Q3

IS$Q4

AREA$Q1

AREA$Q2

IS$Q1

IS$Q2

From the result it can be seen that the output current I$VLOAD depends on the square root of theinput current II and that it is independent of the input voltage VLOAD.

Page 178: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog
Page 179: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

Reference Manual

3.1 Netlist Format . . . . . . . . . . . . . . . . . . . . . . . 178

3.2 Subcircuit and Device Model Definition . . . . . . . . . . 190

3.3 Model Library Management . . . . . . . . . . . . . . . . 211

3.4 Expanding Subcircuits and Device Models . . . . . . . . 221

3.5 Setting Up and Solving Circuit Equations . . . . . . . . . 227

3.6 Circuit and DAEObject Manipulation . . . . . . . . . . . 255

3.7 Numerical Analyses . . . . . . . . . . . . . . . . . . . . 280

3.8 Pole/Zero Analysis . . . . . . . . . . . . . . . . . . . . . 304

3.9 Graphics Functions . . . . . . . . . . . . . . . . . . . . . 330

3.10 Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . 365

3.11 Linear Simplification Techniques . . . . . . . . . . . . . . 385

3.12 Nonlinear Simplification Techniques . . . . . . . . . . . . 401

3.13 Miscellaneous Functions . . . . . . . . . . . . . . . . . . 418

3.14 Global Options . . . . . . . . . . . . . . . . . . . . . . . 425

3.15 The Analog Insydes Environment . . . . . . . . . . . . . 432

Page 180: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

178 3. Reference Manual

3.1 Netlist Format

The following chapter explains the circuit-description language used by Analog Insydes. In AnalogInsydes, circuits are described in terms of Netlist and Circuit objects. Section 3.1.2 shows thegeneral syntax for Circuit objects, Section 3.1.1 for Netlist objects. Sections 3.1.3–3.1.8 describe thesyntax of the Netlist object entries, Sections 3.1.9–3.1.11 describe the syntax of the Circuit objectentries.

3.1.1 Netlist

Netlist[args] defines a circuit in terms of basic components and modelreferences where args may be any sequence of netlistentries

Command structure of Netlist.

A flat netlist is described in Analog Insydes by means of a Netlist object. A Netlist consists ofa sequence of netlist entries which can be either basic components or model references. Each netlistentry is a list. The general syntax for a Netlist object is as follows:

netlistname =Netlist[

netlist entry 1,netlist entry 2,

]

The format of a netlist entry is described in Section 3.1.3.

Usually, a Netlist object is contained in a Circuit object together with model and parameterdefinitions.

See also: Circuit (Section 3.1.2), CircuitEquations (Section 3.5.1), Sections 3.1.3–3.1.7.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

A simple voltage dividernetlist.

In[2]:= voldiv =Netlist[

V0, 1, 0, V0,R1, 1, 2, R1,R2, 2, 0, R2

]

Out[2]= NetlistRaw, 3

Page 181: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.1 Netlist Format 179

3.1.2 Circuit

Circuit[args] defines a circuit in terms of top-level netlists and modelswhere args may be any sequence of Netlist, Subcircuit,Model, ModelParameters, or GlobalParameters objects

Command structure of Circuit.

With Analog Insydes you can describe electrical circuits and control systems hierarchically in termsof netlists, subcircuit or device model definitions, and model parameter sets. Circuits are definedwith the commands Circuit or Netlist. The general syntax for a Circuit object is as follows:

Circuit[Netlist[top-level netlist with subcircuit references],Model[subcircuit/model definition], ModelParameters[model parameters specification], GlobalParameters[global parameters specification],

]

Multiple Netlist sections in a Circuit object will be concatenated in order of appearanceupon subcircuit expansion.

See also:Netlist (Section 3.1.1), ModelParameters (Section 3.1.10), GlobalParameters (Section 3.1.11), Model(Section 3.2.1), CircuitEquations (Section 3.5.1), ReadNetlist (Section 3.10.1).

Examples

The following is an example for a complete Analog Insydes circuit description including devicemodel and parameter definitions.

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 182: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

180 3. Reference Manual

A complex circuitdescription.

In[2]:= amplifier = Circuit[Netlist[

V0, VCC, 0, Symbolic −> AC−>0, _ −> VCC,Value −> DC | Transient −> 12,

V1, 1, 0, Symbolic −> V1, Value −> AC −> 1,DC | Transient −> SinWave[Time, 0.8, 0.01, 1000],

Q1, 2 −> C, 1 −> B, 0 −> E,Model −> Model[BJT, DEFNPN, Q1],Selector −> Selector[BJT, DEFNPN, Q1],Parameters −> Parameters[BJT, DEFNPN, Q1],GM$ac −> 0.02, RPI$ac −> 5.0*^3, RO$ac −> 1.0*^4,

RC, VCC, 2, Value −> 500, Symbolic −> RC],Model[Name −> BJT, Selector −> ACsimple,

Scope −> Global, Ports −> C, B, E,Parameters −> gm, Rpi, Ro, GM$ac, RPI$ac, RO$ac,Definition −> Netlist[

RPI, B, E, Value −> RPI$ac, Symbolic −> Rpi,VC, B, E, C, E, Value −> GM$ac, Symbolic −> gm,RO, C, E, Value −> RO$ac, Symbolic −> Ro

]],ModelParameters[Name −> DEFNPN, Type −> "NPN",

IS −> 1.0*^−16, BF −> 100, BR −> 1, VAF −> 150],GlobalParameters[TEMP −> 300.15, GMIN −> 1.0*^−12]

]

Out[2]= Circuit

3.1.3 Netlist Entries

Netlist entries must be written in one of the following ways:

refdes, nodes, value simple netlist entry format

refdes, nodes, Value−>value, optsextended value field format for netlist entries

refdes, node−>port, † † † , Model−>name, Selector−>sel, par−>val, † † † netlist entry format for model references

Netlist entry formats.

The reference designator (refdes) is a unique name (a symbol or a string) by which a circuit componentcan be identified, such as R1 and CL for a resistor R and a load capacitor CL. For linear netlistelements, the first one, two, or three letters of the reference designator (the type tag) determine thetype of the element (see Chapter 4.2 for a list of available linear element types). In the following,the simple and extended netlist entry format is described. Section 3.1.8 describes the netlist formatfor model references in more detail.

Page 183: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.1 Netlist Format 181

Reference designators must be symbols or strings that can be converted to symbols.

Reference designators are case sensitive. Therefore, R1 and r1 denote different elements.

All reference designators are converted internally to strings. Therefore, R1 and "R1" refer tothe same element.

The second argument of a netlist entry (nodes) specifies the nodes to which the element is connected.The number of nodes that have to be specified depends on the element type. You may use non-negative integers, symbols, and strings as node identifiers. The number 0, or equivalently the string"0", designates the ground node.

Numeric node identifiers are not required to be consecutive.

Node identifiers are case sensitive. Therefore, N1 and n1 denote different nodes.

All node identifiers are converted internally to strings. Therefore, N1 and "N1" refer to thesame node.

The value of a circuit element may be a symbol, a number, or any Mathematica expression involvingboth numeric and symbolic quantities.

Whenever the extended value field format is used for a netlist entry, the value of thecorresponding element must be specified with the keyword Value; this keyword may not beomitted.

See also: Section 3.1.4.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

This defines an RLClowpass filter circuit.

In[2]:= rlcf = Netlist[V1, 1, 0, V,R1, 1, 2, R,L1, 2, 3, L,C1, 3, 0, C

]

Out[2]= NetlistRaw, 4

Page 184: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

182 3. Reference Manual

This netlist is semanticallyidentical to the previousone.

In[3]:= rlcf2 = Netlist["V1", 1, 0, Value −> V,"R1", 1, 2, Value −> R,"L1", 2, 3, Value −> L,"C1", 3, 0, Value −> C

]

Out[3]= NetlistRaw, 4

Set up a system of circuitequations.

In[4]:= CircuitEquations[rlcf] // DisplayForm

Out[4]//DisplayForm=

1R 1R 0 1

1R1R 1L s 1L s 0

0 1L s1L s C s 0

1 0 0 0

.

V$1V$2V$3I$V1

000V

The example below shows a valid mixture of data types and formats for reference designators, nodeidentifiers, and value specifications.

This defines a voltagedivider circuit.

In[5]:= divider = Netlist[V1, "in", 0, Value −> 5,"R1", in, out, R,R2, "out", 0, 2*R

]

Out[5]= NetlistRaw, 3

3.1.4 Netlist Entry Options

The extended value field format allows you to specify additional information related to a circuitelement expressed in terms of rules with the following keywords:

option name default value

InitialCondition Automatic the initial condition for a dynamic element(L or C)

Pattern Automatic the MNA pattern for a two-terminalimpedance or admittance element (R, G, C,L, Z, Y)

Symbolic (no default) the symbolic value of a circuit element

Type Automatic explicit specification of the element type

Netlist entry options.

A netlist entry in extended value field format looks like

Page 185: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.1 Netlist Format 183

refdes, nodes, Value −> value,Symbolic −> symbolicvalue,Pattern −> pattern,Type −> type,InitialCondition −> initialcondition

where parameters in slanted typewriter font are optional.

InitialCondition

With InitialCondition −> ic, you can specify initial currents and voltages for inductors and ca-pacitors, respectively. If no initial condition is given explicitly, it will be assumed to be zero (ACanalysis) or will be calculated automatically from operating-point data (transient analysis).

Pattern

The option Pattern allows you to select the matrix fill-in patterns for two-terminal admittances andimpedances (immittances) to be used in modified nodal analysis (MNA). By default, all impedances Zare converted to equivalent admittances Y Z to keep the dimensions of the circuit equationssmall. The following values are allowed:

Automatic convert impedances to admittances for MNA

Admittance use admittance pattern for immittances

Impedance use impedance pattern for immittances

Values for the Pattern option.

An explicit Pattern specification overrides the setting of the option ConvertImmittanceslocally.

Symbolic

With Symbolic −> symbol, you can specify an alternative symbolic element value in addition to anumerical value given by Value −> value. This feature is used to associate design-point data withsymbolic element values. Note that symbol is not strictly required to be a symbol; you may alsospecify any Mathematica expression. However, design-point management will work as intended onlyif the value of the Symbolic option is a symbol.

Page 186: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

184 3. Reference Manual

You may not use the Symbolic option without the Value option. If the extended value fieldformat is used, the Value option must always be present (except in model references).

Type

The Type option allows you to override the automatic element type detection mechanism. With thedefault setting Type −> Automatic, the type of an element is determined from the leading charactersof its reference designator. With Type −> typename, the element is assumed to be of type typename re-gardless of what the reference designator implies. The argument typename must be a full type name.To get a list of all available type names, inspect the contents of the global variable ElementTypes.

See also: ElementTypes (Section 3.1.5), Section 3.1.3, Section 3.5.1.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

The following netlist illustrates the use of the netlist entry options described above. The optionPattern −> Impedance, prevents the resistance R1 from being converted to an equivalent admit-tance 1/R1 when setting up modified nodal equations. The Type option in the value field of thecomponent Load tells Analog Insydes to treat the element as a resistor although the type tag is L(inductor). Finally, the InitialCondition option in the netlist entry for C1 sets an initial capacitorvoltage of V.

This illustrates the use ofthe netlist entry options.

In[2]:= filter = Netlist[V1, 1, 0, Value −> 5, Symbolic −> V1,R1, 1, 2, Value −> 1000., Symbolic −> R1,

Pattern −> Impedance,Load, 2, 3, Value −> 10., Symbolic −> RL,

Type −> Resistor,C1, 3, 0, Value −> 1.*^−6, Symbolic −> C,

InitialCondition −> 2.5]

Out[2]= NetlistRaw, 4

Set up a system ofsymbolic circuit equations.

In[3]:= CircuitEquations[filter, ElementValues −> Symbolic,InitialConditions −> Automatic] // DisplayForm

Out[3]//DisplayForm=

0 0 0 1 1

0 1RL 1RL 0 1

0 1RL1RL C s 0 0

1 0 0 0 01 1 0 0 R1

.

V$1V$2V$3I$V1I$R1

00

2.5 CV10

Page 187: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.1 Netlist Format 185

3.1.5 ElementTypes

ElementTypes contains the names of all primitive circuit element types

Global variable ElementTypes.

The global variable ElementTypes contains a list of the internal names of all primitive circuit elementtypes supported by Analog Insydes. Any name from this list can be used as value of the optionType in the value fields of netlist entries.

See also: Section 3.1.4, Chapter 4.2.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Get the list of elementtype names.

In[2]:= ElementTypes

Out[2]=Resistor, Conductance, Admittance, Impedance, Capacitor,Inductor, CurrentSource, VoltageSource, CCCSource, CCVSource,VCCSource, VCVSource, Nullator, Norator, Fixator, OpAmp, OTAmp,ABModel, OpenCircuit, ShortCircuit, SignalSource, Amplifier,Integrator, Differentiator, TransmissionLine, TransferFunction

3.1.6 Value Specifications for Independent Sources

Independent sources may require multiple value specifications for different analysis modes. Forexample, a supply voltage source may have a value of V for DC and transient analysis and anAC value of V (e.g. for PSRR calculation). Multiple source values for both numerical and symbolicvalues can be specified in a netlist entry using a special form of the extended value field syntax (seeSection 3.1.3).

Value | Symbolic−>modespec−>value, † † † mode-specific source value specification

AC mode key for AC analysis

DC mode key for DC analysis

Transient mode key for transient analysis

Mode specific source value specifications.

A mode specification (modespec) is a Mathematica pattern which is compared against the value ofthe option AnalysisMode given to CircuitEquations (Section 3.5.1) during equation setup. Modespecifications are evaluated from left to right. The first matching pattern yields the element valuethat will be used.

Page 188: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

186 3. Reference Manual

If no value is specified for a particular analysis mode, the value is assumed to be zero.

Multiple element values may be given in both Value and Symbolic specifications.

The value specification in the following netlist entry will yield the source value for the optionsettings AnalysisMode −> DC and AnalysisMode −> Transient. For AC analysis the value will beused.

VSUP, VCC, 0, Value −> DC | Transient −> 12, AC −> 1

The value specification in the following netlist entry sets both the numeric and symbolic AC valuesof V1 to zero whereas the values Vin and 12 are used for all other analysis modes (DC and Transient).

V1, 1, 0, Symbolic −> AC −> 0, _ −> Vin,Value −> AC −> 0, _ −> 12

Note that the above approach allows you to keep symbols that represent pure DC values out of ACequations (see example in Section 3.1.2):

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define filter circuit. In[2]:= filter = Netlist[V0, 1, 0, Value −> DC|Transient −> 5, AC −> 0,

Symbolic −> AC −> 0, _ −> V0,V1, 1, 2, Value −> AC −> 1, DC −> 0,

Transient −> SinWave[Time, 0.8, 0.01, 1000],Symbolic −> V1,

R1, 2, 3, Value −> 1000., Symbolic −> R1,C1, 3, 0, Value −> 1.*^−6, Symbolic −> C

]

Out[2]= NetlistRaw, 4

Set up AC equationsystem. Note thatsymbol V0 does not appearin the AC equations.

In[3]:= CircuitEquations[filter, AnalysisMode −> AC,ElementValues −> Symbolic] // DisplayForm

Out[3]//DisplayForm=

0 0 0 1 1

0 1R1 1R1 0 1

0 1R11R1 C s 0 0

1 0 0 0 01 1 0 0 0

.

V$1V$2V$3I$V0I$V1

0000V1

3.1.7 Time and Frequency

The keywords Time and Frequency can be used in the value fields of netlist entries to refer to timeand the complex Laplace frequency, respectively. For example, the netlist entry

Page 189: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.1 Netlist Format 187

L1, 2, 3, L[Time]

defines a time-variant inductance, and

VC2, 1, 2, 3, 4, Frequency*C

defines a transcapacitance, i.e. a voltage-controlled current source with a transconductance thatdepends linearly on frequency.

Upon setting up circuit equations, the keywords Time and Frequency are replaced by the symbolsthat designate time and frequency as set in Options[CircuitEquations] (see also Section 3.5.1).The following analysis mode specific settings are performed:

For DC analysis, Time is replaced by the value of InitialTime and Frequency is set to zero.

For AC analysis, Time is replaced by the value of InitialTime.

For transient analysis, Frequency is set to zero.

Mode-specific replacement of Time and Frequency.

3.1.8 Model References

Subcircuits and device models are referenced via special netlist entries of the following form. Amodel reference is recognized by the presence of the keyword Model in the value field.

refdes, node−>port, † † † , Model−>name, Selector−>sel, par−>val, † † † netlist entry format for model references

Referencing models.

The following netlist entry references a transistor model NPN/DC and specifies numerical values forthe transistor parameters IS, BF, and BR:

Q1, 1 −> C, 2 −> B, 3 −> E, Model −> NPN, Selector −> DC,IS −> 1.*^−16, BF −> 100, BR −> 1

To reference a parameter set, use the value-field option Parameters −> name, where name denotesthe name of the parameter set defined with ModelParameters (see Section 3.1.10).

The following netlist entry includes a reference to the model parameter set DEFNPN.

Q1, 1 −> C, 2 −> B, 3 −> E, Model −> NPN, Selector −> DC,Parameters −> DEFNPN

Page 190: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

188 3. Reference Manual

A model reference may contain multiple parameter set references.

References to parameter sets are replaced by the corresponding model parameters in thegiven order.

When you read in circuit descriptions using the command ReadNetlist (Section 3.10.1), the Model,Selector, and Parameters keys in the value fields of model references are returned in the genericform key −> key[devtype, parset, refdes], for example

Q1, 1 −> C, 2 −> B, 3 −> E,Model −> Model[BJT, DEFNPN, Q1],Selector −> Selector[BJT, DEFNPN, Q1],Parameters −> Parameters[BJT, DEFNPN, Q1]

This approach permits an easy exchange of device models and parameter sets for each device orgroup of devices by means of pattern matching and rewriting (see also Section 3.4.1). In the defaultcase, i.e. when no replacement rules are applied to these keys, the model name, the selector, and theparameter set key are rewritten as follows upon circuit equation setup:

Model −> devtype, Selector −> mode, Parameters −> parset

For the following model reference Q1, the generic right-hand sides of these rules are transformed asshown below if AnalysisMode −> AC.

Q1,2 −> C, 1 −> B, 0 −> EModel −> BJT, Selector −> AC, Parameters −> DEFNPN,GM$ac −> 0.02, RPI$ac −> 5.0*^3, RO$ac −> 1.0*^4

See also: Model (Section 3.2.1), ModelParameters (Section 3.1.10), Section 3.1.3.

3.1.9 Model and Subcircuit

In Analog Insydes, Subcircuit is a synonym for Model. You may use either function name as youlike.

For a detailed description of the Model command, see Section 3.2.1.

Page 191: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.1 Netlist Format 189

3.1.10 ModelParameters

ModelParameters[Name−>name, par−>val, † † † ]defines a local model parameter set

ModelParameters[Name−>name, Scope−>Global, par−>val, † † † ]stores a model parameter set in the global subcircuitdatabase

Command structure of ModelParameters.

In addition to subcircuit and device models, you can also define parameter sets (model cards) thatcan be used in conjunction with model references in a circuit description.

The following statement defines a model parameter set for the device type DEFNPN.

ModelParameters[Name −> DEFNPN, IS −> 1.0*^−16, BF −> 100,BR −> 1, VAF −> 150]

These model parameter sets can be used in model references by means of the Parameters keyword.

See also: Section 3.1.8.

3.1.11 GlobalParameters

GlobalParameters[par−>val, † † † ]defines global parameter settings

Command structure of GlobalParameters.

With GlobalParameters you can specify settings for global parameters used in a Circuit object, asfor instance TEMP or GMIN.

Global parameter definitions may be self-referencing, i.e. a global parameter may bespecified as a function of one or several others (make sure that there are no circularreferences).

The list of global parameters is implicitly appended to the value fields of all modelreferences in a circuit. Therefore, you can use global parameter settings in a model withouthaving to pass these settings explicitly in each model reference.

The following examples are valid declarations for global parameters:

GlobalParameters[TEMP −> 300.15, GMIN −> 1.0*^−12]GlobalParameters[TEMP −> TNOM, TNOM −> 300.15,

GMIN −> 1.0*^−12]

Page 192: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

190 3. Reference Manual

3.2 Subcircuit and Device Model Definition

This chapter describes the usage of the command Model (Section 3.2.1), which enables you to describeyour circuits hierarchically in terms of subcircuits and device models. In the following sections, Ana-log Insydes’ subcircuit and device modeling functionality is presented mainly from the perspectiveof language syntax. Therefore, it is recommended that you also read Chapter 2.3 and Chapter 2.6 ofthe Analog Insydes Tutorial to understand the philosophy behind the modeling language and learnmore about methodologies for modeling linear and nonlinear circuits and devices.

Analog Insydes provides a unified modeling scheme that lets you implement and instantiate bothsubcircuits and device models in exactly the same way. Therefore, the terms model and subcircuit shallbe treated as synonyms throughout this chapter. Whenever the word model is used in the followingtext, it may refer to a component of a hierarchically structured circuit as well as to an equivalent cir-cuit or set of equations that describes a physical device. Consequently, the Analog Insydes commandSubcircuit is just an alias for Model, and you may use both names interchangeably.

3.2.1 Model

Model[keyword−>value, keyword−>value, † † † ]defines a subcircuit or device model in terms of a netlist ora system of behavioral equations

Command structure of Model.

Subcircuits and device models can be implemented either as netlists, i.e. as equivalent circuits com-posed of electrical primitives and model references (see Section 3.1.3), or as behavioral descriptionsin terms of linear and nonlinear algebraic and differential equations. Both equivalent circuits andanalog behavioral models (ABMs) can be defined with the Model command. Model takes a sequence ofnamed arguments, four of which are required while the remaining arguments are optional.

Name the model class name

Selector the selector for a particular member from a model class

Ports the list of model port nodes

Definition the model definition (a netlist or a system of equations)

Required arguments of the Model command.

Page 193: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.2 Subcircuit and Device Model Definition 191

Scope the scope of the model definition (local or global)

Parameters the list of model parameter names

Defaults default values for model parameters

Translation translation rules for parameter conversion

Symbolic the list of ABM parameters to be kept in symbolic form

Variables the variables in a system of ABM equations

InitialGuess initial guess for the numerical values of ABM variables

InitialConditions initial conditions for dynamic ABM variables

Optional arguments of the Model command.

A valid Model definition has the following general form:

Model[Name −> name,Selector −> selectorPorts −> port nodes,optarg −> value, Definition −> Netlist[ ] | Circuit[ ] | Equations[ ]

]

Arguments Description

The arguments of the Model command are explained in detail below.

Name

Name−>"string" the name of the model class to which the model definitionis assigned

Name−>symbol equivalent to Name−>ToString[symbol]

Name−>"string", "string", † † † assign the model definition to several model classes

Format of the Name argument.

The value of the argument Name identifies a class of model definitions for a non-primitive circuitobject or a device type, such as current mirror, operational amplifier, bipolar junction transistor, orMOSFET. The class name must be a symbol or a string. For example, the class names of BJT andMOSFET models are defined in the Analog Insydes model library as:

Page 194: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

192 3. Reference Manual

Name −> "BJT"Name −> "MOSFET"

You may assign one or more alias names to a model class by specifying a list of strings:

Name −> "BJT", "Q"

Internally, all model names are converted to strings. Therefore, Name−>symbol andName−>ToString[symbol] are equivalent name specifications.

Likewise, you can specify the model class name in a model reference (see Section 3.1.8)either as a symbol or a string regardless of the data type used in the model definition.

Selector

Selector−>"string" the key by which the model can be identified among themembers of the model class

Selector−>symbol equivalent to Selector−>ToString[symbol]

Selector−>"string", "string", † † † assign several alias names to the model definition

Format of the Selector argument.

The value of the argument Selector selects a particular member from the class of models identifiedwith Name. For instance, the AC, DC, and dynamic large-signal models of the device type MOSFETcan be defined and distinguished with the following Name/Selector pairs:

Model[Name −> "MOSFET", Selector −> "AC", ],Model[Name −> "MOSFET", Selector −> "DC", ],Model[Name −> "MOSFET", Selector −> "Transient", ]

By assigning several selector keys to a model definition, you can set up a list of alias names forthe model. This feature allows you to configure models for use with several closely related analysismodes, such as AC and noise analysis (see DefaultSelector in Section 3.5.1). To prepare a modelfor use with both AC and noise analysis, your selector specification should be written as follows:

Model[Name −> "MOSFET", Selector −> "AC", "Noise", ]

Page 195: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.2 Subcircuit and Device Model Definition 193

Internally, all model selectors are converted to strings. Therefore, Selector−>symbol andSelector−>ToString[symbol] are equivalent selector specifications.

Likewise, you can specify the selector in a model reference (see Section 3.1.8) either as asymbol or a string regardless of the data type used in the model definition.

Scope

Scope−>Local restrict the visibility of the model definition to thesurrounding Circuit object

Scope−>Global store the model definition in the global subcircuit database

Format of the Scope argument.

The optional argument Scope determines the scope of the model definition. With the default settingScope −> Local, the model can only be referenced from Netlist objects inside the Circuit objectthat contains the corresponding Model statement. With Scope −> Global, the model is stored in theglobal subcircuit database and can be accessed by other Circuit objects.

You can use the Scope mechanism to implement a library of frequently used device models separatelyfrom any top-level circuit description and load the models into Analog Insydes’ global subcircuitdatabase. This can be accomplished by implementing a set of models in a Mathematica *.m file asillustrated below.

(* Begin MyModels.m *)Circuit[

Model[Name −> "BJT", Selector −> "AC", Scope −> Global, Definition −> ],

Model[Name −> "MOSFET", Selector −> "AC", Scope −> Global, Definition −> ],

] // ExpandSubcircuits;(* End MyModels.m *)

The library file "MyModels.m" can then be loaded using the command Get["MyModels.m"].

See also: GlobalSubcircuits (Section 3.3.4), RemoveSubcircuit (Section 3.3.8).

Page 196: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

194 3. Reference Manual

Ports

Ports−>portspec, portspec, † † † specify the nodes in the model definition which serve asexternal connection points

Format of the Ports argument.

With the Ports keyword, you can define the port nodes of a model. The value of the argumentmust be a list of the identifiers of the model nodes which serve as external connection points. Nodesin a model definition which are not listed in the Ports statement (internal nodes) are not accessiblefrom the outside.

"string" or symbol declare a required port node

Optional[port] declare port as optional port node; if port remainsunconnected in a model reference, treat it as if it were aninternal node of the model

Optional[port, default] declare port as optional port node; if port remainsunconnected in a model reference, connect it to the nodedefault instead

Values for the port specification portspec.

For a three-pin BJT model with collector (C), base (B), and emitter (E) terminals, the list of port nodescan be specified as a list of strings

Ports −> "C", "B", "E"

or, equivalently, as a list of symbols

Ports −> C, B, E

Although there is no semantic difference between these two Ports declarations, it isrecommended that you always use strings as port node identifiers. This avoids potentialerrors caused by accidentally assigning a value to a Mathematica symbol which is used as aport node identifier in some model definitions. For example, the assignment C = 1 + x willcorrupt the latter of the above Ports declarations whereas the version that uses strings isnot affected.

The global ground node 0 (or "0") may not be used as a port identifier.

In a model reference, all required ports listed in the Ports argument of the corresponding modeldefinition must be connected to an external node exactly once; otherwise, subcircuit expansion fails.

Page 197: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.2 Subcircuit and Device Model Definition 195

By declaring a port as Optional, you can tell Analog Insydes to ignore any missing connections tothis port and perform some default action instead, such as connecting the port to the ground node.This is useful for modeling integrated semiconductor devices with substrate pins. If the substratepin of a BJT or MOSFET model is an optional port, you can use the same model definition forboth three-pin and four-pin devices. If you write the Ports specifications for these device types asshown below, then the substrate pin is connected implicitly to the ground node and source terminal,respectively, whenever a BJT or MOSFET model is instantiated as a three-pin device.

The following Ports declaration causes the substrate pin S of a BJT device to be connected to theground node if S is left unconnected:

Ports −> "C", "B", "E", Optional["S", 0]

This causes the bulk node B of a MOSFET device to be connected to the source terminal if the portnode B is left unconnected:

Ports −> "D", "G", "S", Optional["B", "S"]

You can also tell Analog Insydes to leave an unconnected node floating by using Optional withouta second argument. The following Ports declaration treats S as if it were an internal node of themodel definition if S is left unconnected.

Ports −> "C", "B", "E", Optional["S"]

The second node given in an Optional declaration must be a required port, an internalnode of the model definition, or the global ground node.

Parameters

Parameters−>parspec, parspec, † † † specify the symbols which represent parameters of a modeldefinition

Format of the Parameters argument.

With the Parameters keyword, you can specify the set of symbols which represent the parametersof a model definition. Possible values are:

symbol declare symbol as an instance-specific model parameter

Global[symbol] declare symbol as a global quantity but allowinstance-specific value assignments

Values for the parameter specification parspec.

Page 198: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

196 3. Reference Manual

Any symbol which appears in the value field of a model netlist entry or in a set of behavioral equa-tions can be designated as a parameter. The difference between parameters and other symbols is thatyou can assign instance-specific values only to parameters. Other symbols are regarded as globalquantities which cannot be bound to instance-specific values in a model reference. In addition, if amodel parameter p is left unbound in a model reference, it will be replaced by a uniquely instantiatedsymbol p$instance upon subcircuit expansion whereas symbols representing global quantities are notchanged. The following line shows a valid example for the Parameters declaration of a BJT model:

Parameters −> IS, N, BF, BR

In some cases it is necessary to override the value of a global circuit parameter locally for a particularmodel instance. For example, you may have set the environmental temperature TEMP in a Circuitobject with the GlobalParameters statement

Circuit[Netlist[ ],GlobalParameters[TEMP −> 300.15]

]

but you want to specify a different operating temperature for an individual device, such as a tem-perature sensor or the output transistor of a power amplifier. In order to override the global valueof TEMP for this device, the local temperature value must be specified explicitly in the correspondingmodel reference:

QOUT, VCC −> C, 5 −> B, out −> E,Model −> BJT, Selector −> DC,IS −> 1.*^−16, N −> 1., BF −> 100., BR −> 1., TEMP −> 340.

However, TEMP is a global quantity and not an instance parameter of the model BJT/DC. Therefore,the local setting TEMP −> 340. in the model reference QOUT has no effect unless the Parametersspecification in the model definition is modified as follows:

Parameters −> IS, N, BF, BR, Global[TEMP]

Now the setting Global[TEMP] allows you to change the value of TEMP individually for any instanceof BJT/DC while the setting from the GlobalParameters list will be used for all instances for whichno local temperature value is given.

Defaults

Defaults−>param−>value, param−>value, † † † specify default values for model parameters

Format of the Defaults argument.

With the Defaults keyword, you can specify default values for model parameters which have beenleft unbound in a model reference. For example, with the settings

Page 199: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.2 Subcircuit and Device Model Definition 197

Parameters −> IS, N, BF, BR, Global[TEMP],Defaults −> IS −> 1.*^−16, N −> 1., BF −> 100.,

BR −> 1., TEMP −> 300.15,

you can instantiate a default BJT device without having to specify values for the parameters in themodel reference:

QDEF, nout −> C, 2 −> B, 3 −> E, Model −> BJT, Selector −> DC

During subcircuit expansion the numerical default values specified by the Defaults argument areused as model parameter values. The above model reference is thus processed as if its value fieldhad been specified as shown below.

QDEF, nout −> C, 2 −> B, 3 −> E, Model −> BJT, Selector −> DC,IS −> 1.*^−16, N −> 1., BF −> 100., BR −> 1., TEMP −> 300.15

Translation

Translation−>param−>expr, param−>expr, † † † specify model parameter translation rules

Format of the Translation argument.

The optional argument Translation allows you to specify conversion rules for calculating values ofinternal model parameters from external parameters declared with the Parameters argument.

For example, the following code defines a simple BJT small-signal model with the external param-eters RB (base resistance) and beta (current gain). Internally, the model is implemented using aVCCS whose transconductance gm is calculated automatically from RB and beta by means of theTranslation rule gm −> RB*beta.

Model[Name −> "BJT", Selector −> "SimpleACgm",Ports −> "C", "B", "E",Parameters −> RB, beta,Translation −> gm −> RB*beta,Definition −> Netlist[

"RB", "B", "E", RB,"VC", "B", "E", "C", "E", gm

]]

Translation rules may also be specified using the RuleDelayed operator (:>). This enables you todefer the evaluation of function calls on the right-hand sides of translation rules until model expan-sion. In the following list of rules, the thermal voltage Vt of a semiconductor device is calculated by

Page 200: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

198 3. Reference Manual

a delayed rule to prevent the function ThermalVoltage to be evaluated before the value of TEMP isknown for an individual device.

Translation −> Is −> Js*Area, Vt :> ThermalVoltage[TEMP]

If Vt were calculated using a simple Rule (−>), ThermalVoltage would already be called at the timeof model definition, i.e. execution of the Model command.

Symbolic

Symbolic−>symbol, symbol, † † † declare behavioral model parameters as symbolic quantities

Symbolic−>symbol−>alias, † † † declare behavioral model parameters as symbolicquantities and specify alias names to be used in symboliccircuit equations

Format of the Symbolic argument.

The optional argument Symbolic is used only in conjunction with analog behavioral model defini-tions. It lets you specify the subset of the model parameters declared in the Parameters sectionthat will be treated as symbolic quantities in a set of behavioral model equations. Model parameterswhich are not listed in the Symbolic section are always replaced by their numerical values whenyou set up circuit equations. This feature allows you to restrict the parameters that will appear in asystem of symbolic circuit equations to the ones you really wish to see.

The following code defines a DC model for a temperature-dependent linear resistor. The modelparameters are the nominal resistance RES, the first-order temperature coefficient TC1, the ambienttemperature TEMP, and the reference temperature TNOM. The Symbolic argument declares RES as amodel parameter which will appear in symbolic circuit equations. The other parameters will alwaysbe evaluated numerically and will not appear explicitly in circuit equations.

Model[Name −> "RES", Selector −> "DC",Ports −> "P", "N",Parameters −> RES, TC1, Global[TEMP, TNOM],Symbolic −> RES,Variables −> Voltage["P", "N"], Current["P", "N"],Definition −> Equations[

Voltage["P", "N"] ==RES*(1 + TC1*(TEMP − TNOM))*Current["P", "N"]

]]

Names of device model or instance parameters in netlists imported from external circuit simulatorswith ReadNetlist sometimes have lengthy or ugly names. The alternative format of the Symbolic

Page 201: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.2 Subcircuit and Device Model Definition 199

argument allows you to assign alias names to model parameters which will appear in symboliccircuit equations in place of the original names.

For example, the following declaration causes the symbol R to be used instead of the originalmodel parameter name RES whenever you set up symbolic circuit equations with the above modeldefinition.

Symbolic −> RES −> R

Variables

Variables−>varspec, varspec, † † † specify the identifiers which represent unknowns in a setof model equations

Format of the Variables argument.

The Variables argument is used only in conjunction with analog behavioral model definitions. Itserves to declare the identifiers in a set of model equations which represent the unknowns. Theidentifiers have to be of the following form:

symbol declare symbol as an internal model variable

Voltage[port, port] or Current[port, port]declare a model variable as a branch voltage or branchcurrent

Values for the variable specification varspec.

For each port branch you must declare both the branch voltage and the branch current asmodel variables, even in cases where one of the two does not appear explicitly in theequations.

Page 202: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

200 3. Reference Manual

Definition

Definition−>Netlist[† † †]|Circuit[† † †]define a model in terms of an equivalent Netlist orCircuit object

Definition−>Equations[† † †] define a behavioral model in terms of a system ofequations

Format of the Definition argument.

With the Definition argument, you specify the implementation of a model. A model can beimplemented either as an equivalent circuit or as a set of linear or nonlinear differential-algebraicequations.

You may use a Netlist or a Circuit object to implement an equivalent circuit. The netlist thatrepresents the equivalent circuit may contain primitive devices as well as further model references.There is no fixed limit of the subcircuit nesting level.

The following example shows a model implementation for a simple RC tank.

Definition −> Netlist[R, in, out, R,C, out, ref, C

]

A Circuit object may contain local ModelParameters sections as well as local Model definitions.Local model definitions and parameter sets should have Scope −> Local to prevent interferencewith the global subcircuit and parameter databases. Using a Circuit instead of a simple Netlistfeature allows you to define models with instance-specific model parameter sets, i.e. device modelparameters whose values are calculated from model instance parameters.

For example, the following code implements a device-level description of a bipolar differential pairwith emitter degeneration resistors. The model definition contains a local ModelParameters state-ment in which the ohmic collector and emitter resistances RC and RE are calculated as functions ofthe BJT area factor Area for each instance of the subcircuit DifferentialPair/DeviceLevel.

Page 203: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.2 Subcircuit and Device Model Definition 201

Subcircuit[Name −> "DifferentialPair", Selector −> "DeviceLevel",Ports −> "H1", "H2", "IN1", "IN2", "L",Parameters −> Area, RED,Definition −> Circuit[

Netlist["Q1", "H1" −> "C", "IN1" −> "B", "ED1" −> "E",

Model −> "BJT", Selector −> Selector["BJT", "Q1"],Parameters −> "LocalNPN",

"RED1", "ED1", "L", RED,"Q2", "H2" −> "C", "IN2" −> "B", "ED2" −> "E",

Model −> "BJT", Selector −> Selector["BJT", "Q2"],Parameters −> "LocalNPN",

"RED2", "ED2", "L", RED],ModelParameters[Name −> "LocalNPN", Type −> "NPN",

IS −> 2.*^−15, BF −> 200., RC −> 50./Area, RE −> 2./Area]]

]

Analog Insydes allows you to implement arbitrary multi-dimensional voltage-current relations asanalog behavioral models. ABMs are implemented using sets of Equations instead of Netlist orCircuit objects. Each model equation must be written in the form lhs == rhs, where lhs and rhsdenote arbitrary Mathematica expressions.

If you implement a behavioral model using the Equations keyword, you must declare theunknowns of the model equations in the Variables section.

The following code implements a nonlinear DC model for a bipolar junction diode with seriesresistance Rs. The first equation serves to compute the effective diode voltage vdeff. It is written inimplicit notation to demonstrate that Analog Insydes does not require model equations to be writtenin explicit form var == expr, where var denotes a single symbol or branch quantity identifier.

Model[Name −> "Diode", Selector −> "DC",Ports −> "A", "C", Parameters −> Rs, Is, Global[Vt],Variables −> Voltage["A", "C"], Current["A", "C"], vdeff,Definition −> Equations[

Voltage["A", "C"] − Rs*Current["A", "C"] − vdeff == 0,Current["A", "C"] == Is*(Exp[vdeff/Vt] − 1)

]]

In addition, the Model command lets you implement behavioral models involving ordinary differen-tial equations (ODEs). In general, the independent variable of such equations is the time variable,

Page 204: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

202 3. Reference Manual

denoted by the symbol Time, but other quantities than time may be used as independent variable aswell (see Section 3.5.1).

You can attach a trailing tick mark (’) to a variable in a set of model equations to denote a timederivative. The following model definition implements the voltage-current relation of a linear, time-invariant capacitor in the time domain. The time derivative of the capacitor voltage is denoted byVoltage["P", "N"]’.

Variables −> Current["P", "N"], Voltage["P", "N"],Definition −> Equations[

Current["P", "N"] == C*Voltage["P", "N"]’],

To denote a derivative of a variable var with respect to some other quantity q, you must useMathematica’s full derivative notation

Derivative[n][var][q]

where n is the order of the differentiation. Of course, you can also use this notation for time deriva-tives. For example, the first derivative of the variable vdeff with respect to time can be writtenas:

Derivative[1][vdeff][Time]

Since Time is the default quantity with respect to which derivatives are computed, the above linecan be abbreviated as follows.

Derivative[1][vdeff]

Any derivative term lacking an explicit specification of the independent variables isassumed to be a derivative with respect to Time.

Your equations may involve second and higher-order derivatives.

Your equations may not involve partial derivatives.

See also: IndependentVariable (Section 3.5.1), Section 3.1.7.

InitialGuess

InitialGuess−>var−>value, var−>value, † † † specify initial guesses for the values of behavioral modelvariables

Format of the InitialGuess argument.

Page 205: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.2 Subcircuit and Device Model Definition 203

With the InitialGuess argument, you can specify a set of numerical values that will be usedby NDAESolve (Section 3.7.5) as initial guess for the solution of behavioral model variables. Initialguesses may be specified for some or all of the variables listed in the corresponding Variablesdeclaration.

The default value for initial guesses is 0.

When you analyze strongly nonlinear circuits, an educated initial guess helps to speed upDC calculations with NDAESolve considerably.

The effect of initial guess specifications on the convergence behavior of NDAESolve dependson the type of circuit equations.

In the example shown below, initial guesses of V and V are specified for the model vari-ables vdeff and Voltage["A", "C"], respectively. No initial guess is given for Current["A", "C"],therefore, NDAESolve uses 0 as initial guess for this current.

Model[Name −> "Diode", Selector −> "DC",Ports −> "A", "C", Parameters −> Rs, Is, Global[Vt],Variables −> Voltage["A", "C"], Current["A", "C"], vdeff,Definition −> Equations[

Voltage["A", "C"] − Rs*Current["A", "C"] − vdeff == 0,Current["A", "C"] == Is*(Exp[vdeff/Vt] − 1)

],InitialGuess −> vdeff −> 0.7, Voltage["A", "C"] −> 0.8

]

InitialConditions

InitialConditions−>var−>value, var−>value, † † † specify initial conditions for dynamic model variables

Format of the InitialConditions argument.

With the InitialConditions argument, you can specify initial conditions for dynamic variables inbehavioral model equations. Initial conditions can be assigned to any quantity x whose derivative x’appears in the equations. This applies to internal model variables as well as to branch voltages andcurrents.

The following example shows how to specify an initial condition for the branch quantityVoltage["P", "N"]. Note that it is not important whether this quantity appears directly in theequations or not. However, its derivative Voltage["P", "N"]’ must be present as a prerequisite forthe assignment of an initial condition.

Page 206: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

204 3. Reference Manual

Model[Name −> "Capacitor", Selector −> "Behavioral",Ports −> "P", "N", Parameters −> C,Variables −> Current["P", "N"], Voltage["P", "N"],Definition −> Equations[

Current["P", "N"] == C*Voltage["P", "N"]’],InitialConditions −> Voltage["P", "N"] −> 1.52

]

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

The following model commands implement a CCCS-based model for bipolar transistors and anequivalent VCCS-based model. The transconductance of the VCCS in BJT/SimpleACgm is calculatedautomatically from the parameters RB and beta by means of a translation rule.

CCCS and VCCS-basedBJT small-signal models.

In[2]:= Circuit[Model[

Name −> "BJT", Selector −> "SimpleACbeta",Scope −> Global, Ports −> "C", "B", "E",Parameters −> RB, beta,Definition −> Netlist[

"RB", "B", "X", RB,"CC", "X", "E", "C", "E", beta

]],Model[

Name −> "BJT", Selector −> "SimpleACgm",Scope −> Global, Ports −> "C", "B", "E",Parameters −> RB, beta,Translation −> gm −> RB*beta,Definition −> Netlist[

"RB", "B", "E", RB,"VC", "B", "E", "C", "E", gm

]]

] // ExpandSubcircuits;

List the contents of theglobal subcircuit database.

In[3]:= GlobalSubcircuits[]

Out[3]= BJT, SimpleACbeta, BJT, SimpleACgmThe Circuit object shown below describes a common-source amplifier with a MOSFET device. Inthe model definition for MOSFET, the bulk terminal B is defined as an optional port. Since this nodeis not connected in the top-level netlist, the bulk terminal is connected implicitly to the source node.

Page 207: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.2 Subcircuit and Device Model Definition 205

This netlist describes acommon-source amplifier.

In[4]:= csamp = Circuit[Netlist[

V1, 1, 0, Value −> DC −> 1.5, AC −> 1,M1, "out" −> "D", 1 −> "G", 3 −> "S",

Model −> "MOSFET", Selector −> "DCSmallSignal",GM −> 2.*^−4, GMB −> 3.*^−5, GDS −> 1.*^−6,

RD, "VDD", "out", Symbolic −> Rd, Value −> 1.*^6,RS, 3, 0, Symbolic −> Rs, Value −> 5000.,VDD, "VDD", 0, Value −> DC −> 3.3, _ −> 0

],Model[

Name −> "MOSFET", Selector −> "DCSmallSignal",Ports −> "D", "G", "S", Optional["B", "S"],Parameters −> gm, gmb, Gds, GM, GMB, GDS,Definition −> Netlist[

VCG, "G", "S", "D", "S", Symbolic −> gm,Value −> GM,

VCB, "B", "S", "D", "S", Symbolic −> gmb,Value −> GMB,

GDS, "D", "S", Symbolic −> Gds,Value −> GDS

]]

]

Out[4]= Circuit

Expand the MOSFETmodel.

In[5]:= ExpandSubcircuits[csamp] // DisplayForm

Out[5]//DisplayForm=Netlist Flat, 7 Entries:

V1, 1, 0, Value DC 1.5, AC 1VCG$M1, 1, 3, out, 3, Symbolic gm$M1, Value 0.0002VCB$M1, 3, 3, out, 3, Symbolic gmb$M1, Value 0.00003GDS$M1, out, 3, Symbolic Gds$M1, Value 1.106RD, VDD, out, Symbolic Rd, Value 1.106RS, 3, 0, Symbolic Rs, Value 5000.VDD, VDD, 0, Value DC 3.3, _ 0

This example shows the effect of the argument Symbolic in a Model statement. The model equationsdescribe the DC behavior of a linear resistor including first-order temperature dependence. Note thatalthough there are four model parameters, only the resistance appears explicitly in symbolic circuitequations. Note also that the alias name R is used instead of RES to denote the resistance.

Page 208: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

206 3. Reference Manual

A circuit with a resistormodel.

In[6]:= resckt = Circuit[Netlist[

V0, 1, 0, Symbolic −> V0, Value −> 1,R1, 1 −> "P", 0 −> "N",

Model −> "RES", Selector −> "DC",RES −> 1000., TC1 −> 10^−3

],Model[

Name −> "RES", Selector −> "DC",Ports −> "P", "N",Parameters −> RES, TC1, Global[TEMP, TNOM],Defaults −> TC1 −> 0, TNOM −> 300.15, TEMP −> 300.15,Symbolic −> RES −> R,Variables −> Voltage["P", "N"], Current["P", "N"],Definition −> Equations[

Voltage["P", "N"] ==RES*(1 + TC1*(TEMP − TNOM))*Current["P", "N"]

]],GlobalParameters[TEMP −> 310.]

]

Out[6]= Circuit

Note that only R$R1 iskept in symbolic form.

In[7]:= CircuitEquations[resckt, AnalysisMode −> DC,ElementValues −> Symbolic] // DisplayForm

Out[7]//DisplayForm=I$PN$R1 I$V0 0,V$1 V0, V$1 1.00985 I$PN$R1 R$R1, V$1, I$V0, I$PN$R1,DesignPoint V0 1, R$R1 1000., TEMP 310.

The following example demonstrates the use of local model parameter sets in a subcircuit definition.The netlist shown below represents a bipolar differential pair with emitter degeneration resistors.The Circuit object contains a local ModelParameters statement in which the values of the BJT’sohmic collector and emitter resistances are calculated as a function of the area factor.

Page 209: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.2 Subcircuit and Device Model Definition 207

A differential pair withemitter degenerationresistors.

In[8]:= dpwedr = Subcircuit[Name −> "DifferentialPair", Selector −> "DeviceLevel",Ports −> "H1", "H2", "IN1", "IN2", "L",Parameters −> Area, RED,Definition −> Circuit[

Netlist["Q1", "H1" −> "C", "IN1" −> "B", "ED1" −> "E",

Model −> "BJT", Selector −> Selector["BJT", "Q1"],Parameters −> "LocalNPN",

"RED1", "ED1", "L", RED,"Q2", "H2" −> "C", "IN2" −> "B", "ED2" −> "E",

Model −> "BJT", Selector −> Selector["BJT", "Q2"],Parameters −> "LocalNPN",

"RED2", "ED2", "L", RED],ModelParameters[Name −> "LocalNPN", Type −> "NPN",

IS −> 2.*^−15, BF −> 200., RC −> 50./Area,RE −> 2./Area]

]]

Out[8]= SubcircuitDifferentialPair, DeviceLevel, 5

This netlist describes adifferential amplifier onthe basis of the subcircuitimplemented above.

In[9]:= diffamp = Circuit[Netlist[

V0, "VCC", 0, Value −> DC −> 9., _ −> 0,V1, 2, 0, Value −> DC −> 4.5, AC −> 1,V2, 3, 0, Value −> DC −> 4.5, AC −> 0,R1, "VCC", 4, 5000.,R2, "VCC", 5, 5000.,DP1, 4 −> "H1", 5 −> "H2", 2 −> "IN1",

3 −> "IN2", 6 −> "L",Model −> "DifferentialPair",Selector −> "DeviceLevel",RED −> 100., Area −> 2.,

IBIAS, 6, 0, Value −> DC −> 0.001, _ −> 0],dpwedr

]

Out[9]= Circuit

Set up circuit equations. In[10]:= diffampeqs = CircuitEquations[diffamp,AnalysisMode −> DC, ElementValues −> Symbolic]

Out[10]= DAEDC, 2525

The nominal collector andemitter resistances havebeen divided by the areafactor.

In[11]:= RC$Q1$DP1, RE$Q1$DP1 /. GetDesignPoint[diffampeqs]

Out[11]= 25., 1.

The following code is a slightly more complex example for a behavioral model definition. TheModel statement implements a nonlinear DC model for a bipolar junction diode, taking into accountjunction voltage reduction due to series resistance (Rs) and DC convergence issues (GMIN).

Page 210: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

208 3. Reference Manual

This code defines a diodemodel and stores it in theglobal subcircuit database.

In[12]:= Circuit[Model[

Name −> "Diode", Selector −> "DC",Scope −> Global, Ports −> "A", "C",Parameters −> Is, Rs, Global[TEMP, GMIN],Defaults −> Is −> 1.*^−15, Rs −> 0, TEMP −> 300.,

GMIN −> 1.*^−12, $q −> 1.6021918*^−19,$k −> 1.3806226*^−23,

Translation −> Vt −> $k*TEMP/$q,Symbolic −> Is, Vt, Rs, GMIN,Variables −> Voltage["A", "C"],

Current["A", "C"], vdeff,Definition −> Equations[

Current["A", "C"] ==Is*(Exp[vdeff/Vt] − 1) + vdeff*GMIN,

vdeff == Voltage["A", "C"] − Rs*Current["A", "C"]],InitialGuess −> vdeff −> 0.7

]] // ExpandSubcircuits;

This defines a circuit witha diode in seriesconnection with a resistor.

In[13]:= diodeckt = Circuit[Netlist[

V1, 1, 0, Vin,R1, 1, 2, Symbolic −> R1, Value −> 1000.,D1, 2 −> "A", 0 −> "C",

Model −> "Diode", Selector −> "DC", Rs −> 10.],GlobalParameters[TEMP −> 330.]

]

Out[13]= Circuit

Set up modified nodalequations.

In[14]:= diodeeqs = CircuitEquations[diodeckt,AnalysisMode −> DC, ElementValues −> Symbolic]

Out[14]= DAEDC, 55

Display the equations. In[15]:= diodeeqs // DisplayForm

Out[15]//DisplayForm=

I$V1 V$1 V$2

R1 0, I$AC$D1

V$1 V$2

R1 0,

V$1 Vin, I$AC$D1 1 Evdeff$D1Vt$D1 Is$D1 GMIN vdeff$D1,

vdeff$D1 I$AC$D1 Rs$D1 V$2,V$1, V$2, I$V1, I$AC$D1, vdeff$D1,DesignPoint Vin Vin, R1 1000., Is$D1 1.1015,

Vt$D1 0.0284364, Rs$D1 10., GMIN 1.1012, TEMP 330.

Calculate the DC responsewhile sweeping Rs$D1from to .

In[16]:= diodedc = NDAESolve[diodeeqs,Vin, −1., 5., Rs$D1, 0., 200., 50.];

Page 211: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.2 Subcircuit and Device Model Definition 209

Plot the diode voltage. In[17]:= TransientPlot[diodedc, V$2[Vin], Vin, −1., 5.]

-1 1 2 3 4 5Vin

-1

-0.5

0.5

1

1.5

V$2[Vin]

Out[17]= Graphics

This example demonstrates how to specify initial conditions. The netlist describes an RLC seriesresonator. The behavior of the LC subcircuit is modeled by a system of differential equations.

An RLC circuit with abehavioral description forthe LC resonator.

In[18]:= rlcfilter = Circuit[Netlist[

R, 1, 0, 100.,LC, 1 −> "P", 0 −> "N",

Model −> "LCSeriesResonator",Selector −> "Behavioral", L −> 0.02, C −> 5.*^−7

],Model[

Name −> "LCSeriesResonator",Selector −> "Behavioral",Ports −> "P", "N", Parameters −> L, C,Variables −> Current["P", "N"], Voltage["P", "N"],

vind, vcap,Definition −> Equations[

vind == L*Current["P", "N"]’,Voltage["P", "N"] − vcap − vind == 0,Current["P", "N"] == C*vcap’

],InitialConditions −> vcap −> 5.,

Current["P", "N"] −> −0.02]

]

Out[18]= Circuit

Set up time-domain circuitequations.

In[19]:= rlcfeqs = CircuitEquations[rlcfilter,AnalysisMode −> Transient,InitialConditions −> Automatic]

Out[19]= DAETransient, 64

Display the circuitequations.

In[20]:= rlcfeqs // DisplayForm

Out[20]//DisplayForm=I$PN$LCt 0.01 V$1t 0, vind$LCt 0.02 I$PN$LC t,

vcap$LCt vind$LCt V$1t 0, I$PN$LCt 5.107 vcap$LC t, vcap$LC0 5., I$PN$LC0 0.02,

V$1t, I$PN$LCt, vind$LCt, vcap$LCt, DesignPoint

Page 212: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

210 3. Reference Manual

Simulate the circuit. In[21]:= rlcftran = NDAESolve[rlcfeqs, t, 0., 0.002]

Out[21]=I$PN$LC InterpolatingFunction0, 0.002, ,vcap$LC InterpolatingFunction0, 0.002, ,V$1 InterpolatingFunction0, 0.002, ,vind$LC InterpolatingFunction0, 0.002,

Display the capacitorvoltage and the inductorcurrent.

In[22]:= TransientPlot[rlcftran, vcap$LC[t], I$PN$LC[t],t, 0., 0.002, SingleDiagram −> False, PlotRange −> All]

0.0005 0.001 0.0015 0.002t

-0.025

-0.02

-0.015

-0.01

-0.005

0.005

0.01

I$PN$

0.0005 0.001 0.0015 0.002t

-2

2

4

vcap

Out[22]= GraphicsArray

3.2.2 Subcircuit

The command Subcircuit is an alias for Model (Section 3.2.1). You may use either of the twofunction names to define a subcircuit or device model.

Page 213: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.3 Model Library Management 211

3.3 Model Library Management

Analog Insydes provides a number of functions for inspecting and managing the contents of its globalsubcircuit database and external model libraries. These functions are described in detail below.

ListLibrary (Section 3.3.1) listing contents of a library

FindModel (Section 3.3.2) locating models

FindModelParameters (Section 3.3.3)locating model parameters

GlobalSubcircuits (Section 3.3.4)inspecting global subcircuit database

GlobalModelParameters (Section 3.3.5)inspecting global model-parameters database

LoadModel (Section 3.3.6) loading models

LoadModelParameters (Section 3.3.7)loading model parameters

RemoveSubcircuits (Section 3.3.8)removing subcircuits from global database

RemoveModelParameters (Section 3.3.9)removing model parameters from global database

3.3.1 ListLibrary

ListLibrary[] lists the contents of the default model library

ListLibrary["libfile"] lists the contents of the model library "libfile"

Command structure of ListLibrary.

With ListLibrary you can list the contents of one or several model library files. ListLibraryreturns the model definitions and model parameter sets stored in the specified files.

ListLibrary has the following options:

Page 214: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

212 3. Reference Manual

option name default value

LibraryPath Inherited[AnalogInsydes]the search path for device model libraries(see Section 3.14.3)

ModelLibrary Inherited[AnalogInsydes]the name of the library to be searched fordevice models (see Section 3.14.4)

Options for ListLibrary.

See also: FindModel (Section 3.3.2), FindModelParameters (Section 3.3.3), LoadModel (Section 3.3.6),LoadModelParameters (Section 3.3.7).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

List the contents of thedefault model library.

In[2]:= ListLibrary[]

Out[2]=FullModels‘ ModelBJT, DC,

SpiceDC, GummelPoonDC, Transient, Spice, GummelPoon , ModelBJT, AC, SpiceAC, Noise, SpiceNoise , ModelMOSFET, DC, SpiceDC, Transient, Spice , ModelMOSFET, AC, SpiceAC, Noise, SpiceNoise , ModelDiode, DC, SpiceDC, Transient, Spice , ModelDiode, AC, SpiceAC, Noise, SpiceNoise , ModelJFET, DC, SpiceDC, Transient, Spice , ModelJFET, AC, SpiceAC, Noise, SpiceNoise , ModelRES, DC, Transient , ModelRES, AC , ModelRES, Noise , ModelCAP, DC, Transient , ModelCAP, AC, Noise , ModelIND, DC, Transient , ModelIND, AC, Noise

List the contents of thespecified libraries.

In[3]:= ListLibrary[ModelLibrary −> "BasicResistorModels‘","FullDiodeModels‘"]

Out[3]=BasicResistorModels‘ ModelRES, AC, BasicSpiceAC,

DC, BasicSpiceDC, Transient, BasicSpice , ModelRES, Noise, SpiceNoise ,

FullDiodeModels‘ ModelDiode, DC, SpiceDC, Transient, Spice ,

ModelDiode, AC, SpiceAC, Noise, SpiceNoise

Page 215: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.3 Model Library Management 213

3.3.2 FindModel

FindModel[name, selector] searches the default library for the model definitionname/selector

Command structure of FindModel.

FindModel searches a list of model library files for a specified model definition and returns thename of the first library in which the model was found. FindModel returns the symbol $Failed ifit cannot find the model definition in any of the library files.

FindModel has the following options:

option name default value

LibraryPath Inherited[AnalogInsydes]the search path for device model libraries(see Section 3.14.3)

ModelLibrary Inherited[AnalogInsydes]the name of the library to be searched fordevice models (see Section 3.14.4)

Options for FindModel.

See also: FindModelParameters (Section 3.3.3), ListLibrary (Section 3.3.1), LoadModel (Sec-tion 3.3.6).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Determine the name of thelibrary file which containsthe model"BJT/GummelPoon" .

In[2]:= FindModel["BJT", "GummelPoon"] // InputForm

Out[2]//InputForm= "FullModels‘"

Return the name of thefirst library from the givenlist which contains themodel "BJT/AC".

In[3]:= FindModel["BJT", "AC",ModelLibrary −> "FullDiodeModels‘", "BasicBJTModels‘",

"SimplifiedModels‘"] // InputForm

Out[3]//InputForm= "BasicBJTModels‘"

Page 216: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

214 3. Reference Manual

3.3.3 FindModelParameters

FindModelParameters[name] searches the default library for the parameter set name

Command structure of FindModelParameters.

FindModelParameters searches a list of model library files for a specified model parameter set andreturns the name of the first library in which the parameter set was found. FindModelParametersreturns the symbol $Failed if it cannot find the parameter set in any of the library files.

FindModelParameters has the following options:

option name default value

LibraryPath Inherited[AnalogInsydes]the search path for device model libraries(see Section 3.14.3)

ModelLibrary Inherited[AnalogInsydes]the name of the library to be searched fordevice models (see Section 3.14.4)

Options for FindModelParameters.

See also: FindModel (Section 3.3.2), ListLibrary (Section 3.3.1), LoadModelParameters (Sec-tion 3.3.7).

3.3.4 GlobalSubcircuits

GlobalSubcircuits[] lists the names and selectors of the subcircuit definitionsstored in the global subcircuit database

Command structure of GlobalSubcircuits.

With GlobalSubcircuits you can inspect the contents of the global subcircuit database.GlobalSubcircuits returns a list of the names and selectors of the subcircuits stored in the database.

GlobalSubcircuits not only returns the name under which a model was loaded but also allalias names assigned to the model definition. For example, "Diode", "DC" | "Transient" denotesa model definition which can be accessed through Name −> "Diode", Selector −> "DC" as wellthrough Name −> "Diode", Selector −> "Transient".

See also: FindModel (Section 3.3.2), GlobalModelParameters (Section 3.3.5).

Page 217: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.3 Model Library Management 215

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Load two modeldefinitions from the modellibrary and store them inthe global subcircuitdatabase.

In[2]:= Circuit[LoadModel["Diode", "Transient", Scope −> Global],LoadModel["JFET", "AC", Scope −> Global]

] // ExpandSubcircuits;

List the contents of theglobal subcircuit database.

In[3]:= GlobalSubcircuits[]

Out[3]= Diode, DC SpiceDC Transient Spice,JFET, AC SpiceAC Noise SpiceNoise

3.3.5 GlobalModelParameters

GlobalModelParameters[] lists the names of the model parameter sets stored in theglobal model parameter database

Command structure of GlobalModelParameters.

With GlobalModelParameters you can inspect the contents of the global model parameter database.GlobalModelParameters returns a list of the names of the parameter sets stored in the database.

See also: FindModelParameters (Section 3.3.3), GlobalSubcircuits (Section 3.3.4).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define two diode modelparameter sets.

In[2]:= Circuit[ModelParameters[Name −> "Diode1", Scope −> Global,

IS −> 1.2*^−12, N −> 1.1],ModelParameters[Name −> "Diode2", Scope −> Global,

IS −> 1.0*^−14, N −> 1.5]] // ExpandSubcircuits;

List the contents of theglobal model parameterdatabase.

In[3]:= GlobalModelParameters[] // InputForm

Out[3]//InputForm= "Diode1", "Diode2"

Page 218: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

216 3. Reference Manual

3.3.6 LoadModel

LoadModel[name, selector] loads the model definition name/selector from the defaultmodel library

LoadModel["libfile", name, selector]loads the model definition name/selector from the modellibrary "libfile"

LoadModel[name, selector, † † † ]loads the models name/selector, † † †

Command structure of LoadModel.

With LoadModel you can load a model definition from a library file. LoadModel searches a list ofmodel library files and returns the first model definition that matches the specified name and selector.

You can use LoadModel within a Circuit object to load a model definition at run time and assignglobal scope to the model.

LoadModel has the following options:

option name default value

Scope Local the designated scope of the loaded modeldefinition

LibraryPath Inherited[AnalogInsydes]the search path for device model libraries(see Section 3.14.3)

ModelLibrary Inherited[AnalogInsydes]the name of the library to be searched fordevice models (see Section 3.14.4)

Options for LoadModel.

LoadModel only loads Model records from library files; it does not store the models in thedatabase.

To store a loaded model in the database, you must use Circuit and ExpandSubcircuits.

See also: Circuit (Section 3.1.2), ExpandSubcircuits (Section 3.4.1), LoadModelParameters (Sec-tion 3.3.7).

Page 219: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.3 Model Library Management 217

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Load two modeldefinitions from the modellibrary and store them inthe global subcircuitdatabase.

In[2]:= Circuit[LoadModel["Diode", "Transient", Scope −> Global],LoadModel["JFET", "AC", Scope −> Global]

] // ExpandSubcircuits;

List the contents of theglobal subcircuit database.

In[3]:= GlobalSubcircuits[]

Out[3]= Diode, DC SpiceDC Transient Spice,JFET, AC SpiceAC Noise SpiceNoise

3.3.7 LoadModelParameters

LoadModelParameters[name] loads the model parameter set definition name from thedefault model library

LoadModelParameters["libfile", name]loads the model parameter set definition name from "libfile"

LoadModelParameters[name, † † †]loads the model parameter set definitions name, † † †

Command structure of LoadModelParameters.

With LoadModelParameters you can load a model parameter set definition from a library file.LoadModelParameters searches a list of model library files and returns the first model parameterset definition that matches the specified name.

You can use LoadModelParameters within a Circuit object to load a model parameter set definitionat run time and assign global scope to it.

LoadModelParameters has the following options:

Page 220: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

218 3. Reference Manual

option name default value

Scope Local the designated scope of the loaded modelparameter set definition

LibraryPath Inherited[AnalogInsydes]the search path for device model libraries(see Section 3.14.3)

ModelLibrary Inherited[AnalogInsydes]the name of the library to be searched formodel parameter set definitions (seeSection 3.14.4)

Options for LoadModelParameters.

LoadModelParameters only loads ModelParameters records from library files; it does notstore the model parameter sets in the database.

To store a loaded model parameter set in the database, you must use Circuit andExpandSubcircuits.

See also: Circuit (Section 3.1.2), ExpandSubcircuits (Section 3.4.1), LoadModel (Section 3.3.6).

3.3.8 RemoveSubcircuit

RemoveSubcircuit[name, selector]removes the subcircuit definition name/selector from theglobal database

RemoveSubcircuit[All] clears the global subcircuit database

Command structure of RemoveSubcircuit.

RemoveSubcircuit allows you to remove individual subcircuit definitions from the global subcircuitdatabase or to clear the database completely. RemoveSubcircuit returns the list of the names andselectors of the remaining subcircuit definitions.

See also: GlobalSubcircuits (Section 3.3.4), RemoveModelParameters (Section 3.3.9).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 221: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.3 Model Library Management 219

Load two modeldefinitions from the modellibrary and store them inthe global subcircuitdatabase.

In[2]:= Circuit[LoadModel["Diode", "Transient", Scope −> Global],LoadModel["JFET", "AC", Scope −> Global]

] // ExpandSubcircuits;

List the contents of theglobal subcircuit database.

In[3]:= GlobalSubcircuits[]

Out[3]= Diode, DC SpiceDC Transient Spice,JFET, AC SpiceAC Noise SpiceNoise

Removing the model definition automatically clears all alias names for the model. Thus, if youremove the model "JFET/AC", the aliases "JFET/SpiceAC", "JFET/Noise" etc. will be deleted aswell.

Remove the subcircuitdefinition "JFET/AC".

In[4]:= RemoveSubcircuit["JFET", "AC"]

Out[4]= Diode, DC SpiceDC Transient Spice

Delete all remainingsubcircuit definitions.

In[5]:= RemoveSubcircuit[All]

Out[5]=

3.3.9 RemoveModelParameters

RemoveModelParameters[name] removes the model parameter set name from the globaldatabase

RemoveModelParameters[All] clears the global model parameter database

Command structure of RemoveModelParameters.

RemoveModelParameters allows you to remove individual model parameter sets from the globalparameter database or to clear the database completely. RemoveModelParameters returns the list ofthe names of the remaining model parameter sets.

See also: GlobalModelParameters (Section 3.3.5), RemoveSubcircuit (Section 3.3.8).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define two diode modelparameter sets.

In[2]:= Circuit[ModelParameters[Name −> "Diode1", Scope −> Global,

IS −> 1.2*^−12, N −> 1.1],ModelParameters[Name −> "Diode2", Scope −> Global,

IS −> 1.0*^−14, N −> 1.5]] // ExpandSubcircuits;

List the contents of theglobal parameter database.

In[3]:= GlobalModelParameters[]

Out[3]= Diode1, Diode2

Page 222: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

220 3. Reference Manual

Remove the parameter set"Diode1".

In[4]:= RemoveModelParameters["Diode1"]

Out[4]= Diode2

Delete all remaining globalparameter sets.

In[5]:= RemoveModelParameters[All]

Out[5]=

Page 223: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.4 Expanding Subcircuits and Device Models 221

3.4 Expanding Subcircuits and Device Models

Before Analog Insydes can set up a system of circuit equations from a netlist, all subcircuits andmodel references in the netlist must be expanded and instantiated with ExpandSubcircuits. Sub-circuit expansion is taken care of automatically by CircuitEquations, so that, except for debuggingpurposes, there is usually no need to call ExpandSubcircuits explicitly.

3.4.1 ExpandSubcircuits

ExpandSubcircuits[netlist, opts]expands and instantiates all subcircuit and modelreferences in netlist

Command structure of ExpandSubcircuits.

Given a Netlist or Circuit object, ExpandSubcircuits expands all model references and storesmodel definitions to the global model data base. It returns a Netlist object. Expanding subcir-cuits is taken care of automatically by CircuitEquations, so that there is usually no need to callExpandSubcircuits explicitly nor to take care of its options.

ExpandSubcircuits has the following options:

option name default value

AutoloadModels True whether to load device modelsautomatically from the model library

DefaultSelector None the default value to be used to replacegeneric subcircuit selectors

HoldModels None a list of patterns matching the names andselectors of model references that shallremain unexpanded

InstanceNameSeparator Inherited[AnalogInsydes]the separator string for name componentsof model variables and referencedesignators (see Section 3.14.2)

KeepLocalModels False whether to keep local model definitions in anetlist after subcircuit expansion

Options for ExpandSubcircuits, Part I.

Page 224: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

222 3. Reference Manual

option name default value

LibraryPath Inherited[AnalogInsydes]the search path for device model libraries(see Section 3.14.3)

ModelLibrary Inherited[AnalogInsydes]the name of the library to be searched fordevice models (see Section 3.14.4)

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Symbolic All the parameters of behavioral models to bekept symbolic when setting up symboliccircuit equations (see Section 3.5.1)

Value None the parameters of behavioral models to bekept numeric when setting up symboliccircuit equations (see Section 3.5.1)

Options for ExpandSubcircuits, Part II.

Options Description

A detailed description of all ExpandSubcircuits options is given below in alphabetical order:

AutoloadModels

With the option AutoloadModels, you can specify how ExpandSubcircuits handles references todevice models which have not been loaded into the global subcircuit database or defined locally inthe netlist. The following values are possible:

True search model libraries for device models and parametersets (model cards).

False do not load models from the model library automatically;abort subcircuit expansion when a reference to anunavailable model is found

Values for the AutoloadModels option.

Page 225: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.4 Expanding Subcircuits and Device Models 223

DefaultSelector

With the option DefaultSelector, you can specify the key used by ExpandSubcircuits to re-place the right-hand sides of generic device model selector specifications in netlists generated withReadNetlist (Section 3.10.1). The setting DefaultSelector −> selector causes all generic selectorsto be replaced by the key selector. Possible values are:

None do not use a default value for generic model selectors

"string" use "string" as default model selector

symbol use SymbolName[symbol] as default model selector

Values for the DefaultSelector option.

With the setting DefaultSelector −> None, ExpandSubcircuits will print an errormessage and abort upon encountering a generic Selector specification.

Usually ExpandSubcircuits is automatically called by CircuitEquations which sets theDefaultSelector option to an appropriate value based on the chosen analysis mode.

HoldModels

With HoldModels −> patterns, you can specify a list of Mathematica patterns matching the names andselectors of model references ExpandSubcircuits should not expand. Note that the application ofthe HoldModels option is only necessary for advanced tasks. Usually there is no need to use thisoption.

A practical application of the HoldModels option is to stop expansion of a hierarchical circuit de-scription at the device level. The function ReadNetlist (Section 3.10.1) makes use of this feature toassign small-signal data read from a simulator output file to individual devices in a circuit whichcontain subcircuit definitions. The following values are allowed:

pattern do not expand model references whose name specificationmatches pattern

pattern, pattern do not expand model references whose name specificationmatches pattern and whose selector specification matchespattern

pattern, pattern, † † † do not expand model references that match at least one ofthe pattern pairs

Values for the HoldModels option.

Page 226: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

224 3. Reference Manual

When HoldModels has a value other than None, ExpandSubcircuits returns a checkedNetlist or a Circuit instead of a flat Netlist regardless of whether any model referenceswere kept unresolved.

If the netlist contains references to local model definitions or model parameter sets, youshould use the setting KeepLocalModels −> True with the HoldModels option to preventlocal model data from being discarded prematurely.

In the above cases, ExpandSubcircuits must be called at least one more time to produce aflat netlist.

KeepLocalModels

When you expand the model references in a Circuit only partially using the HoldModels option,then the held model references may still contain unresolved links to local model definitions and modelparameter sets. By default, local model data is discarded after subcircuit expansion, so that essentialinformation for expanding the netlist completely may be lost. The setting KeepLocalModels −> Truetells ExpandSubcircuits to keep local model data for future reference. Note that for usual applica-tions there is no need to change the default value of this option. Possible values are:

False discard local model definitions and parameter sets fromthe netlist after subcircuit expansion

True return local model definitions and parameter sets togetherwith the expanded netlist in a Circuit object

Values for the KeepLocalModels option.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Import PSpice netlist. In[2]:= buffer = ReadNetlist["AnalogInsydes/DemoFiles/Buffer.cir",Simulator −> "PSpice"]

Out[2]= Circuit

The following call to ExpandSubcircuits results in an error because the model "BJT/AC" needs tobe loaded from the model library.

Turn off modelautoloading.

In[3]:= ExpandSubcircuits[buffer, DefaultSelector −> AC,AutoloadModels −> False]

ExpandSubcircuits::undefsc:Subcircuit "BJT/AC" is undefined.

Out[3]= $Failed

Page 227: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.4 Expanding Subcircuits and Device Models 225

With AutoloadModels −> True, ExpandSubcircuits searches the model library for undefined devicemodels.

Load undefined modelsfrom the library.

In[4]:= ExpandSubcircuits[buffer, DefaultSelector −> AC,AutoloadModels −> True, Protocol −> Notebook]

Searching model libraries for model "BJT/AC".

Loading model "BJT/AC" from library FullModels‘.

Instantiating model "BJT/AC" for reference Q$T1.

Instantiating model "BJT/AC" for reference Q$T3.

Instantiating model "BJT/AC" for reference Q$T4.

Instantiating model "BJT/AC" for reference Q$T5.

Instantiating model "BJT/AC" for reference Q$T2.

Out[4]= NetlistFlat, 55

The following command tells Analog Insydes to load a model from the library into memory and storeit in the global subcircuit database for future reference. Further requests for the model "BJT/AC"will not invoke a library search.

Load the model "BJT/AC"and store it in the globalsubcircuit database.

In[5]:= Circuit[LoadModel["BJT", "AC", Scope −> Global]

] // ExpandSubcircuits;

List the contents of theglobal subcircuit database.

In[6]:= GlobalSubcircuits[]

Out[6]= BJT, AC SpiceAC Noise SpiceNoiseNow that the model "BJT/AC" has been loaded into memory, turning off the autoloading mechanismno longer results in an error when expanding the netlist buffer.

Use only model definitionsfrom the subcircuitdatabase; do not searchthe library.

In[7]:= ExpandSubcircuits[buffer, DefaultSelector −> AC,AutoloadModels −> False, Protocol −> Notebook]

Instantiating model "BJT/AC" for reference Q$T1.

Instantiating model "BJT/AC" for reference Q$T3.

Instantiating model "BJT/AC" for reference Q$T4.

Instantiating model "BJT/AC" for reference Q$T5.

Instantiating model "BJT/AC" for reference Q$T2.

Out[7]= NetlistFlat, 55

Clear the subcircuitdatabase.

In[8]:= RemoveSubcircuit[All]

Out[8]=

To illustrate how to write patterns for HoldModels, we make a list off all Model and Selectorspecifications in the netlist buffer.

Page 228: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

226 3. Reference Manual

List the Model andSelector specifications.

In[9]:= Cases[buffer, _Model | _Selector, Infinity] // InputForm

Out[9]//InputForm= Model["BJT", "Q2N2222", "Q$T1"],

Selector["BJT", "Q2N2222", "Q$T1"],

Model["BJT", "Q2N2907A", "Q$T3"],

Selector["BJT", "Q2N2907A", "Q$T3"],

Model["BJT", "Q2N2907A", "Q$T4"],

Selector["BJT", "Q2N2907A", "Q$T4"],

Model["BJT", "Q2N2907A", "Q$T5"],

Selector["BJT", "Q2N2907A", "Q$T5"],

Model["BJT", "Q2N2222", "Q$T2"],

Selector["BJT", "Q2N2222", "Q$T2"]

You can use HoldModels to prevent expansion of a particular device type or model instance.

Do not expand referencesto "Q2N2222" devices.

In[10]:= ExpandSubcircuits[buffer,DefaultSelector −> AC, Protocol −> Notebook,HoldModels −> Model[_, "Q2N2222", _]]

Searching model libraries for model "BJT/AC".

Loading model "BJT/AC" from library FullModels‘.

Instantiating model "BJT/AC" for reference Q$T3.

Instantiating model "BJT/AC" for reference Q$T4.

Instantiating model "BJT/AC" for reference Q$T5.

Out[10]= NetlistChecked, 37

If you want to flatten a netlist completely after partial expansion, you must specifyKeepLocalModels −> True to prevent local model definitions and parameter sets from being dis-carded by ExpandSubcircuits.

Keep the transistorinstance "Q$T3" andreferences to "Q2N2222"devices; do not discardlocal model card data forthese devices.

In[11]:= xbuffer = ExpandSubcircuits[buffer,DefaultSelector −> AC, Protocol −> Notebook,HoldModels −> Model[_, "Q2N2222", _], _,

Model[__, "Q$T3"], _,KeepLocalModels −> True]

Searching model libraries for model "BJT/AC".

Loading model "BJT/AC" from library FullModels‘.

Instantiating model "BJT/AC" for reference Q$T4.

Instantiating model "BJT/AC" for reference Q$T5.

Out[11]= Circuit

Expand the held modelreferences.

In[12]:= ExpandSubcircuits[xbuffer,DefaultSelector −> AC, Protocol −> Notebook]

Instantiating model "BJT/AC" for reference Q$T1.

Instantiating model "BJT/AC" for reference Q$T3.

Instantiating model "BJT/AC" for reference Q$T2.

Out[12]= NetlistFlat, 55

Page 229: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 227

3.5 Setting Up and Solving Circuit Equations

Setting up a system of equations from a netlist description of a circuit is the central step of mostcircuit analysis problems you will solve with Analog Insydes. All types of equations can be setup using the command CircuitEquations (Section 3.5.1). Additionally, there are the commandsACEquations (Section 3.5.2) and DCEquations (Section 3.5.3) which transform a nonlinear dynamicequation system into a linear and static equation system, respectively. In order to solve systems ofequations symbolically, Mathematica’s built-in function Solve has been extended to handle DAEOb-jects as well (see Section 3.5.4).

3.5.1 CircuitEquations

CircuitEquations[netlist, opts]sets up a system of circuit equations from a netlistdescription

CircuitEquations[circuit, opts]sets up a system of circuit equations from a circuitdescription

Command structure of CircuitEquations.

The first argument of CircuitEquations must be a Circuit or Netlist object. If it is not a flatnetlist, then ExpandSubcircuits will be called first automatically to expand any subcircuit or devicemodel references. CircuitEquations sets up modified nodal, sparse tableau, or extended sparsetableau equations for AC, DC, or transient analysis. CircuitEquations returns a DAEObject.

The type and appearance of equations generated with CircuitEquations can be changed with thefollowing options:

Page 230: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

228 3. Reference Manual

option name default value

BranchCurrentPrefix "I$" the prefix used for branch current identifiers

BranchVoltagePrefix "V$" the prefix used for branch voltage identifiers

ControllingCurrentPrefix "IC$" the prefix used for controlling currentidentifiers

ControllingVoltagePrefix "VC$" the prefix used for controlling voltageidentifiers

InstanceNameSeparator Inherited[AnalogInsydes]the separator string for name componentsof model variables and referencedesignators (see Section 3.14.2)

NodeVoltagePrefix "V$" the prefix used for node voltage identifiers

Naming convention options for CircuitEquations.

option name default value

AnalysisMode AC the circuit analysis mode

FrequencyVariable s the symbol which denotes the complexLaplace frequency

IndependentVariable Automatic the independent variable for transientanalysis

InitialGuess Automatic the initial guess for the DC solver

InitialTime 0 the initial time for transient analysis

TimeVariable t the symbol which denotes time in transientanalysis

Analysis mode specific options for CircuitEquations.

Page 231: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 229

option name default value

ConvertImmittances True whether to convert impedances toadmittances for nodal analysis

ElementValues Value whether to set up numeric or symbolicequations

Formulation ModifiedNodal the circuit analysis formulation

InitialConditions None whether to use and how to handle initialconditions for dynamic quantities

MatrixEquation True whether to represent a system of ACequations as matrix equation

Symbolic All the parameters of behavioral models to bekept symbolic when setting up symboliccircuit equations

Value None the parameters of behavioral models to bekept numeric when setting up symboliccircuit equations

Equation-formulation options for CircuitEquations.

option name default value

DefaultSelector Automatic the default value to be used byExpandSubcircuits to replace genericmodel selectors

LibraryPath Inherited[AnalogInsydes]the search path for device model libraries(see Section 3.14.3)

ModelLibrary Inherited[AnalogInsydes]the name of the library to be searched fordevice models (see Section 3.14.4)

Model library options for CircuitEquations.

Page 232: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

230 3. Reference Manual

option name default value

DesignPoint Automatic the design point for a symbolic DAEObject

IgnoreMissingGround False whether to ignore a missing analog groundnode

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Miscellaneous options for CircuitEquations.

See also: Netlist (Section 3.1.1), Circuit (Section 3.1.2), ExpandSubcircuits (Section 3.4.1), Chap-ter 4.3.

Options Description

A detailed description of all CircuitEquations options is given below in alphabetical order:

AnalysisMode

The option AnalysisMode −> mode specifies the circuit analysis mode for which CircuitEquationssets up a system of equations. Possible values are:

AC small-signal frequency-domain (AC) analysis

DC operating-point (DC) or DC-transfer (DT) analysis

Transient large-signal time-domain (transient) analysis

Values for the AnalysisMode option.

With the setting AnalysisMode −> AC, CircuitEquations sets up a system of small-signal Laplace-domain equations. CircuitEquations does not linearize nonlinear circuits. Therefore, the firstargument of CircuitEquations must represent a linear circuit. If it contains references to de-vice models, the AC equivalent circuits of the referenced device are used to set up the equations.By default, AC equations are set up in matrix formulation, but this can be changed using theMatrixEquation option (see below).

With the setting AnalysisMode −> DC, CircuitEquations yields a system of (usually nonlinear) DCequations. Any time derivatives resulting from the constitutive equations of dynamic elements aswell as derivatives with respect to other independent quantities are set to zero.

Page 233: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 231

With AnalysisMode −> Transient, you can set up a system of differential-algebraic equations (DAE)for nonlinear dynamic circuits. The independent variable of transient analysis is given by the valueof the option IndependentVariable , which is not necessarily time.

BranchCurrentPrefix

WithBranchCurrentPrefix −> "string", you can specify the prefix string CircuitEquations prepends toan element’s reference designator to generate a unique branch current identifier.

For example, with BranchCurrentPrefix −> "I$", the current through a resistor R1 will be namedI$R1.

Symbol["string" <> "refdes"] must yield a valid symbol. Therefore, "string" must notcontain characters which have a special meaning in Mathematica.

BranchVoltagePrefix

WithBranchVoltagePrefix −> "string", you can specify the prefix string CircuitEquations prepends toan element’s reference designator to generate a unique branch voltage identifier.

For example, with BranchVoltagePrefix −> "V$", the voltage across a resistor R1 will be namedV$R1.

Symbol["string" <> "refdes"] must yield a valid symbol. Therefore, "string" must notcontain characters which have a special meaning in Mathematica.

ControllingCurrentPrefix

With ControllingCurrentPrefix −> "string", you can specify the prefix string CircuitEquationsprepends to the reference designator of a current-controlled source to generate a unique identifierfor the controlling current.

For example, with ControllingCurrentPrefix −> "IC$", the controlling current of a current-controlled voltage source CV1 will be named IC$CV1.

Symbol["string" <> "refdes"] must yield a valid symbol. Therefore, "string" must notcontain characters which have a special meaning in Mathematica.

Page 234: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

232 3. Reference Manual

ControllingVoltagePrefix

With ControllingVoltagePrefix −> "string", you can specify the prefix string CircuitEquationsprepends to the reference designator of a voltage-controlled source to generate a unique identifierfor the controlling voltage.

For example, with ControllingVoltagePrefix −> "VC$", the controlling voltage of a voltage-controlled voltage source VV1 will be named VC$VV1.

Symbol["string" <> "refdes"] must yield a valid symbol. Therefore, "string" must notcontain characters which have a special meaning in Mathematica.

ConvertImmittances

With the option ConvertImmittances, you can control the way in which CircuitEquations handlesimpedances when setting up modified nodal equations. The following values are allowed:

True convert impedances Z to equivalent admittances Z

False do not convert impedances to equivalent admittances

Values for the ConvertImmittances option.

For example, with ConvertImmittances −> True, a resistance R1 will appear as an admittance 1/R1in a system of modified nodal equations. With ConvertImmittances −> False, the resistance willnot be converted to an admittance, and the MNA equations will be augmented by the branchcurrent I$R1.

The setting of ConvertImmittances has no influence on sparse tableau equations.

An explicit Pattern specification in a netlist entry for an impedance or admittanceoverrides the setting of ConvertImmittances for this element.

DefaultSelector

With the option DefaultSelector, you can specify the key used by ExpandSubcircuits to re-place the right-hand sides of generic device model selector specifications in netlists generated withReadNetlist (Section 3.10.1). The setting DefaultSelector −> selector causes all generic selectorsto be replaced by the key selector. Generic selector specifications have the form

Selector −> Selector["device", "type", "instance"]

for example,

Page 235: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 233

Selector −> Selector["BJT", "Q2N2222", "Q1"]

Possible values are:

Automatic use value of option AnalysisMode as default modelselector for ExpandSubcircuits

"string" use "string" as default model selector forExpandSubcircuits

symbol use SymbolName[symbol] as default model selector forExpandSubcircuits

Values for the DefaultSelector option.

The standard setting DefaultSelector −> Automatic causes the default selector to be determinedfrom the value of the option AnalysisMode. This enables ExpandSubcircuits to load semiconductordevice models from the model library which are compatible with the current analysis mode.

DesignPoint

The DesignPoint option allows you to specify a set of numerical reference values for the circuitparameters in a symbolic system of circuit equations. It allows the following values:

Automatic extract design-point information from Value and Symbolicspecifications in the netlist

symbol−>value, symbol−>value, † † † specify numerical values for symbolic circuit parametersexplicitly

None do not extract design-point information from the netlist

Values for the DesignPoint option.

The design point is stored in the DAEObject returned by CircuitEquations. If available, design-point information is applied automatically whenever numerical calculations are performed with asystem of equations which has been set up with ElementValues −> Symbolic. The design point canbe extracted from the DAEObject with the function GetDesignPoint (Section 3.6.12).

ElementValues

With ElementValues −> value, you can decide whether CircuitEquations sets up a system of circuitequations symbolically or numerically. Possible choices are:

Page 236: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

234 3. Reference Manual

Value use Value specifications from the value fields of netlistentries as element values

Symbolic use Symbolic specifications from the value fields of netlistentries as element values

Values for the ElementValues option.

With the settings ElementValues −> Symbolic and DesignPoint −> Automatic, CircuitEquationswill extract design-point information from a netlist automatically. The design point is stored in theDAEObject returned by CircuitEquations. It can be retrieved with GetDesignPoint (Section 3.6.12).

Formulation

The option Formulation −> type selects the type of circuit equations set up by CircuitEquationsand allows the following values:

ModifiedNodal modified nodal analysis (MNA)

SparseTableau sparse tableau analysis (STA)

ExtendedTableau extended sparse tableau analysis (ESTA)

Values for the Formulation option.

Modified nodal analysis expresses systems of circuit equations in terms of node voltages and currentsthrough impedance branches.

Sparse tableau analysis yields systems of circuit equations in terms of all branch currents and branchvoltages.

In addition to the branch currents and voltages, extended sparse tableau analysis also includes allnode voltages of a circuit.

To set up equations for circuits including control network elements, you must useFormulation −> ModifiedNodal.

FrequencyVariable

With FrequencyVariable −> symbol, you can change the symbol CircuitEquations uses to denotethe complex frequency in AC equations. The default setting is FrequencyVariable −> s.

Page 237: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 235

IgnoreMissingGround

IgnoreMissingGround is an option needed for analyzing pure control circuits (also known as blockdiagrams). Equation setup for control circuits is based on the modified nodal analysis functionalityfor electrical circuits, which are expected to contain a ground node. CircuitEquations displays anerror message when you try to set up equations from a netlist in which no reference to the groundnode is present. As pure control networks do not have ground nodes, these error messages must besuppressed by means of the IgnoreMissingGround option, which allows the following values:

False display a warning when no ground node is present

True ignore missing ground node when analyzing controlcircuits

Values for the IgnoreMissingGround option.

You do not need to set IgnoreMissingGround −> True when a ground node is present in acircuit containing both electrical and control components.

IndependentVariable

With IndependentVariable −> var, you can specify a variable other than time as independentvariable for transient analysis.

Note that in Analog Insydes, transient analysis does not necessarily mean analysis in the time do-main. You can perform transient analysis, i.e. solving differential-algebraic equations, with respectto any other independent variable, for instance, temperature. This feature is useful for tasks suchas parametric analyses or sizing problems with differential-algebraic constraints. Possible values forthe IndependentVariable option are:

Automatic use value of option TimeVariable as independent variablefor transient analysis

symbol use symbol as independent variable for transient analysis

Values for the IndependentVariable option.

If AnalysisMode −> Transient, then time-dependent variables or derivatives of circuit variableswith respect to time or other quantities are handled as follows.

Page 238: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

236 3. Reference Manual

If the IndependentVariable is not identical to the TimeVariable, then all time derivativesin a system of circuit equations are set to zero and all explicit references to Time arereplaced by the value of InitialTime.

If the IndependentVariable is identical to the TimeVariable, then any derivatives withrespect to other variables, such as temperature, are set to zero.

InitialConditions

The option InitialConditions allows you to specify how CircuitEquations handles initial condi-tions for dynamic quantities, such as capacitor voltages and inductor currents. The following valuesare allowed:

Automatic use initial conditions where given in the value field ofnetlist entries

All use initial conditions where given explicitly, set initialconditions of all other dynamic quantities to zero

None do not use any given initial conditions

Values for the InitialConditions option.

InitialTime

With InitialTime −> t, you can specify the point of time for which initial conditions are given. Bydefault, t , but you may choose any other value.

NodeVoltagePrefix

With NodeVoltagePrefix −> "string" you can specify the prefix string CircuitEquations prependsto a node name to generate a node voltage identifier.

For example, with NodeVoltagePrefix −> "V$", the node voltage at node 1 will be named V$1.

Symbol["string" <> "node"] must yield a valid symbol. Therefore, "string" must not containcharacters which have a special meaning in Mathematica.

Page 239: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 237

Protocol

This option describes the standard Analog Insydes protocol specification (see Section 3.14.5). Thetop-level function for the Protocol option is CircuitEquations. The second-level function isExpandSubcircuits. Protocol output generated by models is printed as third level.

Symbolic

The Symbolic option gives you control over the set of symbolic parameters of behavioral modelswhich are kept as symbolic quantities in a system of circuit equations. The Symbolic option is thecomplement of the Value option and expects the following values:

All keep all symbolic parameters of behavioral models insymbolic form

None replace all symbolic model parameters by numerical values

instances −> params, † † † keep only the specified parameters from the giveninstances in symbolic form

Values for the Symbolic option.

If the value form instances −> params, † † † is chosen, both instances and params can be a stringpattern or a list of string patterns. The instances specification may have the following format:

"pattern" matches any reference designator "refdes" for whichStringMatchQ["refdes", "pattern"] yields True

"pattern", "pattern", † † † matches any reference designator that matches at least oneof the patterns; patterns are evaluated in the given order

Format specifications for instances.

The params specification may have the following format:

symbol matches symbol literally

"pattern" matches any symbol arg for whichStringMatchQ[ToString[arg], "pattern"] yields True

"pattern" | symbol, † † † matches any symbol that matches at least one of thepatterns; patterns are evaluated in the given order

Format specifications for params.

Page 240: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

238 3. Reference Manual

Value takes precedence over Symbolic. Thus, a model parameter listed in the arguments ofboth options will be converted to a numerical value.

Symbolic−>None is equivalent to Value−>All.

TimeVariable

With the option TimeVariable −> var, you can change the symbol which CircuitEquations uses todenote time. By default, this symbol is used to denote the independent variable in transient analysis.In addition, all explicit references to the identifier Time are replaced by the time variable.

Value

The Value option gives you control over the set of symbolic parameters of behavioral models whichare kept as numeric quantities in a system of circuit equations. The Value option is the complementof the Symbolic option.

All replace all symbolic parameters of behavioral models bynumerical values

None keep all symbolic parameters of behavioral models insymbolic form

instances −> params, † † † replace only the specified parameters from the giveninstances by numerical values

Values for the Value option.

If the value form instances −> params, † † † is chosen, both instances and params can be a stringpattern or a list of string patterns. The instances specification may have the following format:

"pattern" matches any reference designator "refdes" for whichStringMatchQ["refdes", "pattern"] yields True

"pattern", "pattern", † † † matches any reference designator that matches at least oneof the patterns; patterns are evaluated in the given order

Format specifications for instances.

The params specification may have the following format:

Page 241: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 239

symbol matches symbol literally

"pattern" matches any symbol arg for whichStringMatchQ[ToString[arg], "pattern"] yields True

"pattern" | symbol, † † † matches any symbol that matches at least one of thepatterns; patterns are evaluated in the given order

Format specifications for params.

Value takes precedence over Symbolic. Thus, a model parameter listed in the arguments ofboth options will be converted to a numerical value.

Value−>All is equivalent to Symbolic−>None.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

This defines an RLClowpass filter circuit.

In[2]:= rlcf = Netlist[V1, 1, 0, V,R1, 1, 2, R,L1, 2, 3, L,C1, 3, 0, C

]

Out[2]= NetlistRaw, 4

Set up a system of ACequations.

In[3]:= CircuitEquations[rlcf, AnalysisMode −> AC] // DisplayForm

Out[3]//DisplayForm=

1R 1R 0 1

1R1R 1L s 1L s 0

0 1L s1L s C s 0

1 0 0 0

.

V$1V$2V$3I$V1

000V

Set up a system of DCequations.

In[4]:= CircuitEquations[rlcf, AnalysisMode −> DC] // DisplayForm

Out[4]//DisplayForm=

I$V1 V$1 V$2

R 0, I$L1

V$1 V$2

R 0, I$L1 0,

V$1 V, V$2 V$3 0, V$1, V$2, V$3, I$V1, I$L1,DesignPoint

Page 242: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

240 3. Reference Manual

Set up a system oftime-domain equations.

In[5]:= CircuitEquations[rlcf,AnalysisMode −> Transient] // DisplayForm

Out[5]//DisplayForm=

I$V1t V$1t V$2t

R 0,

I$L1t V$1t V$2t

R 0, I$L1t C V$3 t 0,

V$1t V, V$2t V$3t L I$L1 t 0,V$1t, V$2t, V$3t, I$V1t, I$L1t, DesignPoint

Change the branch currentprefix to "ib$".

In[6]:= CircuitEquations[rlcf,BranchCurrentPrefix −> "ib$"] // DisplayForm

Out[6]//DisplayForm=

1R 1R 0 1

1R1R 1L s 1L s 0

0 1L s1L s C s 0

1 0 0 0

.

V$1V$2V$3ib$V1

000V

Change the branch voltageprefix to "ub$".

In[7]:= CircuitEquations[rlcf, Formulation −> SparseTableau,BranchVoltagePrefix −> "ub$"] // DisplayForm

Out[7]//DisplayForm=

1 1 1 1 0 0 0 00 0 0 0 1 1 0 00 0 0 0 0 1 1 00 0 0 0 0 0 1 11 0 0 0 0 0 0 00 1 0 0 0 R 0 00 0 1 0 0 0 L s 00 0 0 C s 0 0 0 1

.

ub$V1ub$R1ub$L1ub$C1I$V1I$R1I$L1I$C1

0000V000

Do not convert R and L toequivalent admittances.

In[8]:= CircuitEquations[rlcf,ConvertImmittances −> False] // DisplayForm

Out[8]//DisplayForm=

0 0 0 1 1 00 0 0 0 1 10 0 C s 0 0 11 0 0 0 0 0

1 1 0 0 R 00 1 1 0 0 L s

.

V$1V$2V$3I$V1I$R1I$L1

000V00

The DefaultSelector option allows you to choose a different set of device models than would benormally used for the selected analysis mode. You can use this feature to set up circuit equationsfor noise analysis. Noise equations are essentially AC equations with some extensions, that can beincluded by selecting noise models instead of plain AC models using DefaultSelector −> Noise.

Read in a PSpice netlistand small-signal data.

In[9]:= buffer = ReadNetlist["AnalogInsydes/DemoFiles/Buffer.cir","AnalogInsydes/DemoFiles/Buffer.out",Simulator −> "PSpice"]

Out[9]= Circuit

Page 243: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 241

Set up a system of ACequations.

In[10]:= CircuitEquations[buffer, AnalysisMode −> AC,Protocol −> None, Notebook]

> ExpandSubcircuits...

> Searching model libraries for model "BJT/AC".

> Loading model "BJT/AC" from library FullModels‘.

> Instantiating model "BJT/AC" for reference Q$T1.

> Instantiating model "BJT/AC" for reference Q$T3.

> Instantiating model "BJT/AC" for reference Q$T4.

> Instantiating model "BJT/AC" for reference Q$T5.

> Instantiating model "BJT/AC" for reference Q$T2.

Out[10]= DAEAC, 1818

Set up a system of ACequations with noiseextensions.

In[11]:= CircuitEquations[buffer, AnalysisMode −> AC,DefaultSelector −> Noise, Protocol −> None, Notebook]

> ExpandSubcircuits...

> Searching model libraries for model "BJT/Noise".

> Loading model "BJT/Noise" from library FullModels‘.

> Instantiating model "BJT/Noise" for reference Q$T1.

> Instantiating model "BJT/Noise" for reference Q$T3.

> Instantiating model "BJT/Noise" for reference Q$T4.

> Instantiating model "BJT/Noise" for reference Q$T5.

> Instantiating model "BJT/Noise" for reference Q$T2.

Out[11]= DAEAC, 1818

Specify numericalreference values for thecircuit parameters.

In[12]:= eqs = CircuitEquations[rlcf, DesignPoint −> V −> 1.,R −> 1000., L −> 0.001, C −> 2.2*10^−6]

Out[12]= DAEAC, 44

Retrieve design point fromDAEObject.

In[13]:= GetDesignPoint[eqs]

Out[13]= V 1., R 1000., L 0.001, C 2.2106

Define an RLC lowpassfilter circuit withdesign-point information.

In[14]:= rlcf2 = Netlist[V1, 1, 0, Symbolic −> V, Value −> 1.,R1, 1, 2, Symbolic −> R, Value −> 1000.,L1, 2, 3, Symbolic −> L, Value −> 0.001,C1, 3, 0, Symbolic −> C, Value −> 2.2*10^−6

]

Out[14]= NetlistRaw, 4

Set up a system of ACequations with numericalcoefficients.

In[15]:= CircuitEquations[rlcf2,ElementValues −> Value] // DisplayForm

Out[15]//DisplayForm=

0.001 0.001 0 1

0.001 0.001 1000.s 1000.s 0

0 1000.s1000.s 2.2106 s 0

1 0 0 0

.

V$1V$2V$3I$V1

0001.

Page 244: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

242 3. Reference Manual

Set up a symbolic systemof AC equations.

In[16]:= eqssym = CircuitEquations[rlcf2,ElementValues −> Symbolic]

Out[16]= DAEAC, 44

Show the equations. In[17]:= eqssym // DisplayForm

Out[17]//DisplayForm=

1R 1R 0 1

1R1R 1L s 1L s 0

0 1L s1L s C s 0

1 0 0 0

.

V$1V$2V$3I$V1

000V

Get the design point fromthe DAEObject.

In[18]:= GetDesignPoint[eqssym]

Out[18]= V 1., R 1000., L 0.001, C 2.2106

Set up a system of sparsetableau equations.

In[19]:= CircuitEquations[rlcf,Formulation −> SparseTableau] // DisplayForm

Out[19]//DisplayForm=

1 1 1 1 0 0 0 00 0 0 0 1 1 0 00 0 0 0 0 1 1 00 0 0 0 0 0 1 11 0 0 0 0 0 0 00 1 0 0 0 R 0 00 0 1 0 0 0 L s 00 0 0 C s 0 0 0 1

.

V$V1V$R1V$L1V$C1I$V1I$R1I$L1I$C1

0000V000

Set up a system ofextended sparse tableauequations.

In[20]:= CircuitEquations[rlcf,Formulation −> ExtendedTableau] // DisplayForm

Out[20]//DisplayForm=

1 0 0 0 0 0 0 0 1 0 00 1 0 0 0 0 0 0 1 1 00 0 1 0 0 0 0 0 0 1 10 0 0 1 0 0 0 0 0 0 10 0 0 0 1 1 0 0 0 0 00 0 0 0 0 1 1 0 0 0 00 0 0 0 0 0 1 1 0 0 01 0 0 0 0 0 0 0 0 0 00 1 0 0 0 R 0 0 0 0 00 0 1 0 0 0 L s 0 0 0 00 0 0 C s 0 0 0 1 0 0 0

.

V$V1V$R1V$L1V$C1I$V1I$R1I$L1I$C1V$1V$2V$3

0000000V000

The default setting for the complex frequency is FrequencyVariable −> s, which is the most widelyused symbol. However, some people prefer to use the setting FrequencyVariable −> p.

Page 245: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 243

Use the symbol p todenote the complexfrequency.

In[21]:= CircuitEquations[rlcf,FrequencyVariable −> p] // DisplayForm

Out[21]//DisplayForm=

1R 1R 0 1

1R1L p 1R 1L p 0

0 1L p1L p C p 0

1 0 0 0

.

V$1V$2V$3I$V1

000V

This defines a simplecontrol circuit with asignal source, a forwardsignal path, and afeedback path.

In[22]:= fbloop = Netlist[HS1, in, X[Frequency],HG1, in, out, Hf[Frequency],HG2, out, in, Hfb[Frequency]

]

Out[22]= NetlistRaw, 3

By default, CircuitEquations prints a warning because the netlist does not contain a reference tothe electrical ground node 0. To turn off the warning, you must set IgnoreMissingGround −> True.

Set up modified nodalequations for the controlcircuit.

In[23]:= CircuitEquations[fbloop, NodeVoltagePrefix −> "x$"]

Netlist::gndnode: Found no connections to the ground node.

Netlist::lttc: Less than two connections at node(s) 0.

Out[23]= DAEAC, 22

This tells Analog Insydesto ignore the missingreference to ground.

In[24]:= fbleqs = CircuitEquations[fbloop,IgnoreMissingGround −> True, NodeVoltagePrefix −> "x$"];

fbleqs // DisplayForm

Out[25]//DisplayForm=

1 HfbsHfs 1

. x$inx$out

Xs0

This defines a circuit withtwo time-varying andtemperature-dependentresistors.

In[26]:= tempckt = Netlist[V1, 1, 0, V1,R1, 1, 2, R1[Time]*(1 + TC11*TEMP),R2, 2, 0, R2[Time]*(1 + TC12*TEMP),C1, 2, 0, C1

]

Out[26]= NetlistRaw, 4

By default, TEMP is simply regarded as a global parameter. Equations for transient analysis areformulated with time as independent variable.

Set up circuit equationsfor time-domain analysis.

In[27]:= CircuitEquations[tempckt,AnalysisMode −> Transient] // DisplayForm

Out[27]//DisplayForm=

I$V1t V$1t V$2t

1 TC11 TEMP R1t 0,

V$2t1 TC12 TEMP R2t

V$1t V$2t1 TC11 TEMP R1t C1 V$2 t 0,

V$1t V1, V$1t, V$2t, I$V1t,DesignPoint

Page 246: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

244 3. Reference Manual

Now we use TEMP as independent variable. This causes the time derivative due to C1 to be set tozero and Time to be replaced by the value of InitialTime.

Designate temperature asindependent variable.

In[28]:= CircuitEquations[tempckt, AnalysisMode −> Transient,IndependentVariable −> TEMP] // DisplayForm

Out[28]//DisplayForm=

I$V1TEMP V$1TEMP V$2TEMP1 TC11 TEMP R10 0,

V$2TEMP1 TC12 TEMP R20

V$1TEMP V$2TEMP1 TC11 TEMP R10 0,

V$1TEMP V1, V$1TEMP, V$2TEMP, I$V1TEMP,DesignPoint

This assigns an initialcondition to the inductorL1.

In[29]:= rlcfic = Netlist[V1, 1, 0, V,R1, 1, 2, R,L1, 2, 3, Value −> L, InitialCondition −> iL0,C1, 3, 0, C

]

Out[29]= NetlistRaw, 4

By default, initial conditions are ignored by CircuitEquations. To use the given initial conditions,you must specify InitialConditions −> Automatic or InitialConditions −> All.

Set up circuit equationsfor transient analysis.

In[30]:= CircuitEquations[rlcfic,AnalysisMode −> Transient] // DisplayForm

Out[30]//DisplayForm=

I$V1t V$1t V$2t

R 0,

I$L1t V$1t V$2t

R 0, I$L1t C V$3 t 0,

V$1t V, V$2t V$3t L I$L1 t 0,V$1t, V$2t, V$3t, I$V1t, I$L1t, DesignPoint

Use initial conditions onlywhere specified explicitly.

In[31]:= CircuitEquations[rlcfic, AnalysisMode −> Transient,InitialConditions −> Automatic] // DisplayForm

Out[31]//DisplayForm=

I$V1t V$1t V$2t

R 0,

I$L1t V$1t V$2t

R 0, I$L1t C V$3 t 0,

V$1t V, V$2t V$3t L I$L1 t 0, I$L10 iL0,V$1t, V$2t, V$3t, I$V1t, I$L1t, DesignPoint

Page 247: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 245

Use given initialconditions, set all otherinitial conditions to zero.

In[32]:= CircuitEquations[rlcfic, AnalysisMode −> Transient,InitialConditions −> All] // DisplayForm

Out[32]//DisplayForm=

I$V1t V$1t V$2t

R 0, I$L1t

V$1t V$2t

R 0,

I$L1t C V$3 t 0, V$1t V,V$2t V$3t L I$L1 t 0, I$L10 iL0, V$30 0,

V$1t, V$2t, V$3t, I$V1t, I$L1t, DesignPoint

Use the symbol t0 todenote the initial time.

In[33]:= CircuitEquations[rlcfic, AnalysisMode −> Transient,InitialConditions −> All, InitialTime −> t0

] // DisplayForm

Out[33]//DisplayForm=

I$V1t V$1t V$2t

R 0, I$L1t

V$1t V$2t

R 0,

I$L1t C V$3 t 0, V$1t V,V$2t V$3t L I$L1 t 0, I$L1t0 iL0, V$3t0 0,

V$1t, V$2t, V$3t, I$V1t, I$L1t, DesignPoint

Change the node voltageprefix to "vn$".

In[34]:= CircuitEquations[rlcf,NodeVoltagePrefix −> "vn$"] // DisplayForm

Out[34]//DisplayForm=

1R 1R 0 1

1R1R 1L s 1L s 0

0 1L s1L s C s 0

1 0 0 0

.

vn$1vn$2vn$3I$V1

000V

With the default settingsSymbolic −> All and Value −> None, all device parameters of the diode appear in symbolic formwhen you set up a system of circuit equations with ElementValues −> Symbolic.

This defines a simplehalf-wave diode rectifiercircuit.

In[35]:= rectifier = Netlist[V1, 1, 0, Symbolic −> Vin,

Value −> 5*Sin[2*Pi*50*Time],D1, 1 −> A, 2 −> C, Model −> "Diode",

Selector −> Selector["Diode", "Spice", "D1"],RL, 2, 0, Symbolic −> RL, Value −> 1000.0,CL, 2, 0, Symbolic −> CL, Value −> 2.2*^−5

]

Out[35]= NetlistRaw, 4

Page 248: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

246 3. Reference Manual

Set up symbolic circuitequations for transientanalysis.

In[36]:= CircuitEquations[rectifier, AnalysisMode −> Transient,ElementValues −> Symbolic] // DisplayForm

Out[36]//DisplayForm=

I$AC$D1t I$V1t 0, I$AC$D1t V$2t

RL CL V$2 t 0,

V$1t Vin, I$AC$D1t AREA$D1 E1.11 1.

TEMPTNOM $q

TEMP $k

1 E1. $q V$1tV$2tTEMP $k IS$D1 TEMP

TNOM

3.

GMIN V$1t V$2t,V$1t, V$2t, I$V1t, I$AC$D1t,DesignPoint Vin 5 Sin100 Π t, RL 1000., CL 0.000022,AREA$D1 1., BV$D1 , CJO$D1 0, GMIN 1.1012,IBV$D1 0.001, IS$D1 1.1014, RS$D1 0, TEMP 300.15,

TNOM 300.15, $k 1.380621023, $q 1.602191019

You can also tell CircuitEquations to treat all device parameters as numeric quantities.

Replace all parameters indevice model equations bynumerical values.

In[37]:= CircuitEquations[rectifier, AnalysisMode −> Transient,ElementValues −> Symbolic, Symbolic −> None

] // DisplayForm

Out[37]//DisplayForm=

I$AC$D1t I$V1t 0, I$AC$D1t V$2t

RL CL V$2 t 0,

V$1t Vin, I$AC$D1t

1.1014 1 E38.6635 V$1tV$2t 1.1012 V$1t V$2t,V$1t, V$2t, I$V1t, I$AC$D1t,DesignPoint Vin 5 Sin100 Π t, RL 1000., CL 0.000022

Finally, the Symbolic option allows you to specify for each device or group of devices the parameterswhich CircuitEquations should keep in symbolic form.

Keep only the parametersAREA and TEMP of alldiode instances "D*" insymbolic form, replace allother model parameters bynumerical values.

In[38]:= CircuitEquations[rectifier,AnalysisMode −> Transient, ElementValues −> Symbolic,Symbolic −> "D*" −> AREA, TEMP] // DisplayForm

Out[38]//DisplayForm=

I$AC$D1t I$V1t 0,

I$AC$D1t V$2t

RL CL V$2 t 0, V$1t Vin,

I$AC$D1t 3.698151022 AREA$D1 E12881.4 1.0.00333167 TEMPTEMP

1 E11604.8 V$1tV$2tTEMP TEMP3. 1.1012 V$1t V$2t,

V$1t, V$2t, I$V1t, I$AC$D1t,DesignPoint Vin 5 Sin100 Π t, RL 1000., CL 0.000022,AREA$D1 1., TEMP 300.15

Page 249: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 247

Use the symbol Τ todenote time.

In[39]:= CircuitEquations[tempckt, AnalysisMode −> Transient,TimeVariable −> \[Tau]] // DisplayForm

Out[39]//DisplayForm=

I$V1Τ V$1Τ V$2Τ

1 TC11 TEMP R1Τ 0,

V$2Τ1 TC12 TEMP R2Τ

V$1Τ V$2Τ1 TC11 TEMP R1Τ C1 V$2 Τ 0,

V$1Τ V1, V$1Τ, V$2Τ, I$V1Τ,DesignPoint

With the default settingsSymbolic −> All and Value −> None, all device parameters of the diode appear in symbolic formwhen you set up a system of circuit equations with ElementValues −> Symbolic.

Set up a system ofsymbolic circuit equationsfor transient analysis.

In[40]:= CircuitEquations[rectifier, AnalysisMode −> Transient,ElementValues −> Symbolic] // DisplayForm

Out[40]//DisplayForm=

I$AC$D1t I$V1t 0, I$AC$D1t V$2t

RL CL V$2 t 0,

V$1t Vin, I$AC$D1t AREA$D1 E1.11 1.

TEMPTNOM $q

TEMP $k

1 E1. $q V$1tV$2tTEMP $k IS$D1 TEMP

TNOM

3.

GMIN V$1t V$2t,V$1t, V$2t, I$V1t, I$AC$D1t,DesignPoint Vin 5 Sin100 Π t, RL 1000., CL 0.000022,AREA$D1 1., BV$D1 , CJO$D1 0, GMIN 1.1012,IBV$D1 0.001, IS$D1 1.1014, RS$D1 0, TEMP 300.15,

TNOM 300.15, $k 1.380621023, $q 1.602191019

You can also tell CircuitEquations to treat all device parameters as numeric quantities.

Replace all parameters indevice model equations bynumerical values.

In[41]:= CircuitEquations[rectifier, AnalysisMode −> Transient,ElementValues −> Symbolic, Value −> All] // DisplayForm

Out[41]//DisplayForm=

I$AC$D1t I$V1t 0, I$AC$D1t V$2t

RL CL V$2 t 0,

V$1t Vin, I$AC$D1t

1.1014 1 E38.6635 V$1tV$2t 1.1012 V$1t V$2t,V$1t, V$2t, I$V1t, I$AC$D1t,DesignPoint Vin 5 Sin100 Π t, RL 1000., CL 0.000022

Finally, the Value option allows you to specify for each device or group of devices the parameterswhich CircuitEquations should treat as numeric quantities.

Page 250: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

248 3. Reference Manual

Replace the parametersTEMP, TNOM, $k, and $q ofthe model instance D1 bytheir numerical values.

In[42]:= CircuitEquations[rectifier,AnalysisMode −> Transient, ElementValues −> Symbolic,Value −> "D1" −> TEMP, TNOM, $k, $q] // DisplayForm

Out[42]//DisplayForm=

I$AC$D1t I$V1t 0, I$AC$D1t V$2t

RL CL V$2 t 0,

V$1t Vin, I$AC$D1t 1. AREA$D11 E38.6635 V$1tV$2t IS$D1 GMIN V$1t V$2t,

V$1t, V$2t, I$V1t, I$AC$D1t,DesignPoint Vin 5 Sin100 Π t,RL 1000., CL 0.000022, AREA$D1 1., BV$D1 , CJO$D1 0,GMIN 1.1012, IBV$D1 0.001, IS$D1 1.1014, RS$D1 0

3.5.2 ACEquations

ACEquations[dae, oppoint, sources]linearizes equations about oppoint, replaces sources byvalues (specified via sources), and returns an AC DAEObject

ACEquations[dae, oppoint] linearizes equations using the AC source specifiationsgiven by the ModeValues option stored in dae

Command structure of ACEquations.

Given a Transient or DC DAEObject, ACEquations linearizes the equation system about the givenoperating point oppoint and returns an AC DAEObject. The operating point is given by a list of rulesof the form var −> value for each variable of the equation system. It is possible to assign values totime derivatives of variables, too. The list of value mappings is added to the DesignPoint optionof the returned DAEObject. During linearization, the values of AC sources are replaced by their ACvalue as given by sources, where sources is a list of rules of the form acsource −> val for each param-eter representing an AC source. If this third argument is omitted, the AC values are automaticallyextracted from the ModeValues option stored in the DAEObject.

Note that, given a Netlist or Circuit object, you can set up AC equations directly usingCircuitEquations (Section 3.5.1).

ACEquations provides the following options:

Page 251: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 249

option name default value

FrequencyVariable Automatic specifies the symbol denoting the complexLaplace frequency

OperatingPointPostfix "$op" string to append to variable namesdenoting symbolic operating points

DerivativePostfix "d" string to append to variable namesdenoting derivatives

Options for ACEquations.

See also: DCEquations (Section 3.5.3), CircuitEquations (Section 3.5.1).

Options Description

A detailed description of all ACEquations options is given below in alphabetical order:

DerivativePostfix

If symbol names denoting derivates of varibles have to be created during linearization, the valueof the DerivativePostfix option is appended to the variable name. Thus, the value of theDerivativePostfix option has to be a string which can be converted to a valid Mathematicasymbol. The default setting is DerivativePostfix −> "d".

FrequencyVariable

The option FrequencyVariable specifies the symbol denoting the complex Laplace frequency. If setto Automatic, the value of the option FrequencyVariable as stored in the DAEObject dae is used.The default setting is FrequencyVariable −> Automatic.

OperatingPointPostfix

If the given operating point list oppoint contains a rule of the form var −> value, the rule opvar −> valueis added to the DesignPoint option of the returned DAEObject, where opvar is given by appendingthe value of the OperatingPointPostfix option to the variable name var. Thus, the value of theOperatingPointPostfix option has to be a string which can be converted to a valid Mathematicasymbol. The default setting is OperatingPointPostfix −> "$op".

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 252: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

250 3. Reference Manual

Define netlist descriptionof a simple diode rectifiercircuit.

In[2]:= rectifier = Circuit[Netlist[

V0, 1, 0, Symbolic −> V0,Value −>2. Sin[10^6 Time],

R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice",GMIN −> 0, AREA −> 1

]]

Out[2]= Circuit

Set up transient equationsystem.

In[3]:= tran = CircuitEquations[rectifier,ElementValues −> Symbolic,AnalysisMode −> Transient,Value −> "*" −> TEMP, TNOM, $q, $k, AREA, GMIN]

Out[3]= DAETransient, 44

Show equation system. In[4]:= tran // DisplayForm

Out[4]//DisplayForm=

I$AC$D1t I$V0t 0, I$AC$D1t V$2t

R1 C1 V$2 t 0,

V$1t V0, I$AC$D1t 1. 1 E38.6635 V$1tV$2t IS$D1,V$1t, V$2t, I$V0t, I$AC$D1t, DesignPoint

V0 2. Sin1000000 t, R1 100., C1 1.107, BV$D1 ,

CJO$D1 0, IBV$D1 0.001, IS$D1 1.1014, RS$D1 0

Calculate operating point. In[5]:= op = First[NDAESolve[tran, t, 0.]]

Out[5]= V$2 0., V$1 0., I$V0 0., I$AC$D1 0.

Linearize equations aboutthe operating point.

In[6]:= ac = ACEquations[tran, op, V0 −> 1]

Out[6]= DAEAC, 44

Extract equation system. In[7]:= GetEquations[ac]

Out[7]=

I$AC$D1 I$V0 0, I$AC$D1 1R1

C1 s V$2 0,

V$1 V0, I$AC$D1 38.6635 E38.6635 V$1$opV$2$op IS$D1 V$1 38.6635 E38.6635 V$1$opV$2$op IS$D1 V$2 0

Display design pointstored in the DAEObject.Note that new parametershave been generated.

In[8]:= GetDesignPoint[ac]

Out[8]=R1 100., C1 1.107, BV$D1 , CJO$D1 0, IBV$D1 0.001,

IS$D1 1.1014, RS$D1 0, V0 1, V$1$op 0., V$2$op 0.,I$V0$op 0., I$AC$D1$op 0., V0$op 2. Sin1000000 t$op

Page 253: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 251

3.5.3 DCEquations

DCEquations[dae] transforms a dynamic Transient DAEObject into a staticDC DAEObject

Command structure of DCEquations.

Given a Transient DAEObject, DCEquations transforms the dynamic equations into a static systemand returns a DC DAEObject. All derivatives with respect to the IndependentVariable (as storedin the DAEObject) are replaced by zero. The initial time is inserted into both the equations and thedesign point. Depending on the value of the ModeValues option, the values of independent sourcesstored in the DesginPoint option of the DAEObject are replaced by the corresponding DC valuesstored in the ModeValues option of the DAEObject.

Note that, given a Netlist or Circuit object, you can set up DC equations directly usingCircuitEquations (Section 3.5.1).

DCEquations provides the following options:

option name default value

InitialTime Automatic initial time to insert into the equation andthe design point

ModeValues Automatic whether to extract independent sourcevalues from the ModeValues option of theDAEObject

Options for DCEquations.

See also: ACEquations (Section 3.5.2), CircuitEquations (Section 3.5.1).

Options Description

InitialTime

The option InitialTime specifies the value (which can be any Mathematica expression) to be substi-tuted for the independent variable in the equation system and the design point. If the value of theInitialTime option is set to Automatic, the initial time is extracted from the InitialTime optionstored in the DAEObject. The default setting is InitialTime −> Automatic.

ModeValues

The option ModeValues specifies whether values of independent sources should be updated in theDesignPoint option of the returned DAEObject. If the value of the ModeValues option is set to

Page 254: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

252 3. Reference Manual

Automatic, DC values of independent sources are extracted from the ModeValues option stored in theDAEObject. If the value of the ModeValues option is set to None, the values of independent sourcesare used as-is. Note that in both cases the initial time is inserted into the design-point values. Thedefault setting is ModeValues −> Automatic.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist descriptionof a simple diode rectifiercircuit.

In[2]:= rectifier = Circuit[Netlist[

V0, 1, 0, Symbolic −> V0,Value −>2. Sin[10^6 Time],

R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice",GMIN −> 0, AREA −> 1

]]

Out[2]= Circuit

Set up transient equationsystem.

In[3]:= tran = CircuitEquations[rectifier,ElementValues −> Symbolic,AnalysisMode −> Transient,Value −> "*" −> TEMP, TNOM, $q, $k, AREA, GMIN]

Out[3]= DAETransient, 44

Show equation system. In[4]:= tran // DisplayForm

Out[4]//DisplayForm=

I$AC$D1t I$V0t 0, I$AC$D1t V$2t

R1 C1 V$2 t 0,

V$1t V0, I$AC$D1t 1. 1 E38.6635 V$1tV$2t IS$D1,V$1t, V$2t, I$V0t, I$AC$D1t, DesignPoint

V0 2. Sin1000000 t, R1 100., C1 1.107, BV$D1 ,

CJO$D1 0, IBV$D1 0.001, IS$D1 1.1014, RS$D1 0

Transform dynamicequations into a staticsystem.

In[5]:= dc = DCEquations[tran]

Out[5]= DAEDC, 44

Show equation system. In[6]:= dc // DisplayForm

Out[6]//DisplayForm=

I$AC$D1 I$V0 0, I$AC$D1 V$2R1

0, V$1 V0, I$AC$D1

1. 1 E38.6635 V$1V$2 IS$D1, V$1, V$2, I$V0, I$AC$D1,DesignPoint V0 0, R1 100., C1 1.107, BV$D1 ,

CJO$D1 0, IBV$D1 0.001, IS$D1 1.1014, RS$D1 0

Page 255: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.5 Setting Up and Solving Circuit Equations 253

3.5.4 Solve

Solve[dae] solves a system of equations given by dae for all variables

Solve[dae, var] solves for one variable

Solve[dae, var, var, † † † ] solves for several variables

Command structure of Solve.

In order to symbolically solve systems of equations formulated by the function CircuitEquations,Mathematica’s built-in function Solve has been extended to handle DAEObjects as well. Solve re-turns its result as lists of rules of the form var −> expr, † † † , where the variables var are assignedsymbolic expressions expr.

See also: CircuitEquations (Section 3.5.1), ACAnalysis (Section 3.7.3), NDAESolve (Section 3.7.5).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist description. In[2]:= vdiv = Netlist[V0, 1, 0, V0,R1, 1, 2, R1,R2, 2, 0, R2

]

Out[2]= NetlistRaw, 3

Set up a system ofsmall-signal equations.

In[3]:= vdiveqs = CircuitEquations[vdiv]

Out[3]= DAEAC, 33

Display equations. In[4]:= DisplayForm[vdiveqs]

Out[4]//DisplayForm=

1R1 1R1 1

1R11R1 1R2 0

1 0 0

.

V$1V$2I$V0

00V0

Solve only for the variableV$2.

In[5]:= Solve[vdiveqs, V$2]

Out[5]= V$2 R2 V0

R1 R2

Solve for the variables V$1and V$2.

In[6]:= Solve[vdiveqs, V$1, V$2]

Out[6]= V$2 R2 V0

R1 R2

, V$1 V0

Solve for all variables. In[7]:= solution = Solve[vdiveqs]

Out[7]= I$V0 V0

R1 R2

, V$2 R2 V0

R1 R2

, V$1 V0

Page 256: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

254 3. Reference Manual

Extract value of V$2 fromthe list of solutions.

In[8]:= V$2 /. First[solution]

Out[8]=R2 V0

R1 R2

Page 257: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 255

3.6 Circuit and DAEObject Manipulation

This chapter describes a number of functions which simplify the usage of the key objects existingin Analog Insydes, the Netlist object, the Circuit object, and the DAEObject. These functionsallow you to manipulate the objects without knowledge of the internal data format. The followingfunctions are available:

AddElements (Section 3.6.1) inserting netlist elements

DeleteElements (Section 3.6.2) deleting netlist elements

GetElements (Section 3.6.3) extracting netlist elements

RenameNodes (Section 3.6.4) renaming node identifiers

Statistics (Section 3.6.17) showing contents of a Circuit object

Functions dealing with Netlist and Circuit objects.

GetEquations (Section 3.6.5) extracting equations

GetMatrix (Section 3.6.6) extracting matrix

GetVariables (Section 3.6.7) extracting variables

GetRHS (Section 3.6.8) extracting right-hand side vector

GetParameters (Section 3.6.9) extracting parameters

GetDAEOptions (Section 3.6.10) extracting options

SetDAEOptions (Section 3.6.11) setting and modifying options

GetDesignPoint (Section 3.6.12) extracting design point

ApplyDesignPoint (Section 3.6.13)inserting design point

UpdateDesignPoint (Section 3.6.14)modifying design point

MatchSymbols (Section 3.6.15) matching symbol names

ShortenSymbols (Section 3.6.16) shortening symbol names

Statistics (Section 3.6.17) showing contents of a DAEObject

Functions dealing with DAEObjects.

Page 258: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

256 3. Reference Manual

3.6.1 AddElements

AddElements[netlist, element] adds netlist entry element to netlist

AddElements[circuit, element] adds netlist entry element to the top-level netlist of circuit

AddElements[circuit, element, subcirspec]adds netlist entry to subcircuits specified by subcirspec

Command structure of AddElements.

Given a Netlist or Circuit object, AddElements adds a new netlist element to the top-level netlistor to subcircuits defined in the circuit and returns the new Netlist or Circuit object, respectively.The subcircuits are given by means of the subcircuit specification subcirspec which is a sequence ofrules of the following form:

sequence description

Name−>stringpattern, Selector−>stringpatternadds netlist entry to subcircuits whose Name matchesstringpattern and whose Selector matches stringpattern

Name−>stringpattern equivalent to Name−>stringpattern, Selector−>"*"

Selector−>stringpattern equivalent to Name−>"*", Selector−>stringpattern

Possible subcircuit specifications.

The new netlist element is added to all subcircuits, whose Name and Selector fields match the stringpattern given by the subcircuit specification.

Note that there is no check whether the returned circuit defines a valid netlist.

See also: DeleteElements (Section 3.6.2), GetElements (Section 3.6.3).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define a simple voltagedivider circuit.

In[2]:= net =Netlist[

V0, 1, 0, V0,R1, 1, 2, R1,R2, 2, 0, R2

]

Out[2]= NetlistRaw, 3

Add a load resistance tothe voltage divider.

In[3]:= netload = AddElements[net, Rload, 2, 0, Rload]

Out[3]= NetlistRaw, 4

Page 259: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 257

Display new netlist. In[4]:= DisplayForm[netload]

Out[4]//DisplayForm= Netlist Raw, 4 Entries:V0, 1, 0, V0R1, 1, 2, R1R2, 2, 0, R2Rload, 2, 0, Rload

3.6.2 DeleteElements

DeleteElements[netlist, stringpattern]removes those netlist entries from netlist whose referencedesignator matches stringpattern

DeleteElements[circuit, stringpattern]removes those netlist entries from the top-level netlist ofcircuit whose reference designator matches stringpattern

DeleteElements[circuit, stringpattern, subcirspec]removes netlist entries in subcircuits specified by subcirspec

Command structure of DeleteElements.

Given a Netlist or Circuit object, DeleteElements removes netlist elements from the top-levelnetlist or from subcircuits defined in the circuit and returns the new Netlist or Circuit object,respectively. The argument stringpattern is either a single string pattern or a list of string pat-terns. Netlist elements whose reference designator matches any of the string patterns are removed.To delete elements in subcircuits, referencing to certain subcircuits is performed by means of thesubcircuit specification subcirspec which is a sequence of rules of the following form:

sequence description

Name−>stringpattern, Selector−>stringpatterndeletes netlist entries in subcircuits whose Name matchesstringpattern and whose Selector matches stringpattern

Name−>stringpattern equivalent to Name−>stringpattern, Selector−>"*"

Selector−>stringpattern equivalent to Name−>"*", Selector−>stringpattern

Possible subcircuit specifications.

Note that there is no check whether the returned Circuit object defines a valid circuit.

See also: AddElements (Section 3.6.1), GetElements (Section 3.6.3).

Page 260: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

258 3. Reference Manual

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define a simple voltagedivider with loadresistance.

In[2]:= netload =Netlist[

V0, 1, 0, V0,R1, 1, 2, R1,R2, 2, 0, R2,Rload, 2, 0, Rload

]

Out[2]= NetlistRaw, 4

Remove all elementswhose reference designatormatch the string pattern"*load".

In[3]:= net = DeleteElements[netload, "*load"]

Out[3]= NetlistRaw, 3

Display new netlist. In[4]:= DisplayForm[net]

Out[4]//DisplayForm= Netlist Raw, 3 Entries:V0, 1, 0, V0R1, 1, 2, R1R2, 2, 0, R2

3.6.3 GetElements

GetElements[netlist, stringpattern]extracts those netlist entries from netlist whose referencedesignator matches stringpattern

GetElements[circuit, stringpattern]extracts those netlist entries from the top-level netlist ofcircuit whose reference designator matches stringpattern

Command structure of GetElements.

Given a Netlist or Circuit object, GetElements extracts netlist elements from the top-level netlistand returns a list of these elements. The argument stringpattern is either a single string pattern or alist of string patterns. Netlist elements whose reference designator matches any of the string patternsare extracted.

See also: AddElements (Section 3.6.1), DeleteElements (Section 3.6.2).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 261: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 259

Define a simple voltagedivider.

In[2]:= netload =Netlist[

V0, 1, 0, V0,R1, 1, 2, R1,R2, 2, 0, R2,Rload, 2, 0, Rload

]

Out[2]= NetlistRaw, 4

Extract all elements whosereference designator matchthe string pattern "R*".

In[3]:= GetElements[netload, "R*"]

Out[3]=R1, 1, 2, R1, R2, 2, 0, R2, Rload, 2, 0, Rload

3.6.4 RenameNodes

RenameNodes[netlist, repl] renames nodes in netlist

RenameNodes[circuit, repl] renames nodes in the top-level netlist of circuit

Command structure of RenameNodes.

Given a Netlist or Circuit object, RenameNodes changes node names in the top-level netlist andreturns the new Netlist or Circuit object, respectively. The replacements repl are given as a singlerule, a sequence of rules, or as a list of replacement rules of the form oldnodename −> newnodename.The node names can be given as symbols or as strings.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define a simple voltagedivider.

In[2]:= net =Netlist[

V0, 1, 0, V0,R1, 1, 2, R1,R2, 2, 0, R2

]

Out[2]= NetlistRaw, 3

Show variable names. In[3]:= GetVariables[CircuitEquations[net]]

Out[3]= V$1, V$2, I$V0

The variable of interest – the voltage at node 2 – is called V$2. To mark this variable as the outputvariable we rename node 2 to OUT. Then the output variable is called V$OUT.

Rename node 2 to OUT. In[4]:= net2 = RenameNodes[net, 2 −> OUT]

Out[4]= NetlistRaw, 3

Page 262: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

260 3. Reference Manual

Display netlist. In[5]:= DisplayForm[net2]

Out[5]//DisplayForm= Netlist Raw, 3 Entries:V0, 1, 0, V0R1, 1, OUT, R1R2, OUT, 0, R2

Show variable names.Now the variable ofinterest is called V$OUT.

In[6]:= GetVariables[CircuitEquations[net2]]

Out[6]= V$1, V$OUT, I$V0

3.6.5 GetEquations

GetEquations[dae] returns the list of equations stored in dae

Command structure of GetEquations.

Given a DAEObject dae, GetEquations returns the equation system stored in the object as a list ofequations. In case of an AC DAEObject the internal matrix representation is converted to a list oflinear equations.

See also: GetMatrix (Section 3.6.6), GetVariables (Section 3.6.7), GetRHS (Section 3.6.8),GetParameters (Section 3.6.9), GetDAEOptions (Section 3.6.10), GetDesignPoint (Section 3.6.12).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist descriptionof a simple diode rectifiercircuit.

In[2]:= cir =Circuit[

Netlist[V0, 1, 0, Symbolic −> V0,

Value −> 2. Sin[10^6 Time],R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C, Model −> "Diode"

]]

Out[2]= Circuit

Set up Transient DAEsystem.

In[3]:= dae = CircuitEquations[cir, AnalysisMode −> Transient,DefaultSelector −> "Spice", ElementValues −> Symbolic]

Out[3]= DAETransient, 44

Page 263: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 261

Return list of equations. In[4]:= GetEquations[dae]

Out[4]=I$AC$D1t I$V0t 0,

I$AC$D1t V$2t

R1 C1 V$2 t 0, V$1t V0, I$AC$D1t

AREA$D1 E1.11 1.

TEMPTNOM $q

TEMP $k 1 E1. $q V$1tV$2tTEMP $k IS$D1 TEMP

TNOM

3.

GMIN V$1t V$2t

Set up AC DAE system. In[5]:= daeac = CircuitEquations[cir, AnalysisMode −> AC,DefaultSelector −> "SpiceAC", ElementValues −> Symbolic]

Out[5]= DAEAC, 33

The system is set up as amatrix equation.

In[6]:= DisplayForm[daeac]

Out[6]//DisplayForm=

1Rd$D1 Cd$D1 s 1Rd$D1 Cd$D1 s 1

1Rd$D1 Cd$D1 s 1R1 1Rd$D1 C1 s Cd$D1 s 0

1 0 0

.

V$1V$2I$V0

00V0

Return value is again alist of equations.

In[7]:= GetEquations[daeac]

Out[7]=

I$V0 1Rd$D1

Cd$D1 s V$1 1

Rd$D1

Cd$D1 s V$2 0,

1

Rd$D1

Cd$D1 s V$1 1R1

1

Rd$D1

C1 s Cd$D1 s V$2 0,

V$1 V0

3.6.6 GetMatrix

GetMatrix[dae] returns the matrix equations stored in dae

Command structure of GetMatrix.

Given a DAEObject dae, GetMatrix returns the matrix A of the linear equation system A x bstored in the object.

Please note that GetMatrix is only valid for AC DAEObjects.

See also: GetEquations (Section 3.6.5), GetVariables (Section 3.6.7), GetRHS (Section 3.6.8),GetParameters (Section 3.6.9), GetDAEOptions (Section 3.6.10), GetDesignPoint (Section 3.6.12).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 264: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

262 3. Reference Manual

Define a simple voltagedivider netlist.

In[2]:= net =Netlist[

V0, 1, 0, V0,R1, 1, 2, R1,R2, 2, 0, R2

]

Out[2]= NetlistRaw, 3

Set up AC DAE system. In[3]:= dae = CircuitEquations[net]

Out[3]= DAEAC, 33

Return matrix A. In[4]:= GetMatrix[dae] // MatrixForm

Out[4]//MatrixForm=

1R1 1R1 1

1R11R1 1R2 0

1 0 0

3.6.7 GetVariables

GetVariables[dae] returns the list of variables stored in dae

Command structure of GetVariables.

Given a DAEObject dae, GetVariables returns the list of variables stored in the object. For ACand DC DAEObjects this is a list of symbols, for Transient DAEObjects this is a list of the formsymbt where symb is a symbol and t is the independent variable.

See also: GetEquations (Section 3.6.5), GetMatrix (Section 3.6.6), GetRHS (Section 3.6.8),GetParameters (Section 3.6.9), GetDAEOptions (Section 3.6.10), GetDesignPoint (Section 3.6.12).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist descriptionof a simple diode rectifiercircuit.

In[2]:= cir =Circuit[

Netlist[V0, 1, 0, Symbolic −> V0,

Value −> 2. Sin[10^6 Time],R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C, Model −> "Diode"

]]

Out[2]= Circuit

Set up AC DAE system. In[3]:= dae = CircuitEquations[cir, AnalysisMode −> AC,DefaultSelector −> "SpiceAC"]

Out[3]= DAEAC, 33

Page 265: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 263

Return list of variablesstored in dae.

In[4]:= GetVariables[dae]

Out[4]= V$1, V$2, I$V0

Set up Transient DAEsystem.

In[5]:= daetran = CircuitEquations[cir,AnalysisMode −> Transient, DefaultSelector −> "Spice"]

Out[5]= DAETransient, 44

Return list of variablesstored in daetran.

In[6]:= GetVariables[daetran]

Out[6]= V$1t, V$2t, I$V0t, I$AC$D1t

3.6.8 GetRHS

GetRHS[dae] returns the right-hand side source vector stored in dae

Command structure of GetRHS.

Given a DAEObject dae, GetRHS returns the right-hand side source vector b of the linear equationsystem A x b stored in the object.

Please note that GetRHS is only valid for AC DAEObjects.

See also: GetEquations (Section 3.6.5), GetMatrix (Section 3.6.6), GetVariables (Section 3.6.7),GetParameters (Section 3.6.9), GetDAEOptions (Section 3.6.10), GetDesignPoint (Section 3.6.12).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define a simple voltagedivider netlist.

In[2]:= net =Netlist[

V0, 1, 0, V0,R1, 1, 2, R1,R2, 2, 0, R2

]

Out[2]= NetlistRaw, 3

Set up AC DAE system. In[3]:= dae = CircuitEquations[net]

Out[3]= DAEAC, 33

Return vector b. In[4]:= GetRHS[dae] // MatrixForm

Out[4]//MatrixForm=

00V0

Page 266: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

264 3. Reference Manual

3.6.9 GetParameters

GetParameters[dae] returns the list of parameters stored in dae

Command structure of GetParameters.

Given a DAEObject dae, GetParameters returns the list of parameters occuring in the equationsystem of the object.

Note that GetParameters differs from GetDesignPoint in that it returns only those parameterswhich appear in the equations of dae. Moreover, it returns a list of symbols, not a list of replacementrules.

See also: GetEquations (Section 3.6.5), GetMatrix (Section 3.6.6), GetVariables (Section 3.6.7),GetRHS (Section 3.6.8), GetDAEOptions (Section 3.6.10), GetDesignPoint (Section 3.6.12).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist descriptionof a simple diode rectifiercircuit.

In[2]:= cir =Circuit[

Netlist[V0, 1, 0, Symbolic −> V0,

Value −> 2. Sin[10^6 Time],R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice"]

]

Out[2]= Circuit

Set up DAE system. In[3]:= dae = CircuitEquations[cir,AnalysisMode −> Transient, ElementValues −> Symbolic]

Out[3]= DAETransient, 44

Return list of parametersoccuring in the equationsof dae.

In[4]:= GetParameters[dae]

Out[4]=AREA$D1, C1, GMIN, IS$D1, R1, TEMP, TNOM, V0, $k, $q

Page 267: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 265

3.6.10 GetDAEOptions

GetDAEOptions[dae] returns the list of options stored in the DAEObject dae

GetDAEOptions[dae, symb] returns the value of the option symb stored in dae

GetDAEOptions[dae, symb, symb, † † † ]returns a list of values of the options symbi stored in dae

Command structure of GetDAEOptions.

Besides the equation system and the list of variables, a DAEObject contains a list of arbitrary options.Use GetDAEOptions to extract these options: GetDAEOptions[dae] returns a list of all options storedin the DAEObject dae. If a second argument is specified and is an option symbol, the value of thisoption stored in the DAEObject is returned. If it is a list of option symbols, a list of the optionvalues is returned.

The function CircuitEquations (Section 3.5.1) automatically adds a number of options to theDAEObject which have been used during equation setup.

To extract the DesignPoint option of a DAEObject it is recommended to use the functionGetDesignPoint.

See also: SetDAEOptions (Section 3.6.11), GetEquations (Section 3.6.5), GetMatrix (Section 3.6.6),GetVariables (Section 3.6.7), GetRHS (Section 3.6.8), GetDesignPoint (Section 3.6.12).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist descriptionof a simple diode rectifiercircuit.

In[2]:= cir =Circuit[

Netlist[V0, 1, 0, Symbolic −> V0,

Value −> 2. Sin[10^6 Time],R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice"]

]

Out[2]= Circuit

Set up DAE system. In[3]:= dae = CircuitEquations[cir,AnalysisMode −> Transient, ElementValues −> Symbolic]

Out[3]= DAETransient, 44

Page 268: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

266 3. Reference Manual

Return the list of alloptions stored in dae.

In[4]:= GetDAEOptions[dae]

Out[4]=AnalysisMode Transient, BranchCurrentPrefix I$,BranchVoltagePrefix V$, ControllingCurrentPrefix IC$,ControllingVoltagePrefix VC$, ConvertImmittances True,DesignPoint V0 2. Sin1000000 t, R1 100., C1 1.107,

AREA$D1 1., BV$D1 , CJO$D1 0, GMIN 1.1012,IBV$D1 0.001, IS$D1 1.1014, RS$D1 0, TEMP 300.15,TNOM 300.15, $k 1.380621023, $q 1.602191019,

ElementValues Symbolic, Formulation ModifiedNodal,FrequencyVariable s, IgnoreMissingGround False,IndependentVariable t, InitialConditions None,InitialGuess I$AC$D1 0, V$1 V$2 0,InitialTime 0, InstanceNameSeparator $,MatrixEquation True, ModeValues , NodeVoltagePrefix V$,Symbolic All, TimeVariable t, Value None

Return special optionsstored in dae.

In[5]:= GetDAEOptions[dae, IndependentVariable, InitialTime]

Out[5]= t, 0

3.6.11 SetDAEOptions

SetDAEOptions[dae, name−>val] stores the value val of the option name in dae, removingany previously stored value for this option

SetDAEOptions[dae, name−>val, name−>val, † † † ]stores the values vali for the options namei in dae

Command structure of SetDAEOptions.

Besides the equation system and the list of variables, a DAEObject contains a list of arbitrary options.Use SetDAEOptions to store or to update options in a DAEObject: SetDAEOptions[dae, name −> val]stores the value val of the option name in dae and returns the new list of options. If the secondargument is a list of option rules, the value for each option rule is stored. Previously stored valuesfor the given options are replaced by the new values and new options are appended to the list ofoptions. Note that SetDAEOptions alters the given DAEObject rather than returning a new object.Instead it returns the updated option list.

In contrast to the Mathematica function SetOptions, the function SetDAEOptions does not checkwhether a given option is a valid DAEObject option. Any option is a valid DAEObject option andcan be stored in the object (there is no Options[DAEObject]).

To alter the DesignPoint option of a DAEObject it is recommended to use the functionUpdateDesignPoint.

See also: GetDAEOptions (Section 3.6.10), GetEquations (Section 3.6.5), GetMatrix (Section 3.6.6),GetVariables (Section 3.6.7), GetRHS (Section 3.6.8), GetDesignPoint (Section 3.6.12),UpdateDesignPoint (Section 3.6.14).

Page 269: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 267

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist descriptionof a simple diode rectifiercircuit.

In[2]:= cir =Circuit[

Netlist[V0, 1, 0, Symbolic −> V0,

Value −> 2. Sin[10^6 Time],R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice"]

]

Out[2]= Circuit

Set up DAE system. In[3]:= dae = CircuitEquations[cir,AnalysisMode −> Transient, ElementValues −> Symbolic]

Out[3]= DAETransient, 44

Inspect the value of theInitialTime option indae.

In[4]:= GetDAEOptions[dae, InitialTime]

Out[4]= 0

Alter the value of theInitialTime option.

In[5]:= SetDAEOptions[dae, InitialTime −> 0.5]

Out[5]=AnalysisMode Transient, BranchCurrentPrefix I$,BranchVoltagePrefix V$, ControllingCurrentPrefix IC$,ControllingVoltagePrefix VC$, ConvertImmittances True,DesignPoint V0 2. Sin1000000 t, R1 100., C1 1.107,

AREA$D1 1., BV$D1 , CJO$D1 0, GMIN 1.1012,IBV$D1 0.001, IS$D1 1.1014, RS$D1 0, TEMP 300.15,TNOM 300.15, $k 1.380621023, $q 1.602191019,

ElementValues Symbolic,Formulation ModifiedNodal, FrequencyVariable s,IgnoreMissingGround False, IndependentVariable t,InitialConditions None, InitialGuess

I$AC$D1 0, V$1 V$2 0, InstanceNameSeparator $,MatrixEquation True, ModeValues , NodeVoltagePrefix V$,Symbolic All, TimeVariable t, Value None, InitialTime 0.5

Note that dae was alteredby SetDAEOptions.

In[6]:= GetDAEOptions[dae, InitialTime]

Out[6]= 0.5

Page 270: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

268 3. Reference Manual

You can set arbitraryoptions with arbitraryvalues.

In[7]:= SetDAEOptions[dae,Comment −> "This object describes a rectifier circuit"]

Out[7]=AnalysisMode Transient, BranchCurrentPrefix I$,BranchVoltagePrefix V$, ControllingCurrentPrefix IC$,ControllingVoltagePrefix VC$, ConvertImmittances True,DesignPoint V0 2. Sin1000000 t, R1 100., C1 1.107,

AREA$D1 1., BV$D1 , CJO$D1 0, GMIN 1.1012,IBV$D1 0.001, IS$D1 1.1014, RS$D1 0, TEMP 300.15,TNOM 300.15, $k 1.380621023, $q 1.602191019,

ElementValues Symbolic,Formulation ModifiedNodal, FrequencyVariable s,IgnoreMissingGround False, IndependentVariable t,InitialConditions None, InitialGuess

I$AC$D1 0, V$1 V$2 0, InstanceNameSeparator $,MatrixEquation True, ModeValues , NodeVoltagePrefix V$,Symbolic All, TimeVariable t, Value None, InitialTime 0.5,Comment This object describes a rectifier circuit

3.6.12 GetDesignPoint

GetDesignPoint[dae] returns the design point stored in dae

GetDesignPoint[dae, param] returns the value of the parameter param from the designpoint stored in dae

GetDesignPoint[dae, param, param, † † † ]returns the value of each parameter parami

Command structure of GetDesignPoint.

Given a DAEObject dae, GetDesignPoint returns the design point list stored in the object. If asymbol is given as a second argument, the value of the corresponding parameter stored in the designpoint is returned. If the second argument is a list of symbols, a list of the corresponding parametervalues is returned.

Note that GetDesignPoint differs from GetParameters in that it returns the complete design pointstored in dae and not only those parameters which appear in the equations of dae.

See also: GetEquations (Section 3.6.5), GetMatrix (Section 3.6.6), GetVariables (Section 3.6.7),GetRHS (Section 3.6.8), GetParameters (Section 3.6.9), GetDAEOptions (Section 3.6.10).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 271: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 269

Define netlist descriptionof a simple diode rectifiercircuit.

In[2]:= cir =Circuit[

Netlist[V0, 1, 0, Symbolic −> V0,

Value −> 2. Sin[10^6 Time],R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice"]

]

Out[2]= Circuit

Set up DAE system. In[3]:= dae = CircuitEquations[cir,AnalysisMode −> Transient, ElementValues −> Symbolic]

Out[3]= DAETransient, 44

Return design point storedin dae.

In[4]:= GetDesignPoint[dae]

Out[4]=V0 2. Sin1000000 t, R1 100.,C1 1.107, AREA$D1 1., BV$D1 , CJO$D1 0, GMIN 1.1012,IBV$D1 0.001, IS$D1 1.1014, RS$D1 0, TEMP 300.15,TNOM 300.15, $k 1.380621023, $q 1.602191019

Return the values of theparameters R1 and C1.

In[5]:= GetDesignPoint[dae, R1, C1]

Out[5]= 100., 1.107

3.6.13 ApplyDesignPoint

ApplyDesignPoint[dae, stringpattern]replaces all parameters of dae matching stringpattern withtheir numerical values

ApplyDesignPoint[dae, stringpattern, stringpattern, † † † ]replaces all parameters matching a list of string patternswith their numerical values

ApplyDesignPoint[dae] replaces all parameters of the design point with theirnumerical values

Command structure of ApplyDesignPoint.

Given a DAEObject, ApplyDesignPoint returns a new DAEObject where all parameters in theequation system which match a string pattern stringpattern are replaced with their numerical valuesstored in the DesignPoint option of dae. If a list of string patterns is given, all parameters whichmatch at least one of the patterns are replaced. By default, all replaced parameters are removed fromthe DesignPoint option in the returned DAEObject. You can use the option Cleanup to change thisbehavior (see below). Note that matching is performed using string patterns.

Page 272: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

270 3. Reference Manual

It is possible to specify a symbol symb instead of a string pattern as parameter toApplyDesignPoint, which is equivalent to specifying the string pattern "symb". This is also validfor the option KeepSymbolic (see below).

ApplyDesignPoint has the following options:

option name default value

Cleanup True removes unused parameters from thedesign point

KeepSymbolic specifies parameters to be kept symbolic

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Options for ApplyDesignPoint.

See also: UpdateDesignPoint (Section 3.6.14).

Options Description

Cleanup

This option allows for removing parameters from the design point of a DAEObject that do not occurin the corresponding equations.

The default setting is Cleanup −> True, which means that at least all those parameters which havebeen inserted numerically are removed from the design point.

KeepSymbolic

By default, all parameters which match one of the string patterns stringpatterni are replaced by theirnumerical value. The option KeepSymbolic allows for filtering this list of replaced parameters. Theoption value must be a list of string patterns.

All parameters which match at least one of these string patterns are kept symbolic even if theymatch the string patterns given as arguments to ApplyDesignPoint. This option is especially usefulto insert the numerical value for a model parameter keeping the parameter of a specific instancesymbolic. For example,

ApplyDesignPoint[dae, "AREA*", KeepSymbolic −> "AREA$Q1"]

inserts the numerical value of the model parameter AREA for each instance except for the instance Q1for which the parameter is kept symbolic.

Page 273: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 271

The default setting is KeepSymbolic −> , which means not to filter the parameters to be insertednumerically.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist. In[2]:= cir =Circuit[

Netlist[V0, 1, 0, Symbolic −> V0,

Value −> 2. Sin[10^6 Time],R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice"]

]

Out[2]= Circuit

Set up DAE system. In[3]:= dae = CircuitEquations[cir, AnalysisMode −> Transient,ElementValues −> Symbolic]

Out[3]= DAETransient, 44

Show DAE system. In[4]:= DisplayForm[dae]

Out[4]//DisplayForm=

I$AC$D1t I$V0t 0, I$AC$D1t V$2t

R1 C1 V$2 t 0,

V$1t V0, I$AC$D1t AREA$D1 E1.11 1.

TEMPTNOM $q

TEMP $k

1 E1. $q V$1tV$2tTEMP $k IS$D1 TEMP

TNOM

3.

GMIN V$1t V$2t,V$1t, V$2t, I$V0t, I$AC$D1t,DesignPoint V0 2. Sin1000000 t, R1 100., C1 1.107,

AREA$D1 1., BV$D1 , CJO$D1 0, GMIN 1.1012,IBV$D1 0.001, IS$D1 1.1014, RS$D1 0, TEMP 300.15,

TNOM 300.15, $k 1.380621023, $q 1.602191019

Insert numerical values forall parameters exceptAREA$D1.

In[5]:= daenew = ApplyDesignPoint[dae, "*",KeepSymbolic −> AREA$D1]

Out[5]= DAETransient, 44

Show new DAE system.Note that parameters areremoved from theDesignPoint option ofdaenew.

In[6]:= DisplayForm[daenew]

Out[6]//DisplayForm=I$AC$D1t I$V0t 0,

I$AC$D1t 0.01 V$2t 1.107 V$2 t 0,

V$1t 2. Sin1000000 t, I$AC$D1t 1.1014 AREA$D1

1 E38.6635 V$1tV$2t 1.1012 V$1t V$2t,V$1t, V$2t, I$V0t, I$AC$D1t,DesignPoint AREA$D1 1.

Page 274: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

272 3. Reference Manual

3.6.14 UpdateDesignPoint

UpdateDesignPoint[dae, repl] allows for modifying the DesignPoint by replacementrules

Command structure of UpdateDesignPoint.

Given a DAEObject dae, UpdateDesignPoint replaces all parameters in the DesignPoint optionstored in dae according to the replacement rules repl and returns the new DAEObject. The replace-ments repl are given as a list of rules of the form symbol −> newvalue which means to replace the valueof the parameter symbol by the new numerical value newvalue in the design point of the DAEObject.If a replacement rule is of the form stringpattern −> newvalue then the value of each parameter whichmatches the string pattern is replaced by newvalue. This can for example be used to set a modelparameter to a common value for each instance of this model.

If UpdateDesignPoint is called without a second argument, the values of the design point are notchanged. However, if the option Cleanup is set to True (which is the default), unused parametersare removed from the design point. Thus, this pattern is useful for stripping the design point to therelevant data.

UpdateDesignPoint has the following options:

option name default value

Cleanup True removes unused parameters from thedesign point

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Options for UpdateDesignPoint.

See also: ApplyDesignPoint (Section 3.6.13).

Options Description

Cleanup

This option allows for removing parameters from the design point of a DAEObject that do not occurin the corresponding equations.

The default setting is Cleanup −> True, which means to remove all those parameters from the designpoint which do not occur in the equation system.

Page 275: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 273

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist. In[2]:= cir =Circuit[

Netlist[V0, 1, 0, Symbolic −> V0,

Value −> 2. Sin[10^6 Time],R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice"]

]

Out[2]= Circuit

Set up DAE system. In[3]:= dae = CircuitEquations[cir, AnalysisMode −> Transient,ElementValues −> Symbolic]

Out[3]= DAETransient, 44

Show DAE system. In[4]:= DisplayForm[dae]

Out[4]//DisplayForm=

I$AC$D1t I$V0t 0, I$AC$D1t V$2t

R1 C1 V$2 t 0,

V$1t V0, I$AC$D1t AREA$D1 E1.11 1.

TEMPTNOM $q

TEMP $k

1 E1. $q V$1tV$2tTEMP $k IS$D1 TEMP

TNOM

3.

GMIN V$1t V$2t,V$1t, V$2t, I$V0t, I$AC$D1t,DesignPoint V0 2. Sin1000000 t, R1 100., C1 1.107,

AREA$D1 1., BV$D1 , CJO$D1 0, GMIN 1.1012,IBV$D1 0.001, IS$D1 1.1014, RS$D1 0, TEMP 300.15,

TNOM 300.15, $k 1.380621023, $q 1.602191019

Store new values for theparameters R1, C1, and V0in the design point.

In[5]:= daenew = UpdateDesignPoint[dae,R1 −> 10., C1 −> 1.*^−6, V0 −> 1.]

Out[5]= DAETransient, 44

Show updated designpoint of daenew. Notethat unused parametersare removed from thedesign point.

In[6]:= GetDesignPoint[daenew]

Out[6]=V0 1., R1 10., C1 1.106, AREA$D1 1.,

GMIN 1.1012, IS$D1 1.1014, TEMP 300.15, TNOM 300.15,$k 1.380621023, $q 1.602191019

Page 276: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

274 3. Reference Manual

3.6.15 MatchSymbols

MatchSymbols[expr, matchgroups]matches symbols in an expression expr

MatchSymbols[dae, matchgroups]matches symbols in a system of equations dae

Command structure of MatchSymbols.

Given an expression expr or a DAEObject dae, MatchSymbols replaces all symbols which be-long to a given matching group matchgroups by a common symbol and returns a new expres-sion or DAEObject, respectively. The matching groups must be specified as lists of the form:suffix, suffix, † † † , matchsuffix.

Please note that the function pattern for equations uses the design-point information stored in theDAEObject to validate the matching specifications.

MatchSymbols has the following options:

option name default value

DesignPoint Automatic list of numerical reference values forsymbolic element values in a set of circuitequations

Tolerance 0.1 tolerance specification for matching thesymbols in a matching group

Options for MatchSymbols.

See also: ShortenSymbols (Section 3.6.16).

Options Description

DesignPoint

WithDesignPoint −> symbol −> value, † † † you can overwrite the design point given in the DAEObject(see also CircuitEquations in Section 3.5.1). The default setting is DesignPoint −> Automatic,which means to use the design point given in the DAEObject.

Page 277: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 275

Tolerance

Tolerance −> tol specifies the maximum relative deviation of the values of the symbols in a matchinggroup from the group’s mean value.

Please note that the option Tolerance is neglected if the DAEObject contains no design-pointinformation.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist. In[2]:= net =Netlist[

V0, 1, 0, 1,R1, 1, 2, Symbolic −> R1, Value −> 10.,R2, 2, 3, Symbolic −> R2, Value −> 10.,R3, 3, out, Symbolic −> R3, Value −> 10.,RL, out, 0, Load

]

Out[2]= NetlistRaw, 5

Set up equations. In[3]:= dae = CircuitEquations[net, ElementValues −> Symbolic];DisplayForm[dae]

Out[4]//DisplayForm=

1R1 1R1 0 0 1

1R11R1 1R2 1R2 0 0

0 1R21R2 1R3 1R3 0

0 0 1R31Load 1R3 0

1 0 0 0 0

.

V$1V$2V$3V$outI$V0

00001

Compute voltage transferfunction.

In[5]:= vout = V$out /. First[Solve[dae]]

Out[5]=Load

Load R1 R2 R3

Match symbols of resistorsR1, R2, and R3.

In[6]:= MatchSymbols[vout, "R*", R]

Out[6]=Load

Load 3 R

Match symbols of resistorsin the DAEObject.

In[7]:= daematch = MatchSymbols[dae, "R*", R];DisplayForm[daematch]

Out[8]//DisplayForm=

1R 1R 0 0 1

1R2R 1R 0 0

0 1R2R 1R 0

0 0 1R1Load 1R 0

1 0 0 0 0

.

V$1V$2V$3V$outI$V0

00001

Page 278: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

276 3. Reference Manual

Compute matched voltagetransfer function.

In[9]:= V$out /. First[Solve[daematch]]

Out[9]=Load

Load 3 R

Modify values of resistorsR2 and R3.

In[10]:= daenew = UpdateDesignPoint[dae, R2 −> 15., R3 −> 20.]

Out[10]= DAEAC, 55

Match symbols of resistorsof the modifiedDAEObject.

In[11]:= MatchSymbols[daenew, "R*", R] // DisplayForm

MatchSymbols::mtol:Design−point values of matching group R1, R2, R3

do not meet the tolerance specification.

Out[11]//DisplayForm=

1R1 1R1 0 0 1

1R11R1 1R2 1R2 0 0

0 1R21R2 1R3 1R3 0

0 0 1R31Load 1R3 0

1 0 0 0 0

.

V$1V$2V$3V$outI$V0

00001

3.6.16 ShortenSymbols

ShortenSymbols[dae] replaces symbols in dae by a set of symbols with shortersymbol names

Command structure of ShortenSymbols.

Given a DAEObject dae, ShortenSymbols replaces all symbols (variables and parameters) by a set ofnew symbols with shorter symbol names and returns a new DAEObject. Please note that the newsymbols are generated at the expense of instance information as name components enclosed by theInstanceNameSeparator are dropped.

ShortenSymbols has the following options:

option name default value

InstanceNameSeparator Inherited[AnalogInsydes]specifies the character(s) used to separatename components of variables andparameters, see InstanceNameSeparator(Section 3.14.2)

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Options for ShortenSymbols.

Page 279: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 277

See also: MatchSymbols (Section 3.6.15).

3.6.17 Statistics

Statistics[netlist] prints type and number of netlist elements in a Netlistobject netlist

Statistics[circuit] prints type and number of netlist elements in a Circuitobject circuit

Statistics[dae] prints complexity information of a DAEObject dae

Command structure of Statistics.

The command Statistics can be used to display both type and number of the netlist elements ina circuit or a netlist. Additionally, you can obtain detailed information concerning the complexity ofa DAEObject.

Statistics[circuit] and Statistics[netlist] provide the following information:

type and number of occurrence of each netlist element

type and number of occurrence of each model/selector call

total number of entries

Statistics[dae] for DC and Transient DAEObjects provides the following information:

number of equations

number of variables

number of top-level terms for each equation

number of terms which involve derivatives

number of terms for each level

Statistics[dae] for AC DAEObjects provides the following information:

Page 280: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

278 3. Reference Manual

number of equations

number of variables

total number of entries

number of non-zero entries

complexity estimate (only if the DAEObject option ElementValues is set to Symbolic, andif the option value for the time constraint is chosen large enough)

Statistics has the following options:

option name default value

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

TimeConstraint 10 specifies the maximum number of secondsfor the complexity estimate computation forAC DAEObjects

Options for Statistics.

TimeConstraint

TimeConstraint specifies the number of seconds after which the computation of the complexityestimate for an AC DAEObject is aborted. The option value may be any positive numeric value orInfinity. The default setting is TimeConstraint −> 10.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist. In[2]:= cir =Circuit[

Netlist[V0, 1, 0, Symbolic −> V0,

Value −> 2. Sin[10^6 Time],R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice"]

]

Out[2]= Circuit

Page 281: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.6 Circuit and DAEObject Manipulation 279

Display netlist informationusing Statistics.

In[3]:= Statistics[cir]

Number of Resistors : 1

Number of Capacitors : 1

Number of VoltageSources : 1

Number of models Diode/Spice : 1

Total number of elements : 4

Set up DAE system. In[4]:= dae = CircuitEquations[cir, AnalysisMode −> Transient];dae // DisplayForm

Out[5]//DisplayForm=I$AC$D1t I$V0t 0,

I$AC$D1t 0.01 V$2t 1.107 V$2 t 0,V$1t 2. Sin1000000 t, I$AC$D1t

1.1014 1 E38.6635 V$1tV$2t 1.1012 V$1t V$2t,V$1t, V$2t, I$V0t, I$AC$D1t, DesignPoint

Display complexityinformation usingStatistics.

In[6]:= Statistics[dae]

Number of equations : 4

Number of variables : 4

Length of equations : 2, 3, 2, 5

Terms with derivatives : 1

Sums in levels : 12, 2

Page 282: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

280 3. Reference Manual

3.7 Numerical Analyses

This chapter describes the standard numerical analyses types you can perform with most numericalcircuit simulators. The following table shows the supported analyses and their corresponding AnalogInsydes functions:

ACAnalysis (Section 3.7.3) small-signal (AC) analysis

NoiseAnalysis (Section 3.7.4) noise analysis

NDAESolve (Section 3.7.5) operating-point (DC) analysis

NDAESolve (Section 3.7.5) DC-transfer (DT) analysis

NDAESolve (Section 3.7.5) large-signal (transient) analysis

Section 3.7.1 starts with an introduction of the Analog Insydes numerical data format, which all ofthe above mentioned functions rely on. Section 3.7.2 describes the format which is used in AnalogInsydes to perform parameter sweeps.

3.7.1 Analog Insydes Numerical Data Format

This section introduces the simulation data format used in Analog Insydes. Some functions likeACAnalysis (Section 3.7.3), NoiseAnalysis (Section 3.7.4), NDAESolve (Section 3.7.5), orReadSimulationData (Section 3.10.3) need to return numerical data which represents zero, one, ormulti-dimensional numerical data. This data will be returned in the following form:

l1 −> v1, l2 −> v2, ,SweepParameters −> p1 −> s1, p2 −> s2, ,

The variable labels l and the parameter labels p can be of type String or Symbol. For operating-pointdata the value vi is a single numerical value, for sweep data it is an InterpolatingFunction. Theparameter value si is always a single numerical value.

SweepParameters denotes the parameters which have been swept. It can be omitted if only onedata set is present.

3.7.2 Parameter Sweeps

A few Analog Insydes functions make use of parameter sweeping: Besides the integration variable,NDAESolve (Section 3.7.5) allows for varying several parameters performing a multi-dimensionalparameter sweep. For preparation of the nonlinear simplification methods the range of the inputvariables has to be specified as a parameter sweep using the command NonlinearSetup (Sec-tion 3.12.1).

Page 283: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.7 Numerical Analyses 281

Analog Insydes supports the following parameter sweep formats:

format description

symbol, f, † † † , fm symbol has values f, † † † , fm

symbol, start, stop, incr equivalent to symbol, Range[start, stop, incr]

symb−>f, † † † , symbn−>fn, † † † , symb−>fm, † † † , symbn−>fmnFirst, symb has value f, , and symbn has value fn, andso forth. In the last step, symb has value fm, , and symbnhas value fmn

sweep, † † † , sweepm combinations of the above sweep formats

Valid parameter sweep formats.

The following example shows valid parameter sweeps:

R1, 100, 1000, 10000,V1, 1, 5, 1,P1 −> 10, P2 −> 20, P1 −> 20, P2 −> 10

If several sweep formats are combined in a list (as shown in the example above) the outer productof all sweep specifications is computed.

You can use ParamSweepQ to check whether a given sweep specification is valid in the above sense.

Examples

To demonstrate the parameter sweep format, in this example section the internal commandResolveParamSweep is used. This function returns a list where the first element is the canonicalrepresentation of the sweep specification (i.e. a flat list of rules). The second element of the result isfor internal purposes only.

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

A one-dimensional sweepwith values givenexplicitly.

In[2]:= First @ ResolveParamSweep[R1, 100, 1000, 10000]

Out[2]= R1 100., R1 1000., R1 10000.

A one-dimensional sweepwith values given by aninterval.

In[3]:= First @ ResolveParamSweep[V1, 1, 5, 1]

Out[3]=V1 1., V1 2., V1 3., V1 4., V1 5.

Page 284: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

282 3. Reference Manual

The combination of bothsweeps yields atwo-dimensional sweep.

In[4]:= First @ ResolveParamSweep[R1, 100, 1000, 10000, V1, 1, 4, 1]

Out[4]=R1 100., V1 1., R1 100., V1 2.,

R1 100., V1 3., R1 100., V1 4., R1 1000., V1 1.,R1 1000., V1 2., R1 1000., V1 3., R1 1000., V1 4.,R1 10000., V1 1., R1 10000., V1 2.,R1 10000., V1 3., R1 10000., V1 4.

You can mix any sweepformat to build validmulti-dimensional sweeps.

In[5]:= ParamSweepQ[R1, 100, 1000, V1, 1, 5, 1,P1 −> 10, P2 −> 20, P1 −> 20, P2 −> 10]

Out[5]= True

3.7.3 ACAnalysis

ACAnalysis[dae, fvar, fstart, fend]computes the small-signal solution of a linear DAEObjectdae within a specified frequency range fstart fend asfunction of the frequency variable fvar for all variables

ACAnalysis[dae, var, fvar, fstart, fend]solves for the variable var

ACAnalysis[dae, var, var, † † † , fvar, fstart, fend]solves for several variables

Command structure of ACAnalysis.

This functions allows for carrying out a numerical small-signal analysis. Given an AC DAEObject,ACAnalysis computes the small-signal solution in the specified frequency range and returns theresult according to the Analog Insydes numerical data format described in Section 3.7.1. It consistsof lists of rules, where the variables are assigned InterpolatingFunction objects.

The result of the small-signal analysis can be displayed with Analog Insydes graphics functions suchas BodePlot (Section 3.9.1).

ACAnalysis has the following options:

Page 285: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.7 Numerical Analyses 283

option name default value

FrequencyVariable Automatic specifies the symbol that denotes thecomplex Laplace frequency

InterpolateResult True specifies the return format of the result

InterpolationOrder 1 specifies the interpolation order of theresulting interpolating functions

PointsPerDecade 10 specifies the number of sampling points perfrequency decade

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

SweepPath (2. Pi I #1 &) specifies a mapping from a frequency to apoint in the complex plane

Options for ACAnalysis.

See also: BodePlot (Section 3.9.1), NoiseAnalysis (Section 3.7.4), Section 3.7.1.

Options Description

A detailed description of all ACAnalysis options is given below in alphabetical order:

FrequencyVariable

This option specifies the symbol that denotes the complex Laplace frequency. See CircuitEquationsin Section 3.5.1.

The default setting is FrequencyVariable −> Automatic, which means to use the symbol given inthe DAEObject.

InterpolateResult

If InterpolateResult is set to True, the result is returned as an interpolating function for eachvariable. If the option is set to False, the result is returned as a list of frequency, value pairs.

InterpolationOrder

With InterpolationOrder −> integer you can change the interpolation order of the resulting inter-polating functions (see the Mathematica object InterpolatingFunction).

The default setting is InterpolationOrder −> 1, which means linear interpolation.

Page 286: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

284 3. Reference Manual

PointsPerDecade

PointsPerDecade specifies the number of sampling points per frequency decade.

The default setting is PointsPerDecade −> 10.

SweepPath

SweepPath specifies a mapping from a frequency to a point in the complex plane. The option valuehas to be a pure function with one argument which returns a complex number.

The default setting is SweepPath −> (2. Pi I #1 &), which specifies a sweep along the IΩ axis.

Examples

Below we compute the frequency response of a RC lowpass filter circuit.

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist description. In[2]:= lowpass =Circuit[

Netlist[V1, 1, 0, 1,R1, 1, 2, 100.,C1, 2, 0, 1.*^−6,R2, 2, 3, 100.,C2, 3, 0, 1.*^−6,RL, 3, 0, 1000.

]]

Out[2]= Circuit

Set up system ofsmall-signal equations.

In[3]:= lowpasseqs = CircuitEquations[lowpass]

Out[3]= DAEAC, 44

Display equations. In[4]:= DisplayForm[lowpasseqs]

Out[4]//DisplayForm=

0.01 0.01 0 1

0.01 0.02 1.106 s 0.01 0

0 0.01 0.011 1.106 s 01 0 0 0

.

V$1V$2V$3I$V1

0001

Perform numericalsmall-signal analysis withACAnalysis.

In[5]:= acsweep = ACAnalysis[lowpasseqs, f, 1., 1.*^6]

Out[5]=V$1 InterpolatingFunction1., 1.106, ,V$2 InterpolatingFunction1., 1.106, ,V$3 InterpolatingFunction1., 1.106, ,I$V1 InterpolatingFunction1., 1.106,

Page 287: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.7 Numerical Analyses 285

To solve only for onevariable, specify thevariable as secondargument.

In[6]:= ACAnalysis[lowpasseqs, V$3, f, 1., 1.*^6]

Out[6]=V$3 InterpolatingFunction1., 1.106,

Display the simulationresult with BodePlot.

In[7]:= BodePlot[acsweep, V$2[f], f, 1., 1.*^6]

1.0E0 1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6Frequency

-50-40-30-20-10

0

Magnitude (dB) 1.0E0 1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6

1.0E0 1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6Frequency

-80

-60

-40

-20

0

Phase (deg)

1.0E0 1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6

V$2[f]

Out[7]= Graphics

3.7.4 NoiseAnalysis

NoiseAnalysis[dae, invar, outvar, f, fstart, fstop]computes the output noise and the equivalent input noisefor a linear DAEObject dae where the input signal isspecified by invar and the output by outvar

Command structure of NoiseAnalysis.

This functions allows for carrying out a numerical noise analysis. The output noise and the equiva-lent input noise are computed from a linear DAEObject dae, where the parameter invar denotes theinput and the variable outvar denotes the output, respectively. Use GetParameters to get a valid listof input symbols and GetVariables for a list of valid output symbols.

NoiseAnalysis returns the result according to the Analog Insydes numerical data format (see Sec-tion 3.7.1) for the output noise (denoted by the symbol OutputNoise), the equivalent input noise(denoted by the symbol InputNoise), the output variable outvar, and each noise source. The com-puted values for the noise sources are given in AHz and VHz, input and output noise in A

Hz

and V

Hz, respectively.

The result of the numerical noise analysis can be displayed with Analog Insydes graphics functionssuch as BodePlot (Section 3.9.1).

The DAEObject dae must be set up symbolically (use ElementValues −> Symbolic during equationsetup). Note that at least all sources (noise sources and the one small-signal input source invar)

Page 288: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

286 3. Reference Manual

have to be accessible symbolically. When setting up equations for noise analysis, specify the optionsettings AnalysisMode −> AC and DefaultSelector −> "Noise" for CircuitEquations in orderto use the noise models. See CircuitEquations (Section 3.5.1) for a description of the optionsDefaultSelector and ElementValues.

Note that the noise sources are expressed in the following units:

source type unit example: thermal noise

CurrentSource A

Hz Sqrt[4 k T / R]

VoltageSource V

Hz Sqrt[4 k T R]

Units of noise sources.

While specifying the value of a noise source it is also assumed that the bandwidth is Hz.

NoiseAnalysis has the following options:

option name default value

DesignPoint Automatic specifies a list of numerical reference valuesfor symbolic element values in a set ofcircuit equations

FrequencyVariable Automatic specifies the symbol that denotes thecomplex Laplace frequency

InterpolationOrder 1 specifies the interpolation order of theresulting interpolating functions

PointsPerDecade 10 specifies the number of sampling points perfrequency decade

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

SweepPath (2. Pi I #1 &) specifies a mapping from a frequency to apoint in the complex plane

Options for NoiseAnalysis

See also: BodePlot (Section 3.9.1), ACAnalysis (Section 3.7.3), GetVariables (Section 3.6.7),GetParameters (Section 3.6.9), Section 3.7.1.

Page 289: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.7 Numerical Analyses 287

Options Description

A detailed description of all NoiseAnalysis options is given below in alphabetical order:

DesignPoint

With DesignPoint −> symbol −> value, † † † , you can specify the design point. See alsoCircuitEquations (Section 3.5.1).

The default setting is DesignPoint −> Automatic, which means to use the design point given in theDAEObject.

FrequencyVariable

This option specifies the symbol that denotes the complex Laplace frequency. See CircuitEquationsin Section 3.5.1.

The default setting is FrequencyVariable −> Automatic, which means to use the symbol given inthe DAEObject.

InterpolationOrder

With InterpolationOrder −> integer, you can change the interpolation order of the resulting inter-polating functions. See the Mathematica object InterpolatingFunction .

The default setting is InterpolationOrder −> 1, which is linear interpolation.

PointsPerDecade

PointsPerDecade specifies the number of sampling points per frequency decade.

The default setting is PointsPerDecade −> 10.

SweepPath

SweepPath specifies a mapping from a frequency to a point in the complex plane. The option valuehas to be a pure function with one argument which returns a complex number.

The default setting is SweepPath −> (2. Pi I #1 &), which specifies a sweep along the IΩ axis.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 290: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

288 3. Reference Manual

Read the netlist and theoperating-pointinformation.

In[2]:= bufcir = ReadNetlist["AnalogInsydes/DemoFiles/Buffer.cir","AnalogInsydes/DemoFiles/Buffer.out",Simulator −> "PSpice"]

Out[2]= Circuit

Choose noise models andset up system of equationssymbolically.

In[3]:= bufeq = CircuitEquations[bufcir, AnalysisMode −> AC,DefaultSelector −> "Noise", ElementValues −> Symbolic]

Out[3]= DAEAC, 1818

View circuit variables. Thevariable V$99 is chosen asoutput symbol.

In[4]:= GetVariables[bufeq]

Out[4]=V$1, V$2, V$3, V$4, V$5, V$99, V$BS$Q$T1, V$BS$Q$T2, V$BS$Q$T3,V$BS$Q$T4, V$BS$Q$T5, V$CS$Q$T1, V$CS$Q$T2, V$CS$Q$T3,V$CS$Q$T4, V$CS$Q$T5, I$V$VDD, I$V$VIN

View circuit parameters.The parameter V$VIN ischosen as input symbol.

In[5]:= GetParameters[bufeq]

Out[5]=Cbc$Q$T1, Cbc$Q$T2, Cbc$Q$T3,Cbc$Q$T4, Cbc$Q$T5, Cbe$Q$T1, Cbe$Q$T2, Cbe$Q$T3, Cbe$Q$T4,Cbe$Q$T5, Cbx$Q$T1, Cbx$Q$T2, Cbx$Q$T3, Cbx$Q$T4, Cbx$Q$T5,Gmu$Q$T1, Gmu$Q$T2, Gmu$Q$T3, Gmu$Q$T4, Gmu$Q$T5, gm$Q$T1,gm$Q$T2, gm$Q$T3, gm$Q$T4, gm$Q$T5, Ib$Q$T1, Ib$Q$T2, Ib$Q$T3,Ib$Q$T4, Ib$Q$T5, Ic$Q$T1, Ic$Q$T2, Ic$Q$T3, Ic$Q$T4, Ic$Q$T5,Irc$Q$T1, Irc$Q$T2, Irc$Q$T3, Irc$Q$T4, Irc$Q$T5, Irx$Q$T1,Irx$Q$T2, Irx$Q$T3, Irx$Q$T4, Irx$Q$T5, Rc$Q$T1, Rc$Q$T2,Rc$Q$T3, Rc$Q$T4, Rc$Q$T5, Ro$Q$T1, Ro$Q$T2, Ro$Q$T3, Ro$Q$T4,Ro$Q$T5, Rpi$Q$T1, Rpi$Q$T2, Rpi$Q$T3, Rpi$Q$T4, Rpi$Q$T5,Rx$Q$T1, Rx$Q$T2, Rx$Q$T3, Rx$Q$T4, Rx$Q$T5, V$VIN

Page 291: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.7 Numerical Analyses 289

Perform numerical noiseanalysis withNoiseAnalysis. Note theadditional symbolsOutputNoise andInputNoise in the result.

In[6]:= bufnoi = NoiseAnalysis[bufeq, V$VIN, V$99,f, 10., 1.*^8]

Out[6]=OutputNoise InterpolatingFunction10., 1.108, ,InputNoise InterpolatingFunction10., 1.108, ,V$99 InterpolatingFunction10., 1.108, ,Ib$Q$T1 InterpolatingFunction10., 1.108, ,Ib$Q$T2 InterpolatingFunction10., 1.108, ,Ib$Q$T3 InterpolatingFunction10., 1.108, ,Ib$Q$T4 InterpolatingFunction10., 1.108, ,Ib$Q$T5 InterpolatingFunction10., 1.108, ,Ic$Q$T1 InterpolatingFunction10., 1.108, ,Ic$Q$T2 InterpolatingFunction10., 1.108, ,Ic$Q$T3 InterpolatingFunction10., 1.108, ,Ic$Q$T4 InterpolatingFunction10., 1.108, ,Ic$Q$T5 InterpolatingFunction10., 1.108, ,Irc$Q$T1 InterpolatingFunction10., 1.108, ,Irc$Q$T2 InterpolatingFunction10., 1.108, ,Irc$Q$T3 InterpolatingFunction10., 1.108, ,Irc$Q$T4 InterpolatingFunction10., 1.108, ,Irc$Q$T5 InterpolatingFunction10., 1.108, ,Irx$Q$T1 InterpolatingFunction10., 1.108, ,Irx$Q$T2 InterpolatingFunction10., 1.108, ,Irx$Q$T3 InterpolatingFunction10., 1.108, ,Irx$Q$T4 InterpolatingFunction10., 1.108, ,Irx$Q$T5 InterpolatingFunction10., 1.108,

Display the simulationresult.

In[7]:= BodePlot[bufnoi, OutputNoise[f], InputNoise[f],f, 10., 1.*^8, PhaseDisplay −> None,TraceNames −> "noise(out)", "noise(in)"]

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-180

-170

-160

-150

-140

Magnitude (dB)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

noise(out) noise(in)

Out[7]= Graphics

Page 292: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

290 3. Reference Manual

3.7.5 NDAESolve

NDAESolve[dae, tvar, t] computes the DC solution of a nonlinear DAEObject dae atthe time point tvar t

NDAESolve[dae, tvar, t, params]carries out a parametric DC analysis

NDAESolve[dae, tvar, tstart, tend]computes the transient or the DC-transfer solution of anonlinear DAEObject dae within a specified integrationinterval tstart tend as function of the independentvariable tvar

NDAESolve[dae, tvar, tstart, tend, params]carries out a parametric transient or a parametricDC-transfer analysis

Command structure of NDAESolve.

The function NDAESolve allows for carrying out several numerical analyses, such as an operating-point (DC) analysis, a DC-transfer (DT) analysis, or a large-signal (transient) analysis. NDAESolvereturns the result according to the Analog Insydes numerical data format described in Section 3.7.1.It consists of lists of rules, where the variables are assigned InterpolatingFunction objects in caseof a transient analysis or numerical values in case of a DC analysis. Both analysis modes can alsobe carried out as parametric analyses. For this, specify a parameter sweep params according to theAnalog Insydes parameter sweep format described in Section 3.7.2.

The result of the numerical transient analysis can be displayed with Analog Insydes graphics func-tions such as TransientPlot (Section 3.9.6).

Note that NDAESolve still supports the command structure from Release 1 where the first argumentis given as eqns, vars instead of a DAEObject:

NDAESolve[eqns, vars, tvar, t]carries out a DC analysis

NDAESolve[eqns, vars, tvar, t, params]carries out a parametric DC analysis

NDAESolve[eqns, vars, tvar, tstart, tend]carries out a transient or a DC-transfer analysis

NDAESolve[eqns, vars, tvar, tstart, tend, params]carries out a parametric transient or a parametricDC-transfer analysis

Additional patterns of NDAESolve.

Page 293: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.7 Numerical Analyses 291

NDAESolve has the following options:

option name default value

AccuracyGoal 6 number of digits of accuracy to seek in theresult (see also FindRoot)

Compiled True whether to compile the equations (see alsoFindRoot)

MaxIterations 100, 20 maximum number of iterations of thenonlinear solver

WorkingPrecision 16 number of digits of precision to keep ininternal computations (see also FindRoot)

NonlinearMethod FindRoot allows for switching the nonlinear equationsolver

Nonlinear solver options of NDAESolve.

option name default value

MaxDelta 1. limit for the deviation of variable valuesduring the automatic step size control

MaxSteps Automatic maximum number of integration steps

MaxStepSize Automatic upper limit of the integration step size

MinStepSize Automatic lower limit of the integration step size

StartingStepSize Automatic initial integration step size

StepSizeFactor 1.5 modification factor of the integration stepsize

Step size control options of NDAESolve.

Page 294: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

292 3. Reference Manual

option name default value

InitialConditions Automatic whether to consider initial conditions

InitialGuess Automatic initial guess for the operating-pointcomputation

InitialSolution Automatic initial solution for the operating-pointcomputation

RandomFunction (Random[Real, 0., 0.1]&)random function for perturbing the initialguess

Operating-point computation options of NDAESolve.

option name default value

InterpolationOrder 1 interpolation order of the resultinginterpolating functions

OutputVariables All variables to appear in the solution vector

ReturnDerivatives False whether to include solutions for thederivatives in the solution vector

Return format options of NDAESolve.

Page 295: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.7 Numerical Analyses 293

option name default value

AnalysisMode Transient circuit analysis mode

BreakOnError False whether to interrupt a parametric DC ortransient analysis in case of an error

CompressEquations False whether to carry out a symbolicpre-processing of the equation system

DesignPoint Automatic list of numerical reference values forsymbolic element values in a set of circuitequations

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Simulator Inherited[AnalogInsydes]standard Analog Insydes simulatorspecification (see Section 3.14.6)

SimulatorExecutable Automatic name of the external simulator executable

Miscellaneous options of NDAESolve.

See also: TransientPlot (Section 3.9.6), Section 3.7.1, Section 3.7.2.

Options Description

A detailed description of all NDAESolve options is given below in alphabetical order:

AnalysisMode

The option AnalysisMode specifies the circuit analysis mode, where the default setting isAnalysisMode −> Transient. Valid option values are as follows:

DC carries out a DC-transfer analysis

Transient carries out a large-signal time-domain analysis

Values for the AnalysisMode option.

Note that this option is only valid for the NDAESolve pattern where you have to specify a start valuetstart and an end value tend. In this case NDAESolve is able to carry out a DC-transfer analysis bysetting the option to AnalysisMode −> DC, although the input is a Transient DAEObject.

Page 296: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

294 3. Reference Manual

Note that the DC-transfer analysis method replaces all derivatives in the circuit equations by zero.Thus, inductors are replaced by short circuits because all inductor voltages are set to zero:

Inductor: VLt L#ILt#t

DC $ VLt % Short Circuit

and capacitors are replaced by open circuits because all capacitor currents are set to zero:

Capacitor: ICt C#UCt#t

DC $ ICt % Open Circuit

BreakOnError

The option BreakOnError allows for interrupting a parametric DC or transient analysis in case of anerror. If set to True and the computation for one parameter sweep fails, the simulation is interruptedand $Failed is returned. The default setting is BreakOnError −> False.

CompressEquations

The option CompressEquations allows for carrying out a symbolic pre-processing of the equationsystem before it is solved numerically. This means that equations and variables which are not rel-evant for computing the variables of interest (given by the option OutputVariables) are removed.Note that this option is only effective if the option OutputVariables is not set to All. The optionis realized by an internal call of the function CompressNonlinearEquations (Section 3.12.2). Thedefault setting is CompressEquations −> False.

DesignPoint

WithDesignPoint −> symbol −> value, † † † you can overwrite the design point given in the DAEObject(see also CircuitEquations in Section 3.5.1). The default setting is DesignPoint −> Automatic,which means to use the design point given in the DAEObject.

InitialConditions

The option InitialConditions allows for considering initial conditions (see also CircuitEquationsin Section 3.5.1). The default setting is InitialConditions −> Automatic. Valid option values areas follows:

Page 297: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.7 Numerical Analyses 295

None neglects initial conditions

Automatic considers initial conditions

All same as Automatic

Values for the InitialConditions option.

InitialGuess

The option InitialGuess allows for explicitly specifying an initial guess for the Newton iterationwhen computing the operating point. Note that missing variables are set to zero. The default settingis InitialGuess −> Automatic, which means that all variables have the initial value zero. Possibleoption values are as follows:

Automatic uses zero values as initial guess

var −> value, † † † uses specified values as initial guess and sets values notspecified to zero

Values for the InitialGuess option.

InitialSolution

The option InitialSolution allows for specifying an initial solution for certain variables of theoperating point. Note that missing variables are computed consistently. The default setting isInitialSolution −> Automatic, which automatically computes the operating point. Possible op-tion values are as follows:

Automatic computes operating point automatically

var −> value, † † † uses specified values as initial solution

Values for the InitialSolution option.

InterpolationOrder

With InterpolationOrder −> integer you can change the interpolation order of the resulting in-terpolating functions (see the Mathematica object InterpolatingFunction). The default setting isInterpolationOrder −> 1, which means linear interpolation.

Page 298: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

296 3. Reference Manual

MaxDelta

One of the conditions included in the automatic step size control is a check for rapidly changingvariable values from a certain point in time to its succeeding time instant. The maximum alloweddeviation is controlled via the option MaxDelta. The default setting is MaxDelta −> 1.

MaxIterations

MaxIterations specifies the maximum number of iterations the nonlinear equation solver should useattempting to find a solution. The option setting can either be an integer int or a list of two integersint, int. If it is specified as a single integer int then it is equivalent to the list int, int. Thefirst integer value defines the iteration limit for finding a DC operating-point and the second integervalue the iteration limit for transient computations, respectively. If the number of iterations for theoperating-point computation exceeds the limit, an error message is generated and the computation isinterrupted. If the iteration limit for transient computations is exceeded, the step size is reduced bythe factor given by the option StepSizeFactor. The default setting is MaxIterations −> 100, 20.

MaxSteps

The option MaxSteps limits the number of integration steps. The computation will be stoppedimmediately if the limiting value is exceeded. The default setting is MaxSteps −> Automatic, whichmeans MaxSteps tend tstart StartingStepSize.

MaxStepSize

The option MaxStepSize specifies the upper limit of the integration step size. The default setting isMaxStepSize −> Automatic, which means MaxStepSize tend tstart .

MinStepSize

The option MinStepSize specifies the lower limit of the integration step size. The computation willbe stopped immediately if the integration step size falls below this limit. The default setting isMinStepSize −> Automatic, which means MinStepSize tend tstart .

NonlinearMethod

The option NonlinearMethod allows for choosing between different algorithms for numerically solv-ing nonlinear equation systems. The default setting is NonlinearMethod −> FindRoot. Valid optionvalues are as follows:

Page 299: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.7 Numerical Analyses 297

FindRoot uses Mathematica’s numerical equation solver FindRoot

NewtonIteration uses multi-dimensional Newton-Raphson implementation

Values for the NonlinearMethod option.

OutputVariables

The option OutputVariables specifies those variables which should be included in the solutionvector. The default setting is OutputVariables −> All. Valid option values are as follows:

All returns solutions for all variables

var, † † † returns solutions for the specified variables only

Values for the OutputVariables option.

RandomFunction

The option RandomFunction specifies a function used for generating random numbers for perturbingthe initial guess during the operating-point computation. Note that the generated random numbersare added to the initial guess. The return value of the function should be a real number. The defaultsetting is RandomFunction −> (Random[Real, 0., 0.1]&).

ReturnDerivatives

The option ReturnDerivatives allows for including solutions of the derivatives in the solutionvector. The default setting is ReturnDerivatives −> False.

Simulator

The option Simulator specifies the simulator which should be applied for numerically solving thesystem of equations. The default setting is Simulator −> Inherited[AnalogInsydes]. Valid optionvalues are as follows:

"AnalogInsydes" applies internal Analog Insydes solver

"PSpice" applies PSpice kernel

"Saber" applies Saber kernel

Values for the Simulator option.

Page 300: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

298 3. Reference Manual

In case of an external simulator kernel a behavioral model in the simulator-specific language is gen-erated with the function WriteModel (Section 3.10.5). Then the respective simulator kernel given bythe option SimulatorExecutable is applied, and finally the generated simulation data is importedvia the function ReadSimulationData (Section 3.10.3).

Please note that this option is in an experimental state. Additionally, it is extremely dependent onthe applied simulator, its underlying operating system, and even the available simulator version.

SimulatorExecutable

The option SimulatorExecutable specifies the name of the external simulator executable. Note thatthis option is only effective if an external simulator is applied via the option Simulator. The de-fault setting is SimulatorExecutable −> Automatic, which means "pspice" in case of PSpice and"saber" in case of Saber, respectively. If set to a string make sure that the simulator call correspondsto the setting of the Simulator option. Otherwise the internal calls to the functions WriteModel andReadSimulationData fail. Valid option values are as follows:

Automatic generates simulator call according to the Simulator option

"string" allows user specific simulator call

Values for the SimulatorExecutable option.

StartingStepSize

The option StartingStepSize specifies the initial integration step size. The default setting isStartingStepSize −> Automatic, which means StartingStepSize tend tstart .

StepSizeFactor

To speed up the computation time NDAESolve includes an automatic step size control. If the devia-tions of the variable values from one time point to its succeeding time instant fulfill certain conditionsthe actual step size will be multiplied or divided by the value given by the option StepSizeFactor.The default setting is StepSizeFactor −> 1.5.

Examples

Consider the following diode rectifier circuit with a sinusoidal input voltage.

Page 301: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.7 Numerical Analyses 299

V0 C1 R1 Vout

1 2D1

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define netlist descriptionof a simple diode rectifiercircuit.

In[2]:= rectifier =Circuit[

Netlist[V0, 1, 0, Symbolic −> V0,

Value −> 2. Sin[10^6 Time],R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice"]

]

Out[2]= Circuit

Set up system of symbolictime-domain equations.

In[3]:= rectifiereqs = CircuitEquations[rectifier,AnalysisMode −> Transient, ElementValues −> Symbolic]

Out[3]= DAETransient, 44

Display equations. In[4]:= DisplayForm[rectifiereqs]

Out[4]//DisplayForm=

I$AC$D1t I$V0t 0, I$AC$D1t V$2t

R1 C1 V$2 t 0,

V$1t V0, I$AC$D1t AREA$D1 E1.11 1.

TEMPTNOM $q

TEMP $k

1 E1. $q V$1tV$2tTEMP $k IS$D1 TEMP

TNOM

3.

GMIN V$1t V$2t,V$1t, V$2t, I$V0t, I$AC$D1t,DesignPoint V0 2. Sin1000000 t, R1 100., C1 1.107,

AREA$D1 1., BV$D1 , CJO$D1 0, GMIN 1.1012,IBV$D1 0.001, IS$D1 1.1014, RS$D1 0, TEMP 300.15,

TNOM 300.15, $k 1.380621023, $q 1.602191019

Perform numerical DCanalysis with NDAESolve.

In[5]:= NDAESolve[rectifiereqs, t, 0.]

Out[5]=V$2 0., V$1 0., I$V0 0., I$AC$D1 0.

Page 302: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

300 3. Reference Manual

Perform numericaltransient analysis withNDAESolve.

In[6]:= tran = NDAESolve[rectifiereqs, t, 0., 2.*^−5]

Out[6]=V$2 InterpolatingFunction0, 0.00002, ,V$1 InterpolatingFunction0, 0.00002, ,I$V0 InterpolatingFunction0, 0.00002, ,I$AC$D1 InterpolatingFunction0, 0.00002,

Display the simulationresult.

In[7]:= TransientPlot[tran, V$1[t], V$2[t], t, 0., 2.*^−5]

-65. 10

0.00001 0.000015 0.00002t

-2

-1

1

2

V$2[t]

V$1[t]

Out[7]= Graphics

Perform numericalDC-transfer analysis withNDAESolve.

In[8]:= dctran = NDAESolve[rectifiereqs, t, 0., 1.*^−5,AnalysisMode −> DC]

Out[8]=V$1 InterpolatingFunction0, 0.00001, ,V$2 InterpolatingFunction0, 0.00001, ,I$V0 InterpolatingFunction0, 0.00001, ,I$AC$D1 InterpolatingFunction0, 0.00001,

Display the simulationresult.

In[9]:= TransientPlot[dctran, V$1[t], V$2[t], t, 0., 1.*^−5]

-62. 10

-64. 10

-66. 10

-68. 10

0.00001t

-2

-1

1

2

V$2[t]

V$1[t]

Out[9]= Graphics

Page 303: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.7 Numerical Analyses 301

Perform parametrictransient analysis withNDAESolve.

In[10]:= paramtran = NDAESolve[rectifiereqs, t, 0., 2.*^−5,R1, Table[10^i, i, 0, 3]]

Out[10]=V$2 InterpolatingFunction0, 0.00002, ,V$1 InterpolatingFunction0, 0.00002, ,I$V0 InterpolatingFunction0, 0.00002, ,I$AC$D1 InterpolatingFunction0, 0.00002, ,SweepParameters R1 1.,

V$2 InterpolatingFunction0, 0.00002, ,V$1 InterpolatingFunction0, 0.00002, ,I$V0 InterpolatingFunction0, 0.00002, ,I$AC$D1 InterpolatingFunction0, 0.00002, ,SweepParameters R1 10.,

V$2 InterpolatingFunction0, 0.00002, ,V$1 InterpolatingFunction0, 0.00002, ,I$V0 InterpolatingFunction0, 0.00002, ,I$AC$D1 InterpolatingFunction0, 0.00002, ,SweepParameters R1 100.,

V$2 InterpolatingFunction0, 0.00002, ,V$1 InterpolatingFunction0, 0.00002, ,I$V0 InterpolatingFunction0, 0.00002, ,I$AC$D1 InterpolatingFunction0, 0.00002, ,SweepParameters R1 1000.

By default, TransientPlot displays the solutions for all parameter sweep values within a singleplot.

Display the simulationresult.

In[11]:= TransientPlot[paramtran, V$2[t], t, 0., 2.*^−5]

-65. 10

0.00001 0.000015 0.00002t

0.2

0.4

0.6

0.8

1

1.2

V$2[t]

Out[11]= Graphics

Consider the following oscillator circuit with initial conditions at the time t .

Page 304: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

302 3. Reference Manual

C1 R1Iout

1 2

L1

Vic

Define netlist descriptionof a simple oscillatorcircuit.

In[12]:= oscillator =Netlist[

L1, 0, 1, Symbolic −> L1, Value −> 1.*^−5,C1, 1, 2, Symbolic −> C1, Value −> 3.*^−7,

InitialCondition −> 2.*^−3,R1, 2, 0, Symbolic −> R1, Value −> 1.

]

Out[12]= NetlistRaw, 3

Set up system of symbolictime-domain equationswith initial conditionswhere given in the netlist.

In[13]:= oscillatoreqs1 = CircuitEquations[oscillator,AnalysisMode −> Transient, ElementValues −> Symbolic,InitialConditions −> Automatic];

DisplayForm[oscillatoreqs1]

Out[14]//DisplayForm=

I$L1t C1 V$1 t V$2 t 0,

V$2t

R1 C1 V$1 t V$2 t 0, V$1t L1 I$L1 t 0,

V$10 V$20 0.002, V$1t, V$2t, I$L1t,DesignPoint L1 0.00001, C1 3.107, R1 1.

Set up system of symbolictime-domain equationswith initial conditions forall dynamic netlistelements.

In[15]:= oscillatoreqs2 = CircuitEquations[oscillator,AnalysisMode −> Transient, ElementValues −> Symbolic,InitialConditions −> All];

DisplayForm[oscillatoreqs2]

Out[16]//DisplayForm=

I$L1t C1 V$1 t V$2 t 0,

V$2t

R1 C1 V$1 t V$2 t 0,

V$1t L1 I$L1 t 0, I$L10 0,V$10 V$20 0.002, V$1t, V$2t, I$L1t,DesignPoint L1 0.00001, C1 3.107, R1 1.

Perform numericaltransient analysis for bothequation systems.

In[17]:= tran1 = NDAESolve[oscillatoreqs1, t, 0., 1.*^−4];tran2 = NDAESolve[oscillatoreqs2, t, 0., 1.*^−4];

Page 305: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.7 Numerical Analyses 303

With InitialConditions −> Automatic, initial conditions are applied only where specified in thenetlist, all others are computed consistently. With InitialConditions −> All, initial conditions areset to zero for all elements for which there is no condition specified in the netlist. You can see thedifference between both possibilities in the following two plots.

Display the firstsimulation result.

In[19]:= TransientPlot[tran1, I$L1[t], t, 0., 1.*^−4,PlotRange −> All]

0.00002 0.00004 0.00006 0.00008 0.0001t

-0.002

-0.0015

-0.001

-0.0005

0.0005

0.001

0.0015

I$L1[t]

Out[19]= Graphics

Display the secondsimulation result.

In[20]:= TransientPlot[tran2, I$L1[t], t, 0., 1.*^−4]

0.00002 0.00004 0.00006 0.00008 0.0001t

-0.0003

-0.0002

-0.0001

0.0001

0.0002

I$L1[t]

Out[20]= Graphics

Page 306: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

304 3. Reference Manual

3.8 Pole/Zero Analysis

This chapter describes the Analog Insydes functions for numerical and symbolic pole/zero analysisby solving generalized eigenvalue problems (GEPs). The GEPs considered here have the form

A ΛBu

vHA ΛB

where A and B are real-valued square matrices that arise from decomposing the coefficient matrixof a system of circuit equations Ts x b into the contributions from the static and the dynamicelements.

Ts A sB

In the above GEP, Λ is an eigenvalue, and u and v denote the right and left eigenvectors corre-sponding to Λ (vH denotes the Hermitian conjugate of v). In the following, the pairs Λu andΛ v are referred to as (left and right) eigenpairs of the matrix pencil AB. Analog Insydes includestwo different GEP solvers: an enhanced version of the QZ algorithm and a variant of the Jacobiorthogonal correction method (JOCM).

The following table shows the available Analog Insydes functions for solving GEPs:

GeneralizedEigensystem (Section 3.8.1)computing eigenvalues and eigenvectors by QZ

GeneralizedEigenvalues (Section 3.8.2)computing eigenvalues by QZ

PolesAndZerosByQZ (Section 3.8.3)computing poles and zeros by QZ

PolesByQZ (Section 3.8.4) computing poles by QZ

ZerosByQZ (Section 3.8.5) computing zeros by QZ

RootLocusByQZ (Section 3.8.6) computing root locus by QZ

LREigenpair (Section 3.8.7) computing eigenvalues and eigenvectors by JOCM

Page 307: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 305

3.8.1 GeneralizedEigensystem

GeneralizedEigensystem[A, B]computes the eigenvalues and the corresponding left andright eigenvectors of the matrix pencil AB

Command structure of GeneralizedEigensystem.

GeneralizedEigensytem computes the eigenvalues and the corresponding left and right eigenvec-tors of a matrix pencil AB by the QZ algorithm. The function returns a list of lists of the formlambda, v, u, iter, † † † , where lambda denotes a finite eigenvalue of AB, v and u the corre-sponding left and right eigenvectors, and iter the number of iterations the QZ algorithm needed tocompute lambda.

Note that this function is accessible only if the global Analog Insydes option UseExternals is set toTrue and if a native version of the external MathLink module QZ.exe is available for your machine(see Section 3.13.4).

GeneralizedEigensystem has the following option:

option name default value

Normalize True whether to normalize the eigenvectors

Option for GeneralizedEigensystem.

Unless you specify Normalize −> False, the eigenvectors are scaled such that vi ui .

See also: GeneralizedEigenvalues (Section 3.8.2), UseExternals (Section 3.14.7).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define two squarereal-valued matrices.

In[2]:= A = 1, 2, −3, 1;B = 1, −1, 0, 0;

Compute the eigenvaluesand eigenvectors of AB.

In[4]:= eigsys = GeneralizedEigensystem[A, B]

Out[4]=3.5, 0.5547, 0.83205, 0.316228, 0.948683, 0

Get the eigenvalue andcorrespondingeigenvectors.

In[5]:= lambda, v, u, iter = First[eigsys];

To show that lambda, v, and u are indeed solutions of the GEP within machine precision, we computethe L norms of the residual vectors rv and ru:

Page 308: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

306 3. Reference Manual

rv vHA ΛB

ru A ΛBuCompute the residualnorms.

In[6]:= L2Norm[Conjugate[v].(A − lambda*B)],L2Norm[(A − lambda*B).u]

Out[6]= 4.577571016, 3.295621016

3.8.2 GeneralizedEigenvalues

GeneralizedEigenvalues[A, B]computes the eigenvalues of the matrix pencil AB whereA and B must be real-valued square matrices

Command structure of GeneralizedEigenvalues.

GeneralizedEigenvalues computes the eigenvalues of a matrix pencil AB by the QZ algorithm.The function returns a list of the finite Λi that satisfy the GEP defined by AB.

Note that this function is accessible only if the global Analog Insydes option UseExternals is set toTrue and if a native version of the external MathLink module QZ.exe is available for your machine(see Section 3.13.4).

See also: GeneralizedEigensystem (Section 3.8.1), UseExternals (Section 3.14.7).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define two squarereal-valued matrices.

In[2]:= A = 1, 2, −3, 1;B = 1, 4, 2, 1;

Compute the eigenvaluesof AB.

In[4]:= GeneralizedEigenvalues[A, B]

Out[4]= 0.514618, 1.94319

GeneralizedEigenvalues also works if some or all of the eigenvalues are complex and in the casewhere A or B are singular.

Define two further Bmatrices.

In[5]:= B2 = 1, −5, 2, 1;B3 = 1, −1, 0, 0;

Compute the eigenvaluesof AB.

In[7]:= GeneralizedEigenvalues[A, B2]

Out[7]=0.772727 0.198132 I, 0.772727 0.198132 I

Compute the eigenvaluesof AB.

In[8]:= GeneralizedEigenvalues[A, B3]

Out[8]= 3.5

Page 309: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 307

3.8.3 PolesAndZerosByQZ

PolesAndZerosByQZ[dae, var] calculates the poles of the system described by the ACDAEObject dae and the zeros with respect to var

Command structure of PolesAndZerosByQZ.

To calculate the poles and zeros of a linear circuit, the coefficient matrix of the corresponding systemof circuit equations must be decomposed into a matrix pencil AB. PolesAndZerosByQZ performsthis decomposition and calls GeneralizedEigenvalues to compute the poles and zeros numerically.The argument dae must be an AC DAEObject written in matrix form (see CircuitEquations inSection 3.5.1).

PolesAndZerosByQZ returns a list of rules of the form:

Poles −> poles, Zeros −> zeros

The return value can directly be used as input for RootLocusPlot for visualizing the pole/zerodistribution.

Calculating zeros requires the circuit to be a single-input system, i.e. the circuit must beexcited by a single AC input source.

Note that this function is accessible only if the global Analog Insydes option UseExternals is set toTrue and if a native version of the external MathLink module QZ.exe is available for your machine(see Section 3.13.4).

See also: PolesByQZ (Section 3.8.4), ZerosByQZ (Section 3.8.5), RootLocusPlot (Section 3.9.5),UseExternals (Section 3.14.7).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Read in a PSpice netlistand small-signal data.

In[2]:= buffer = ReadNetlist["AnalogInsydes/DemoFiles/Buffer.cir","AnalogInsydes/DemoFiles/Buffer.out",Simulator −> "PSpice"]

Out[2]= Circuit

Set up a system of ACequations.

In[3]:= mnabuffer = CircuitEquations[buffer, AnalysisMode −> AC]

Out[3]= DAEAC, 1818

Page 310: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

308 3. Reference Manual

Calculate both poles andzeros with respect to theoutput voltage V$99 of thecircuit.

In[4]:= pz = PolesAndZerosByQZ[mnabuffer, V$99]

Out[4]=Poles 1.939451011, 3.519561010, 279586. 2.89305106 I,

279586. 2.89305106 I, 3.20148106, 3.22422106,2.26133109, 1.319551010, 6.86928109, 8.83669109,

Zeros 1.319661010, 7.47584109, 2.26016109,

1.52864106 4.19572106 I, 1.52864106 4.19572106 I,2.98706106, 2.40024106, 1.594151011,2.11541011 4.95934109 I, 2.11541011 4.95934109 I

Show the pole/zerodistribution.

In[5]:= RootLocusPlot[pz, LinearRegionLimit −> Infinity,PlotRange −> 5.0*^6]

Re s

Im s

6-4. 10

6-2. 10

62. 10

64. 10

6-4. 10

6-2. 10

62. 10

64. 10

Out[5]= Graphics

3.8.4 PolesByQZ

PolesByQZ[dae] calculates the poles of the dynamic system described bythe AC DAEObject dae

Command structure of PolesByQZ.

To calculate the poles of a linear circuit, the coefficient matrix of the corresponding system of circuitequations must be decomposed into a matrix pencil AB. PolesByQZ performs this decompositionand calls GeneralizedEigenvalues to compute the poles numerically. The argument dae must bean AC DAEObject written in matrix form (see CircuitEquations in Section 3.5.1).

Note that this function is accessible only if the global Analog Insydes option UseExternals is set toTrue and if a native version of the external MathLink module QZ.exe is available for your machine(see Section 3.13.4).

See also: PolesAndZerosByQZ (Section 3.8.3), ZerosByQZ (Section 3.8.5),UseExternals (Section 3.14.7).

Page 311: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 309

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Read in a PSpice netlistand small-signal data.

In[2]:= buffer = ReadNetlist["AnalogInsydes/DemoFiles/Buffer.cir","AnalogInsydes/DemoFiles/Buffer.out",Simulator −> "PSpice"]

Out[2]= Circuit

Set up a system of ACequations.

In[3]:= mnabuffer = CircuitEquations[buffer, AnalysisMode −> AC]

Out[3]= DAEAC, 1818

Calculate the poles of thecircuit.

In[4]:= PolesByQZ[mnabuffer]

Out[4]=1.939451011, 3.519561010, 279586. 2.89305106 I,

279586. 2.89305106 I, 3.20148106, 3.22422106,2.26133109, 1.319551010, 6.86928109, 8.83669109

3.8.5 ZerosByQZ

ZerosByQZ[dae, var] calculates the zeros of the transfer function from the ACDAEObject dae to the output variable var

Command structure of ZerosByQZ.

To calculate the zeros of a linear circuit, the coefficient matrix of the corresponding system of circuitequations must be decomposed into a matrix pencil AB. ZerosByQZ performs this decompositionand calls GeneralizedEigenvalues to compute the zeros numerically. The argument dae must bean AC DAEObject written in matrix form (see CircuitEquations in Section 3.5.1).

Calculating zeros requires the circuit to be a single-input system, i.e. the circuit must beexcited by a single AC input source.

Note that this function is accessible only if the global Analog Insydes option UseExternals is set toTrue and if a native version of the external MathLink module QZ.exe is available for your machine(see Section 3.13.4).

See also: PolesAndZerosByQZ (Section 3.8.3), PolesByQZ (Section 3.8.4),UseExternals (Section 3.14.7).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 312: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

310 3. Reference Manual

Read in a PSpice netlistand small-signal data.

In[2]:= buffer = ReadNetlist["AnalogInsydes/DemoFiles/Buffer.cir","AnalogInsydes/DemoFiles/Buffer.out",Simulator −> "PSpice"]

Out[2]= Circuit

Set up a system of ACequations.

In[3]:= mnabuffer = CircuitEquations[buffer, AnalysisMode −> AC]

Out[3]= DAEAC, 1818

Calculate the zeros of thecircuit with respect to theoutput voltage V$99.

In[4]:= ZerosByQZ[mnabuffer, V$99]

Out[4]=1.319661010, 7.47584109, 2.26016109,

1.52864106 4.19572106 I, 1.52864106 4.19572106 I,2.98706106, 2.40024106, 1.594151011,2.11541011 4.95934109 I, 2.11541011 4.95934109 I

3.8.6 RootLocusByQZ

RootLocusByQZ[dae, var, k, k, k, incr]calculates the root locus of the AC DAEObject dae as theparameter k is swept from k to k in steps of incr; zerosare calculated with respect to the output variable var

Command structure of RootLocusByQZ.

With RootLocusByQZ you can sweep a parameter of a linear system over an interval and calculate theroot locus of the system directly from the corresponding circuit equations using the QZ algorithm.The argument dae has to be an AC DAEObject written in matrix form (see CircuitEquations inSection 3.5.1).

RootLocusByQZ returns data in the following form:

Poles −> poles, Zeros −> zeros,SweepParameters −> k −> k0,

The return value can directly be used as input for RootLocusPlot for visualizing the root locus.

Note that this function is accessible only if the global Analog Insydes option UseExternals is set toTrue and if a native version of the external MathLink module QZ.exe is available for your machine(see Section 3.13.4).

RootLocusByQZ has the following option:

Page 313: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 311

option name default value

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Option for RootLocusByQZ.

See also: PolesAndZerosByQZ (Section 3.8.3), RootLocusPlot (Section 3.9.5), UseExternals (Sec-tion 3.14.7).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Read in a PSpice netlistand small-signal data.

In[2]:= buffer = ReadNetlist["AnalogInsydes/DemoFiles/Buffer.cir","AnalogInsydes/DemoFiles/Buffer.out",Simulator −> "PSpice"]

Out[2]= Circuit

Set up system of symbolicAC equations.

In[3]:= mnabuffersym = CircuitEquations[buffer,AnalysisMode −> AC, ElementValues −> Symbolic]

Out[3]= DAEAC, 1818

Get the design-point valueof Cbc$Q$T5.

In[4]:= Cbc$Q$T5 /. GetDesignPoint[mnabuffersym]

Out[4]= 8.391012

Calculate root locus of thecircuit as Cbc$Q$T5 isvaried from pF to pFin steps of pF.

In[5]:= rloc = RootLocusByQZ[mnabuffersym, V$99,Cbc$Q$T5, 5.0*^−12, 50.0*^−12, 5.0*^−12];

Page 314: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

312 3. Reference Manual

Show the root locus. In[6]:= RootLocusPlot[rloc, LinearRegionLimit −> Infinity,PlotRange −> 5.0*^6]

Cbc$Q$T5 = 5.000e-12 .. 5.000e-11 (0% .. 100%)

Re s

Im s

6-4. 10

6-2. 10

62. 10

64. 10

6-4. 10

6-2. 10

62. 10

64. 10

100

0%Poles

100

0%Zeros

Out[6]= Graphics

3.8.7 LREigenpair

LREigenpair[A, B, theta0] solves the GEP described by the matrix pencil AB for aneigenvalue Λ near the initial guess theta0 where A and Bmust be real-valued square matrices of equal dimensions

LREigenpair[dae, theta0] solves the GEP defined by the coefficient matrix of the ACDAEObject dae for an eigenvalue Λ near theta0

Command structure of LREigenpair.

As an alternative to the QZ algorithm, Analog Insydes provides the function LREigenpair for solvingGEPs iteratively using a variant of the Jacobi orthogonal correction method. This approach is more effi-cient and reliable than the QZ algorithm for large GEPs when only one single eigenvalue is sought.In addition to the eigenvalue, LREigenpair also yields the corresponding left and right eigenvectors.The argument dae has to be an AC DAEObject written in matrix form (see CircuitEquations inSection 3.5.1).

If the target eigenvalue is complex, the initial guess theta0 must also be a complex number.

LREigenpair returns a list of the form lambda, v, u, rv, ru, iter, where lambda, v, and u denotethe calculated eigenvalue and eigenvectors, rv and ru the corresponding L norms of the residualvectors

Page 315: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 313

rv vHA ΛB

ru A ΛBu

The last return value, iter, denotes the number of iterations needed to compute lambda with thedesired accuracy.

LREigenpair has the following options:

option name default value

AccuracyGoal Round[0.5*$MachinePrecision]the accuracy goal for the sought eigenvalue

DesignPoint Automatic the design-point values for the coefficientsof dae

FrequencyVariable Automatic the name of the variable that represents thecomplex frequency in dae

InitialGuess Automatic initial guesses for the left and righteigenvectors

MaxIterations 60 the maximum number of iterations for theJacobi orthogonal correction method

Options for LREigenpair, Part I.

Page 316: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

314 3. Reference Manual

option name default value

MaxResidual Automatic the maximum L norm of the residualvectors rv and ru

Prescaling True whether to prescale the rows of the matrixpencil

ProjectionVectors LeftEigenvector, RightEigenvectorthe projection vectors used by the Jacobiorthogonal correction method

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Tolerance Infinity the maximum logarithmic distance betweenthe initial guess theta0 and the calculatedeigenvalue Λ

Options for LREigenpair, Part II.

See also: GeneralizedEigensystem (Section 3.8.1).

Options Description

A detailed description of all LREigenpair options is given below in alphabetical order:

AccuracyGoal

AccuracyGoal −> n specifies the desired accuracy of the sought eigenvalue in terms of the numberof accurate significant digits. The value of AccuracyGoal is used to determine an appropriate settingfor the MaxResidual option if MaxResidual −> Automatic.

DesignPoint

With DesignPoint −> dp, you can specify a list of design-point values for the coefficients ofa symbolic system of circuit equations. The default setting DesignPoint −> Automatic causesLREigenpair to use the design-point information stored in dae. You can use the DesignPointoption to override design-point data stored in dae.

FrequencyVariable

LREigenpair needs to know the symbol which represents the complex frequency in order tobe able to decompose the system of circuit equations dae into the matrices A and B. With

Page 317: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 315

FrequencyVariable −> Automatic, the symbol is determined automatically from the status informa-tion stored in dae. You can specify the frequency variable manually with FrequencyVariable −> var.

InitialGuess

With InitialGuess −> v0, u0, you can specify initial guesses for the sought eigenvectors v and u.Both v0 and u0 must be real or complex-valued numeric vectors whose dimensions are compatiblewith dae.

MaxIterations

MaxIterations −> n specifies the maximum number of orthogonal correction iterations LREigenpairshould use in order to find an eigenvalue and the corresponding eigenvectors. If LREigenpair failsto find solutions which satisfy the MaxResidual specification within n iterations, a warning isgenerated and the most recent iterates are returned.

MaxResidual

With MaxResidual −> maxres, you can set the convergence criterion for LREigenpair. The valuemaxres denotes the maximum L norm the residual vectors rv and ru may have such that the currentset of iterates can be regarded as valid approximations of the sought eigenpairs. LREigenpair stopsiterating as soon as both rv and ru fall below maxres.

With the default setting MaxResidual −> Automatic, the maximum residual norm is computed as

maxres AccuracyGoal /*/ B A Note that the value of maxres depends on the setting of the Prescaling option because the normsof A and B are computed after prescaling.

Prescaling

With Prescaling −> True, LREigenpair scales the rows of the matrix pencil AB such that the ab-solute value of the largest coefficient in each row is 1. In general, prescaling improves the numericalproperties of ill-conditioned GEPs and helps to reduce the number of iterations. Prescaling does notchange the eigenvalues and eigenvectors of the matrix pencil. You can turn off prescaling by settingPrescaling −> False.

ProjectionVectors

Starting with a given initial guess * vu for the sought eigenvalue and eigenvectors, LREigenpairrepeatedly solves the correction equation

Page 318: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

316 3. Reference Manual

A *iB w

yH

z

r

for updates z of u and v. The symbols w and y denote two arbitrary projection vectors, whichmust be chosen appropriately in each step to ensure convergence of the iterates. Suitable choicesfor w and y include combinations of the initial guesses and the most recent approximations of theeigenvectors v and u.

With the option ProjectionVectors −> wt, yt, you can choose the vectors LREigenpair uses asprojection vectors. Possible values are:

LeftEigenvector the most recent approximation of the left eigenvector v

RightEigenvector the most recent approximation of the right eigenvector u

InitialLeftEigenvector the initial guess v for the left eigenvector

InitialRightEigenvector the initial guess u for the right eigenvector

Values for the ProjectionVectors option.

In most cases, the default setting ProjectionVectors −> LeftEigenvector, RightEigenvectorconstitutes an appropriate choice. You will need to change the setting of this option only if youencounter convergence problems.

Tolerance

Tolerance −> tol specifies the radius of the tolerance region around the initial guess theta0 in whichthe sought eigenvalue Λ should lie. LREigenpair generates a warning if it converges to an eigen-value that lies outside the tolerance region. The Tolerance option allows you to check whetherLREigenpair has found the eigenvalue you wished to compute or whether the iterations haveconverged to a completely different solution.

Tolerance uses a logarithmic measure for distances. For example, Tolerance −> 1.0 allows thevalue of the solution Λ to lie within and times the value of the initial guess theta0.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define three squarereal-valued matrices.

In[2]:= A = 1, 2, −3, 1;B = 1, 4, 2, 1;B2 = 1, −1, 0, 0;

Solve the GEP ABiteratively using the initialguess theta .

In[5]:= LREigenpair[A, B2, −3.0]

Out[5]=3.5, 0.5547, 0.83205, 0.316228, 0.948683, 9.485751016,

1.176571015, 5

Page 319: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 317

Solve the GEP AB.Specify initial guesses forthe eigenvectors.

In[6]:= LREigenpair[A, B, −1., InitialGuess −> 0, 1, 1, 0]

Out[6]=1.94319, 0.288369, 0.957519, 0.957519, 0.288369,5.052071010, 8.702171010, 4

Use the default projectionvectors.

In[7]:= LREigenpair[A, B, 1., MaxResidual −> 1.*^−15]

Out[7]=0.514618, 0.992822, 0.1196, 0.1196, 0.992822,2.237731016, 2.482531016, 4

Note that the following setting for ProjectionVectors increases the number of iterations.

Use right eigenvectors asprojection vectors.

In[8]:= LREigenpair[A, B, 1., MaxResidual −> 1.*^−15,ProjectionVectors −>

RightEigenvector, RightEigenvector]

Out[8]=0.514618, 0.992822, 0.1196, 0.1196, 0.992822, 0.,4.041271016, 5

The setting Tolerance −> 1.0 allows the value of the solution Λ to lie within and times thevalue of the initial guess theta0.

Search for an eigenvaluein the interval

In[9]:= LREigenpair[A, B, −100., Tolerance −> 1.]

LREigenpair::tolx:Eigenvalue lies outside the specified tolerance region.

Out[9]=1.94319, 0.288369, 0.957519, 0.957519, 0.288369,2.708951011, 4.665221011, 6

With the default setting Tolerance −> Infinity, any solution of the GEP is accepted without awarning.

Do not specify a toleranceregion.

In[10]:= LREigenpair[A, B, −100., Tolerance −> Infinity]

Out[10]=1.94319, 0.288369, 0.957519, 0.957519, 0.288369,2.708951011, 4.665221011, 6

Read in a PSpice netlistand small-signal data.

In[11]:= buffer = ReadNetlist["AnalogInsydes/DemoFiles/Buffer.cir","AnalogInsydes/DemoFiles/Buffer.out",Simulator −> "PSpice"]

Out[11]= Circuit

Set up a system ofsymbolic AC equations.

In[12]:= mnabuffersym = CircuitEquations[buffer,AnalysisMode −> AC, ElementValues −> Symbolic]

Out[12]= DAEAC, 1818

Page 320: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

318 3. Reference Manual

Find the pole of the buffercircuit neartheta i and thecorresponding left andright eigenvectors.

In[13]:= lreigenpairs = LREigenpair[mnabuffersym, 3.0*^6 I]

Out[13]=279586. 2.89305106 I,

1.700561018 2.185821018 I, 0.101704 0.218124 I,0.0281952 0.414952 I, 0.175266 0.0104981 I,1.701111018 2.185821018 I, 0.177763 0.0195432 I,0.000145936 0.000121065 I, 0.177854 0.0196025 I,0.175419 0.0103065 I, 0.175107 0.0106381 I,0.0284306 0.414988 I, 0.0281891 0.414953 I,0.175267 0.0105033 I, 0.0281827 0.414949 I,0.175266 0.0104982 I, 0.177756 0.019539 I,0.0000145936 0.0000121065 I, 0.0000145936 0.0000121065 I,

9.512371019 4.503661019 I, 0.055128 0.256781 I,0.108991 0.0369544 I, 0.0952012 0.0116717 I,9.514931019 4.503491019 I, 0.109187 0.515199 I,0.000239817 0.0000548798 I, 0.108876 0.515278 I,0.0952466 0.0115085 I, 0.0952183 0.0115916 I,0.10892 0.0367968 I, 0.108987 0.0369774 I,0.0952038 0.0116972 I, 0.109 0.0369492 I,0.0951948 0.011671 I, 0.109209 0.515193 I,0.0000239817 5.48798106 I, 0.0000239817 5.48798106 I,3.619271013, 6.030571012, 4

Show the eigenvalue. In[14]:= lreigenpairs[[1, 1]]

Out[14]= 279586. 2.89305106 I

Compare the eigenvaluewith the result of the QZalgorithm.

In[15]:= Cases[PolesByQZ[mnabuffersym], _Complex]

Out[15]=279586. 2.89305106 I, 279586. 2.89305106 I

3.8.8 ApproximateDeterminant

ApproximateDeterminant[dae, lambda, error]approximates the equations dae with respect to the poleclosest to the initial guess lambda where dae has to be anAC DAEObject and error has to be a positive real value

ApproximateDeterminant[dae, zvar, lambda, error]approximates the equations dae with respect to the zero ofthe transfer function from the input signal to the outputzvar

Command structure of ApproximateDeterminant.

With ApproximateDeterminant you can approximate a linear symbolic matrix equation Ts x bdirectly with respect to a particular eigenvalue Λ (a pole or a zero). By discarding all terms whichhave little or no influence on Λ, ApproximateDeterminant reduces both the complexity and thedegree of the characteristic polynomial Ps det Ts. Provided that the eigenvalue of interest islocated sufficiently far apart from other eigenvalues, the polynomial degree can be reduced to if Λ

Page 321: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 319

is real or if Λ is complex. The argument dae must be an AC DAEObject written in matrix form (seeCircuitEquations in Section 3.5.1).

The following options can be used with ApproximateDeterminant :

option name default value

AccuracyGoal Round[0.5*$MachinePrecision]the desired numerical accuracy of numericalcomputations

DesignPoint Automatic the design-point values for the coefficientsof dae

ErrorFunction Automatic the function to be used for calculating theapproximation error

FrequencyVariable Automatic the symbol which denotes the complexLaplace frequency

GEPSolver LREigenpair the GEP solver to be used for calculatingthe initial reference solution

GEPSolverOptions Automatic options which are passed to the GEP solver

Options for ApproximateDeterminant, Part I.

Page 322: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

320 3. Reference Manual

option name default value

InitialSolution Automatic the initial reference solution

MaxDivergentSteps 1 the maximum number of divergentiterations allowed in the error trackingprocess

MaxIterations 3 the maximum number of eigenvaluecorrection iterations allowed in each errortracking step

MaxResidual Automatic the convergence criterion for the errortracking iterations

MaxShift 1.0 the maximum relative eigenvalue sensitivitya matrix entry may have to be consideredas a candidate for removal

MinMAC 0.95 the minimum MAC value between theoriginal eigenvector and the correspondingeigenvector of the approximated system

Options for ApproximateDeterminant, Part II.

Page 323: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 321

option name default value

Prescaling True whether to prescale the rows of the matrixpencil

ProjectionVectors LeftEigenvector, RightEigenvectorthe projection vectors used by the Jacobiorthogonal correction method

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

SingularityTest SingularityTestByLUthe function used to determine whether anapproximated matrix is singular

TestFrequency 1. the frequency or point in the complex planeat which singularity tests are performed

Tolerance 0.05 the maximum logarithmic distance betweenthe initial guess and the calculatedeigenvalue Λ

Options for ApproximateDeterminant, Part III.

See also: GeneralizedEigensystem (Section 3.8.1), LREigenpair (Section 3.8.7).

Options Description

A detailed description of all ApproximateDeterminant options is given below in alphabetical order:

AccuracyGoal

AccuracyGoal −> n specifies the desired accuracy of the sought eigenvalue in terms of the numberof accurate significant digits. The value of AccuracyGoal is used to determine an appropriate settingfor the MaxResidual option if MaxResidual −> Automatic. See also LREigenpair (Section 3.8.7).

DesignPoint

With DesignPoint −> dp, you can specify a list of design-point values for the coefficients ofa symbolic system of circuit equations. The default setting DesignPoint −> Automatic causesApproximateDeterminant to use the design-point information stored in dae. You can use theDesignPoint option to override design-point data stored in dae.

Page 324: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

322 3. Reference Manual

ErrorFunction

ErrorFunction −> func specifies the function to be used for calculating the error of an approximatedeigenvalue with respect to the reference solution. The following values are allowed:

Automatic select the error function according to the properties of theeigenvalue of interest: use LogError for real eigenvaluesand DirectedLogError for complex ones

LogError yields the logarithmic difference of the magnitudes of twoeigenvalues; most suitable for real eigenvalues

DirectedLogError similar to LogError, but takes into account the phases ofcomplex numbers; most suitable for complex eigenvalues

Values for the ErrorFunction option.

FrequencyVariable

ApproximateDeterminant needs to know the symbol which represents the complex frequency inorder to be able to decompose the system of circuit equations dae into the matrices A and B. WithFrequencyVariable −> Automatic, the symbol is determined automatically from the status informa-tion stored in dae. You can specify the frequency variable manually with FrequencyVariable −> var.

GEPSolver

With GEPSolver −> func, you can select the GEP solver ApproximateDeterminant uses to calculatethe initial reference solution. Possible option values are:

GeneralizedEigensystem use the QZ algorithm for computing the reference solution

LREigenpair use the Jacobi orthogonal correction method for computingthe reference solution

Values for the GEPSolver option.

GEPSolverOptions

With GEPSolverOptions −> opts, you can specify a list of option settings that will be passed to theselected GEP solver, for example:

GEPSolverOptions −> MaxResidual −> 1.*^−7,MaxIterations −> 100

Page 325: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 323

Note that you may also change the option settings of the selected GEP solver directly withSetOptions[gepsolver, opts]. However, with GEPSolverOptions, you can specify private optionsettings which will only be used in conjunction with ApproximateDeterminant.

InitialSolution

With InitialSolution −> initsol, you can specify the initial reference solution for the GEP to beapproximated. The value of InitialSolution must be given in the same format as the return valueof LREigenpair (Section 3.8.7). Possible values are:

Automatic compute the initial reference solution using the GEP solverspecified with GEPSolver

lambda, v, u, † † † use the given initial reference solution

Values for the InitialSolution option.

MaxDivergentSteps

MaxDivergentSteps −> n specifies the maximum number of divergent iterations allowed in the er-ror tracking step following the elimination of a matrix entry. Iterates are considered divergent ifthe residual of the numerical solution of the GEP becomes larger between two consecutive steps.If the number of divergent steps exceeds the specified maximum in the error tracking process,ApproximateDeterminant aborts the iterations, reinserts the current term into the matrix, andcontinues with the next term.

MaxIterations

MaxIterations −> n specifies the maximum number of error tracking iterations performed afterremoving a matrix entry. An approximation is considered valid if the iterations converge withinn steps, and if both the MaxResidual and MinMAC specifications are satisfied. See also LREigenpair(Section 3.8.7).

If you set GEPSolver −> LREigenpair, note that the MaxIterations setting given forApproximateDeterminant is not passed to LREigenpair. To specify the maximum numberof iterations for the GEP solver, change the value of GEPSolverOptions.

MaxResidual

MaxResidual −> posreal specifies the convergence criterion for the error tracking iterations.MaxResidual is one of the key options you should play with in order to obtain good results fromApproximateDeterminant . You should choose the value as large as possible to allow for a reason-

Page 326: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

324 3. Reference Manual

able error but small enough to prevent the iterations from “converging” to an arbitrary value. Thismay require some experimentation. See also LREigenpair (Section 3.8.7).

The value of MaxResidual depends on the setting of the Prescaling option.

If you set GEPSolver −> LREigenpair, note that the MaxIterations setting given forApproximateDeterminant is not passed to LREigenpair. To specify the maximum residualfor the GEP solver, change the value of GEPSolverOptions.

MaxShift

MaxShift −> posreal restricts the list of matrix entries which are candidates for removal to thoseentries with a eigenvalue sensitivity figure less than posreal. With MaxShift −> 1.0, a term will beconsidered for removal if the eigenvalue shift caused by removing the term has been predicted to beless than . To restrict the list of matrix entries to terms with small eigenvalue sensitivities, usea setting such as MaxShift −> 0.1.

MinMAC

MinMAC −> posreal specifies the minimum allowed value of the modal assurance criterion between theright eigenvector of the original GEP, u, and the right eigenvector of the approximated GEP, u+.The MAC between u and u+ constitutes a measure for the correlation of the two eigenvectors. It isdefined as

MAC uu+ uHu+

uHu u+Hu+

The value of the MAC ranges from to . A value of means that one eigenvector is a multiple ofthe other. A value of means that the two vectors are completely uncorrelated.

The use of the MAC helps to prevent ApproximateDeterminant from accidentally converging tosome other eigenvalue than the one of interest. For corresponding eigenpairs of the original andapproximated GEP, the value of the MAC should be close to , say MAC , whereas the MACbetween the eigenvector of the original GEP and some other eigenvector of the approximated systemshould be small. ApproximateDeterminant considers an approximation step as invalid if the MACbetween the two eigenvectors falls below the value of MinMAC.

Prescaling

With Prescaling −> True, ApproximateDeterminant scales the rows of the matrix pencil ABsuch that the absolute value of the largest coefficient in each row is 1. In general, prescaling im-proves the numerical properties of ill-conditioned GEPs and helps to reduce the number of iterations.

Page 327: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 325

Prescaling does not change the eigenvalues and eigenvectors of the matrix pencil. You can turn offprescaling by setting Prescaling −> False.

The value of Prescaling has an influence on the required setting of the MaxResidualoption.

If you set GEPSolver −> LREigenpair, note that the Prescaling setting given forApproximateDeterminant is not passed to LREigenpair. To turn on prescaling for the GEPsolver, change the value of GEPSolverOptions.

ProjectionVectors

With the option ProjectionVectors −> wt, yt, you can choose the vectorsApproximateDeterminant uses as projection vectors for the Jacobi orthogonal correction method(JOCM) during error tracking operations:

Starting with a given initial guess * vu for the sought eigenvalue and eigenvectors, the JOCMrepeatedly solves the correction equation

A *iB w

yH

z

r

for updates z of u and v. The symbols w and y denote two arbitrary projection vectors, whichmust be chosen appropriately in each step to ensure convergence of the iterates. Suitable choicesfor w and y include combinations of the initial guesses and the most recent approximations of theeigenvectors v and u.

Possible settings for the ProjectionVectors option are:

LeftEigenvector the most recent approximation of the left eigenvector v

RightEigenvector the most recent approximation of the right eigenvector u

InitialLeftEigenvector the initial guess v for the left eigenvector

InitialRightEigenvector the initial guess u for the right eigenvector

Values for the ProjectionVectors option.

In most cases, the default setting ProjectionVectors −> LeftEigenvector, RightEigenvectorconstitutes an appropriate choice. You will need to change the setting of this option only if youencounter convergence problems. See also Section 3.8.7.

Page 328: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

326 3. Reference Manual

If you set GEPSolver −> LREigenpair, note that the ProjectionVectors setting given forApproximateDeterminant is not passed to LREigenpair. To choose the projection vectorsfor the GEP solver, change the value of GEPSolverOptions.

SingularityTest

After each approximation step, ApproximateDeterminant applies a singularity test to the matrixA s B to ensure that removing a matrix entry has not rendered the GEP singular. The singularitytest is performed by numerical computation of the rank of A s B for some s " C which is notan eigenvalue of the GEP. However, there is no guarantee that numerical rank computation alwaysyields a mathematically correct result. This may cause singularity to remain undetected in somesituations, particularly when the GEP is ill-conditioned. With the option SingularityTest, youcan select the function ApproximateDeterminant uses to determine whether the GEP is singular. Ifyou encounter singularity problems, i.e. if detA s B after approximating a system of circuitequations, then you should change the value of SingularityTest and rerun the approximation.

The possible values for SingularityTest are:

SingularityTestByLU perform singularity tests by rank computation usingLUDecomposition

SingularityTestByQR perform singularity tests by rank computation usingQRDecomposition

Function[M, expr] specify a user-defined function which returns True if thecomplex-valued floating-point matrix M is singular

Values for the SingularityTest option.

TestFrequency

With the option TestFrequency, you can specify the value of the complex frequency variable s whichis used for testing whether the numerical matrix A s B is singular. For best numerical accuracy andcomputing performance, it is recommended that you choose a real value of the same order of magni-tude as the modulus of the target eigenvalue. For example, if you wish to approximate a GEP withrespect to an eigenvalue s j , then the option setting TestFrequency −> 1.0*^8constitutes an appropriate choice.

The point in the complex plane represented by the value of TestFrequency should not liein the neighborhood of any eigenvalue of the GEP to be approximated. An inappropriatechoice of the test frequency may result in ill-conditioned rank computation problems.

Page 329: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 327

Tolerance

Tolerance −> tol specifies the radius of the tolerance region around the initial guess theta0 in whichthe sought eigenvalue Λ should lie. ApproximateDeterminant generates a warning if it convergesto an eigenvalue that lies outside the tolerance region. The Tolerance option allows you to checkwhether ApproximateDeterminant has found the eigenvalue you wished to compute or whetherthe iterations have converged to a completely different solution.

Tolerance uses a logarithmic measure for distances. For example, Tolerance −> 1.0 allows thevalue of the solution Λ to lie within and times the value of the initial guess theta0.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define an AC model forBJTs.

In[2]:= Circuit[Model[

Name −> BJT,Selector −> AC,Scope −> Global,Ports −> B, C, E,Parameters −> Rbe, Cbc, Cbe, beta, Ro,

RBE, CBC, CBE, BETA, RO,Definition −> Netlist[

CBE, B, E, Symbolic −> Cbe, Value −> CBE,RBE, X, E, Symbolic −> Rbe, Value −> RBE,CBC, B, C, Symbolic −> Cbc, Value −> CBC,CC, B, X, C, E,

Symbolic −> beta, Value −> BETA,RO, C, E, Symbolic −> Ro, Value −> RO

]]

] // ExpandSubcircuits;

This netlist describes acommon-emitter amplifier.

In[3]:= ceamplifier =Circuit[

Netlist[V1, 1, 0, 1,V0, 6, 0, 0,C1, 1, 2, Symbolic −> C1, Value −> 1.0*^−7,R1, 2, 6, Symbolic −> R1, Value −> 1.0*^5,R2, 2, 0, Symbolic −> R2, Value −> 47000.,RC, 6, 3, Symbolic −> RC, Value −> 2200.,RE, 4, 0, Symbolic −> RE, Value −> 1000.,C2, 3, 5, Symbolic −> C2, Value −> 1.0*^−6,RL, 5, 0, Symbolic −> RL, Value −> 47000.,Q1, 2 −> B, 3 −> C, 4 −> E,

Model −> BJT, Selector −> AC,CBE −> 30.*^−12, CBC −> 5.*^−12, RBE −> 1000.,RO −> 10000., BETA −> 200.

]]

Out[3]= Circuit

Page 330: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

328 3. Reference Manual

Set up system of symbolicAC equations.

In[4]:= eqs = CircuitEquations[ceamplifier,ElementValues −> Symbolic]

Out[4]= DAEAC, 1010

Calculate poles and zerosof the voltage transferfunction.

In[5]:= pz = PolesAndZerosByQZ[eqs, V$5]

Out[5]=Poles 20.4778, 375.176, 9.50936107, 6.75675109,Zeros 0., 1.355691027, 1.91793108, 6.94846109

Show the pole/zerodistribution.

In[6]:= RootLocusPlot[pz, LinearRegionLimit −> 100,PlotRange −> 5.0*^10]

Re s

Im s

-1.0E5-1.0E8 -100. 100. 1.0E5 1.0E8

-1.0E5

-1.0E8

-100.

100.

1.0E5

1.0E8

Out[6]= Graphics

The numerical pole/zero analysis shows that the characteristic polynomial of the equations has adegree of four because the amplifier has four poles. Although polynomial equations with a degreeup to four can be solved analytically, the resulting expressions are usually very complex if the degreeis greater than two. Therefore, we use ApproximateDeterminant to compute simplified formulasfor the poles.

We begin by computing an approximate expression for the pole near s . The logarithmic errorbound specification corresponds to a tolerance region from to of thedesign-point value p .

Approximate the equationswith respect to p usingthe QZ algorithm forcomputing the referencesolution.

In[7]:= sbgp2 = ApproximateDeterminant[eqs, −400, 0.05,MaxIterations −> 4, GEPSolver −> GeneralizedEigensystem]

Out[7]= DAEAC, 1010

To check if the algorithm has successfully isolated the pole of interest, we compute the poles of theapproximated system.

Compute the remainingpoles numerically.

In[8]:= PolesByQZ[sbgp2]

Out[8]= 0., 362.766

Estimate the number ofremaining terms.

In[9]:= ComplexityEstimate[sbgp2]

Out[9]= 4

Page 331: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.8 Pole/Zero Analysis 329

Show complexity oforiginal system.

In[10]:= ComplexityEstimate[eqs]

Out[10]= 132

The result shows that the algorithm has eliminated the two high-frequency poles and has approx-imated the low-frequency pole p near s by zero. On the contrary, the pole p has beenpreserved, and its numerical value lies in the specified tolerance region. In addition, the complexityof the characteristic polynomial has been greatly reduced. Therefore, we can expect to obtain aninterpretable formula for p.

Compute theapproximatedcharacteristic polynomial.

In[11]:= detp2 = Det[GetMatrix[sbgp2]] // Together

Out[11]=C2 R1 R2 s

beta$Q1 C2 R1 RE s beta$Q1 C2 R2 RE s beta$Q1 C1 C2 R1 R2 RE s2 R1 R2 Rbe$Q1 RC RE

Solve for the poles. In[12]:= sbgpoles = Solve[detp2 == 0, s]

Out[12]=

s 0, s R1 R2 beta$Q1 R1 RE beta$Q1 R2 RE

beta$Q1 C1 R1 R2 RE

Extract the pole of interest. In[13]:= p2 = s /. Last[sbgpoles] // Simplify

Out[13]= 1R1 1R2 1beta$Q1 RE

C1

Next, we try to extract the right-half plane zero z near s .

Approximate the equationswith respect to z.

In[14]:= sbgz3 = ApproximateDeterminant[eqs, V$5, 2.0*^8, 0.05,GEPSolver −> GeneralizedEigensystem]

Out[14]= DAEAC, 1010

Compute the remainingzeros numerically.

In[15]:= ZerosByQZ[sbgz3, V$5]

Out[15]= 0., 0., 2.108

Compute theapproximated polynomial.

In[16]:= detz3 = Det[GetMatrix[sbgz3]] // Simplify

Out[16]=beta$Q1 C1 C2 s2 1 Cbc$Q1 RE s

Rbe$Q1 RE

Solve for the zeros. In[17]:= sbgzeros = Solve[detz3 == 0, s]

Out[17]= s 0, s 0, s 1

Cbc$Q1 RE

Extract the zero of interest. In[18]:= z3 = s /. Last[sbgzeros]

Out[18]=1

Cbc$Q1 RE

Page 332: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

330 3. Reference Manual

3.9 Graphics Functions

Analog Insydes extends Mathematica’s graphics functionality by several custom functions for pro-ducing frequently used graphs in circuit design. The package provides special functionality fordisplaying the following types of plots:

BodePlot (Section 3.9.1) Bode plot (frequency response: magnitude and phase vs.frequency)

FourierPlot (Section 3.9.2) Fourier spectrum plot (frequency spectrum: spectralmagnitude vs. frequency)

NicholPlot (Section 3.9.3) Nichol plot (frequency response: gain vs. phase)

NyquistPlot (Section 3.9.4) Nyquist plot (frequency response: imaginary vs. real part)

RootLocusPlot (Section 3.9.5) pole/zero and root locus plot (parameter response:imaginary vs. real part)

TransientPlot (Section 3.9.6) transient waveform plot (signal value vs. time)

3.9.1 BodePlot

BodePlot[func, var, f, f] displays a Bode plot of the transfer function func[var] asthe independent variable var is swept from f to f

BodePlot[func, func, † † † , var, f, f]displays the transfer functions func, func, † † †simultaneously in a Bode plot

Command structure of BodePlot.

BodePlot displays one or several transfer functions in a Bode plot. A Bode plot consists of twoseparate charts in which the magnitude and phase of a transfer function are plotted vs. frequency.Magnitude and phase are displayed, respectively, on logarithmic and linear scales. The frequencyaxis is scaled logarithmically for both charts.

Note that BodePlot has attribute HoldFirst.

BodePlot supports additional patterns for displaying numerical data generated with the func-tions ACAnalysis (Section 3.7.3), NoiseAnalysis (Section 3.7.4), or ReadSimulationData (Sec-tion 3.10.3):

Page 333: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 331

BodePlot[traces, var, f, f] displays a list of AC traces computed with e.g.ACAnalysis in a Bode plot

BodePlot[traces, expr, var, f, f]displays the value of an expression in terms of AC traces

BodePlot[traces, expr, expr, † † † , var, f, f]displays the values of several expressions

Displaying numerical data with BodePlot.

You can customize the appearance of Bode plots with the options listed below. In addition, BodePlotinherits many options from LogLinearListPlot and Legend. Both the options which are specific toBodePlot as well as the inherited options can be set with SetOptions[BodePlot, opts].

option name default value

AspectRatio 0.75 the aspect ratio of the whole plot

AspectFactor 0.8 a correction factor by which the aspectratios of the magnitude and phase plots aremultiplied so as to fill the individual plotareas optimally

FrequencyScaling Exponential whether to distribute sampling pointsexponentially or linearly along thefrequency axis

GraphicsSpacing 0.05 the distance between the magnitude and thephase plot in percent of the total plot height

MagnitudeDisplay Decibels how to scale and display magnitude values

Options for BodePlot, Part I.

Page 334: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

332 3. Reference Manual

option name default value

PhaseDisplay Degrees whether to display phase traces and whichunit to use for phase values

PlotPoints 25 the number of frequency sampling points

PlotRange Automatic the plot ranges for the magnitude and thephase plot

ShowLegend True whether to display a plot legend

TraceNames Automatic the trace names displayed in the plot legend

UnwrapPhase True whether to unwrap phase traces

UnwrapTolerance 0.2 the maximum relative difference betweentwo successive phase values that triggersphase unwrapping

Options for BodePlot, Part II.

See also: ACAnalysis (Section 3.7.3), NoiseAnalysis (Section 3.7.4), ReadSimulationData (Sec-tion 3.10.3), NicholPlot (Section 3.9.3), NyquistPlot (Section 3.9.4).

Options Description

A detailed description of all options that are specific to BodePlot or are used in a non-standard wayis given below in alphabetical order:

FrequencyScaling

The option FrequencyScaling determines how sampling points are distributed over the frequencyaxis. Possible values are:

Exponential use exponentially spaced sampling points

Linear use linearly spaced sampling points

Values for the FrequencyScaling option.

MagnitudeDisplay

With the option MagnitudeDisplay, you can specify how magnitude values are displayed in a Bodeplot. The following values are allowed:

Page 335: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 333

Decibels convert magnitude values to decibels

AbsoluteValues show absolute magnitude values on a logarithmic scale

Linear show magnitude values on a linear scale

Values for the MagnitudeDisplay option.

PhaseDisplay

The option PhaseDisplay specifies whether and how to display phase values. Possible choices are:

Degrees display phase values in degrees

Radians display phase values in radians

None suppress the phase plot

Values for the PhaseDisplay option.

PlotRange

With the PlotRange option, you can set the plot ranges for the y-axes of the magnitude and phaseplots. Possible values are:

Automatic determine the plot ranges automatically

magrng, phsrng specify plot ranges for magnitude and phase plot; thevalues of magrng and phsrng can be Automatic, All, orymin, ymax

Values for the PlotRange option.

TraceNames

The option TraceNames allows you to specify the labels that are shown in the plot legend for thedisplayed traces if ShowLegend −> True. The following values are possible:

Page 336: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

334 3. Reference Manual

Automatic use trace names from AC sweeps computed with e.g.ACAnalysis

string or expr the name for a single trace

string, † † † or expr, † † † names for all traces; the number of names must equal thenumber of traces

Values for the TraceNames option.

UnwrapPhase

With the option UnwrapPhase, you can specify whether BodePlot should restrict phase values tothe interval or try to unwrap the phase values of a frequency response trace that wrapsaround the origin of the complex plane more than once.

UnwrapTolerance

With UnwrapTolerance −> tol, you can specify the maximum percentage of a full revolution bywhich two successive phase values may differ such that phase unwrapping is triggered.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define two transferfunctions.

In[2]:= H1[s_] := 1/(s + 1);H2[s_] := 10/(s^2 + s + 10)

This produces a Bode plotof HjΩ.

In[4]:= BodePlot[H1[I w], w, 0.01, 100]

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-40

-30

-20

-10

0

Magnitude (dB)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-80

-60

-40

-20

0

Phase (deg)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

Out[4]= Graphics

Page 337: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 335

This produces a Bode plotof HjΩ and HjΩ.

In[5]:= BodePlot[H1[I w], H2[I w], w, 0.01, 100]

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-60-50-40-30-20-100

10

Magnitude (dB)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-175-150-125-100-75-50-250

Phase (deg)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

Out[5]= Graphics

This defines an RLC filtercircuit.

In[6]:= rlcf = Netlist[V1, 1, 0, Symbolic −> V, Value −> 1,R1, 1, 2, Symbolic −> R1, Value −> 1000.,L1, 2, 3, Symbolic −> L, Value −> 0.001,C1, 3, 0, Symbolic −> C, Value −> 2.2*10^−6,R2, 3, 0, Symbolic −> R2, Value −> 1000.

];

Set up modified nodalequations.

In[7]:= eqsrlcf = CircuitEquations[rlcf]

Out[7]= DAEAC, 44

Do an AC analysis fromHz to MHz.

In[8]:= acsweep = ACAnalysis[eqsrlcf, f, 10, 10^6]

Out[8]=V$1 InterpolatingFunction10., 1.106, ,V$2 InterpolatingFunction10., 1.106, ,V$3 InterpolatingFunction10., 1.106, ,I$V1 InterpolatingFunction10., 1.106,

Increase the number ofplot points.

In[9]:= SetOptions[BodePlot, PlotPoints −> 200];

Page 338: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

336 3. Reference Manual

Display all traces in aBode plot.

In[10]:= BodePlot[acsweep, f, 10, 10^6]

1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6Frequency

-100

-80

-60

-40

-20

0

Magnitude (dB) 1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6

1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6Frequency

-350-300-250-200-150-100-50

0

Phase (deg)

1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6

V$1 V$2 V$3 I$V1

Out[10]= Graphics

Display only the tracesV$2[f] and V$3[f].

In[11]:= BodePlot[acsweep, V$2[f], V$3[f], f, 10, 10^6]

1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6Frequency

-100

-80

-60

-40

-20

0

Magnitude (dB) 1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6

1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6Frequency

-350-300-250-200-150-100-50

0

Phase (deg)

1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6

V$2[f] V$3[f]

Out[11]= Graphics

Page 339: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 337

Display the traces V$2[f]and V$2[f]−V$3[f].

In[12]:= BodePlot[acsweep, V$2[f], V$2[f]−V$3[f], f, 10, 10^6]

1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6Frequency

-80

-60

-40

-20

0

Magnitude (dB) 1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6

1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6Frequency

-350-300-250-200-150-100-50

0

Phase (deg)

1.0E1 1.0E2 1.0E3 1.0E4 1.0E5 1.0E6

V$2[f] V$2[f] - V$3[f

Out[12]= Graphics

Show absolute magnitudevalues instead of decibels.

In[13]:= BodePlot[H1[I w], w, 0.01, 100,MagnitudeDisplay −> AbsoluteValues]

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

1.0E-22.0E-2

5.0E-21.0E-12.0E-1

5.0E-11.0E0

Magnitude

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-80

-60

-40

-20

0

Phase (deg)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

Out[13]= Graphics

Page 340: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

338 3. Reference Manual

Show magnitude valueson a linear scale.

In[14]:= BodePlot[H1[I w], w, 0.01, 100,MagnitudeDisplay −> Linear]

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

0

0.2

0.4

0.6

0.8

1

Magnitude

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-80

-60

-40

-20

0

Phase (deg)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

Out[14]= Graphics

Do not show the phaseplot.

In[15]:= BodePlot[acsweep, V$2[f], V$2[f]−V$3[f],f, 100, 10^5, PhaseDisplay −> None]

1.0E2 5.0E21.0E3 5.0E31.0E4 5.0E41.0E5Frequency

-60

-50

-40

-30

-20

-10

0

Magnitude (dB)

1.0E2 5.0E21.0E3 5.0E31.0E4 5.0E41.0E5

V$2[f] V$2[f] - V$3[f

Out[15]= Graphics

Page 341: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 339

Restrict the phase to theinterval .

In[16]:= BodePlot[H1[I w]^5, w, 0.01, 100, UnwrapPhase −> False]

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-200

-150

-100

-50

0

Magnitude (dB)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-350-300-250-200-150-100-500

Phase (deg)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

Out[16]= Graphics

Unwrap the phase trace. In[17]:= BodePlot[H1[I w]^5, w, 0.01, 100, UnwrapPhase −> True]

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-200

-150

-100

-50

0

Magnitude (dB)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-400

-300

-200

-100

0

Phase (deg)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

Out[17]= Graphics

In the following example, the number of plot points is reduced so that the differences betweensuccessive phase values become too large for phase unwrapping.

Page 342: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

340 3. Reference Manual

Reduce the number of plotpoints.

In[18]:= BodePlot[H1[I w]^5, w, 0.01, 100,PlotPoints −> 10, PlotRange −> Automatic, −360, 0]

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-200

-150

-100

-50

0

Magnitude (dB)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-350-300-250-200-150-100-500

Phase (deg)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

Out[18]= Graphics

To unwrap the phase trace, you can specify a larger number of plot points or increase the value ofUnwrapTolerance.

Increase the unwraptolerance to 30% of .

In[19]:= BodePlot[H1[I w]^5, w, 0.01, 100,PlotPoints −> 10, UnwrapTolerance −> 0.3]

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-200

-150

-100

-50

0

Magnitude (dB)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2Frequency

-400

-300

-200

-100

0

Phase (deg)

1.0E-2 1.0E-1 1.0E0 1.0E1 1.0E2

Out[19]= Graphics

Page 343: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 341

3.9.2 FourierPlot

FourierPlot[func, t, t, t] plots the frequency spectrum of the function func wherethe independent variable t is swept from t to t

FourierPlot[func, func, † † † , t, t, t]superimposes the Fourier plots of several functions

Command structure of FourierPlot.

FourierPlot performs a discrete fourier analysis by applying Fourier on the given functions.

FourierPlot inherits all options from ListPlot. Additionally the following option is available:

option name default value

PlotPoints 250 specifies the number of sample points

Options for FourierPlot.

PlotPoints

The option PlotPoints −> integer specifies the number of sample points. The maximum displayedfrequency is given by integert t.

See also: Fourier.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Plot a spectrum of twosignals with Hz andHz.

In[2]:= FourierPlot[0.5 Sin[2. Pi 20. t], 2. Cos[2. Pi 80. t],t, 0, 1., PlotStyle −> Hue[0], Hue[0.4]]

0 20 40 60 80 100 120Frequency

0

0.25

0.5

0.75

1

1.25

1.5

Amplitude

Out[2]= Graphics

Page 344: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

342 3. Reference Manual

3.9.3 NicholPlot

NicholPlot[func, var, f, f] displays a Nichol plot of the transfer function func[var] asthe independent variable var is swept from f to f

NicholPlot[func, func, † † † , var, f, f]displays the transfer functions func, func, † † †simultaneously in a Nichol plot

Command structure of NicholPlot.

NicholPlot displays one or several transfer functions in a Nichol plot. A Nichol plot is similar to aNyquist plot but shows magnitude (in dB) vs. phase with the axis origin at the point dB .

Note that NicholPlot has attribute HoldFirst.

NicholPlot supports additional patterns for displaying numerical data generated with the func-tions ACAnalysis (Section 3.7.3), NoiseAnalysis (Section 3.7.4), or ReadSimulationData (Sec-tion 3.10.3):

NicholPlot[traces, var, f, f]displays a list of AC traces computed with e.g.ACAnalysis in a Nichol plot

NicholPlot[traces, expr, var, f, f]displays the value of an expression in terms of AC traces

NicholPlot[traces, expr, expr, † † † , var, f, f]displays the values of several expressions

Displaying numerical data with NicholPlot.

You can customize the appearance of Nichol plots with the following options. In addition,NicholPlot inherits many options from ListPlot and Legend. Both the options which are specificto NicholPlot as well as the inherited options can be set with SetOptions[NicholPlot, opts].

Page 345: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 343

option name default value

FrequencyScaling Exponential whether to distribute sampling pointsexponentially or linearly along thefrequency axis

PhaseDisplay Degrees the unit for phase values

ShowLegend True whether to display trace names

TraceNames Automatic the trace names displayed in the plot legend

Options for NicholPlot.

See also: ACAnalysis (Section 3.7.3), NoiseAnalysis (Section 3.7.4), ReadSimulationData (Sec-tion 3.10.3), BodePlot (Section 3.9.1), NyquistPlot (Section 3.9.4).

Options Description

A detailed description of all options that are specific to NicholPlot or are used in a non-standardway is given below in alphabetical order:

FrequencyScaling

The option FrequencyScaling determines how sampling points are distributed over the frequencyaxis. Possible values are:

Exponential use exponentially spaced sampling points

Linear use linearly spaced sampling points

Values for the FrequencyScaling option.

PhaseDisplay

The option PhaseDisplay specifies the unit for phase values. Possible values are:

Degrees display phase values in degrees

Radians display phase values in radians

Values for the PhaseDisplay option.

Page 346: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

344 3. Reference Manual

TraceNames

The option TraceNames allows you to specify the labels that are shown in the plot legend for thedisplayed traces if ShowLegend −> True. The following values are possible:

Automatic use trace names from AC sweeps computed with e.g.ACAnalysis

string or expr the name for a single trace

string, † † † or expr, † † † names for all traces; the number of names must equal thenumber of traces

Values for the TraceNames option.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define two transferfunctions.

In[2]:= H1[s_] := (60 + 20*s)/(100*s + 45*s^2 + 15*s^3 + 2*s^4)H2[s_] := 10/(s^2 + s + 10)

Draw a Nichol plot ofHjΩ.

In[4]:= NicholPlot[H1[I w], w, 0.1, 5, AspectRatio −> 0.8]

-360 -300 -240 -120 -60 0deg

-20

-15

-10

-5

5

10

15

dB

Out[4]= Graphics

Page 347: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 345

Display two transferfunctions in a Nichol plot.

In[5]:= NicholPlot[H1[I w], H2[I w], w, 0.1, 100,AspectRatio −> 0.7, PlotRange −> −300,0, −60,15,PlotPoints −> 100]

-300 -240 -120 -60 0deg

-60

-50

-40

-30

-20

-10

10

dB

Out[5]= Graphics

This defines an RLC filtercircuit.

In[6]:= rlcf = Netlist[V1, 1, 0, Symbolic −> V, Value −> 1,R1, 1, 2, Symbolic −> R1, Value −> 1000.,L1, 2, 3, Symbolic −> L, Value −> 0.001,C1, 3, 0, Symbolic −> C, Value −> 2.2*10^−6,R2, 3, 0, Symbolic −> R2, Value −> 1000.

];

Set up modified nodalequations.

In[7]:= eqsrlcf = CircuitEquations[rlcf]

Out[7]= DAEAC, 44

Do an AC analysis fromHz to MHz.

In[8]:= acsweep = ACAnalysis[eqsrlcf, f, 10, 10^6]

Out[8]=V$1 InterpolatingFunction10., 1.106, ,V$2 InterpolatingFunction10., 1.106, ,V$3 InterpolatingFunction10., 1.106, ,I$V1 InterpolatingFunction10., 1.106,

Page 348: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

346 3. Reference Manual

Display severalexpressions in a Nicholplot.

In[9]:= NicholPlot[acsweep, V$2[f], V$3[f], f, 10, 10^6,AspectRatio −> 0.8]

-360-300-240 -120-60 0deg

-100

-80

-60

-40

-20

dB

V$2[f] V$3[f]

Out[9]= Graphics

3.9.4 NyquistPlot

NyquistPlot[func, var, f, f]displays a Nyquist plot of the transfer function func[var]as the independent variable var is swept from f to f

NyquistPlot[func, func, † † † , var, f, f]displays the transfer functions func, func, † † †simultaneously in a Nyquist plot

Command structure of NyquistPlot.

NyquistPlot displays one or several transfer functions in a Nyquist plot. A Nyquist plot is aparametric plot of the imaginary part vs. the real part of a frequency response as the frequency isswept from f to f.

Note that NyquistPlot has attribute HoldFirst.

NyquistPlot supports additional patterns for displaying numerical data generated with the func-tions ACAnalysis (Section 3.7.3), NoiseAnalysis (Section 3.7.4), or ReadSimulationData (Sec-tion 3.10.3):

Page 349: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 347

NyquistPlot[traces, var, f, f]displays a list of AC traces computed with e.g.ACAnalysis in a Nyquist plot

NyquistPlot[traces, expr, var, f, f]displays the value of an expression in terms of AC traces

NyquistPlot[traces, expr, expr, † † † , var, f, f]displays the values of several expressions

Displaying numerical data with NyquistPlot.

You can customize the appearance of Nyquist plots with the following options. In addition,NyquistPlot inherits many options from ListPlot and Legend. Both the options which are specificto NyquistPlot as well as the inherited options can be set with SetOptions[NyquistPlot, opts].

option name default value

FrequencyScaling Exponential whether to distribute sampling pointsexponentially or linearly along thefrequency axis

ShowLegend True whether to display trace names

ShowUnitCircle False whether to draw the unit circle

TraceNames Automatic the trace names displayed in the plot legend

UnitCircleStyle RGBColor[0., 0., .5]the plot style for the unit circle

Options for NyquistPlot.

See also: ACAnalysis (Section 3.7.3), NoiseAnalysis (Section 3.7.4), ReadSimulationData (Sec-tion 3.10.3), BodePlot (Section 3.9.1), NicholPlot (Section 3.9.3).

Options Description

A detailed description of all options that are specific to NyquistPlot or are used in a non-standardway is given below in alphabetical order:

FrequencyScaling

The option FrequencyScaling determines how sampling points are distributed over the frequencyaxis. Possible values are:

Page 350: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

348 3. Reference Manual

Exponential use exponentially spaced sampling points

Linear use linearly spaced sampling points

Values for the FrequencyScaling option.

ShowUnitCircle

With ShowUnitCircle −> True, NyquistPlot adds the unit circle to a plot.

TraceNames

The option TraceNames allows you to specify the labels that are shown in the plot legend for thedisplayed traces if ShowLegend −> True. The following values are possible:

Automatic use trace names from AC sweeps computed with e.g.ACAnalysis

string or expr the name for a single trace

string, † † † or expr, † † † names for all traces; the number of names must equal thenumber of traces

Values for the TraceNames option.

UnitCircleStyle

With UnitCircleStyle −> style, you can change the plot style for the unit circle.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define two transferfunctions.

In[2]:= H1[s_] := 1/(s + 1);H2[s_] := 10/(s^2 + s + 10)

Increase the number ofplot points.

In[4]:= SetOptions[NyquistPlot, PlotPoints −> 200];

Page 351: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 349

Draw a Nyquist plot ofHjΩ.

In[5]:= NyquistPlot[H2[I w], w, 0.01, 100, PlotRange −> All]

-1 -0.5 0.5 1 1.5Re

-3

-2.5

-2

-1.5

-1

-0.5

Im

Out[5]= Graphics

This produces a Nyquistplot of HjΩ and HjΩ.

In[6]:= NyquistPlot[H1[I w], H2[I w], w, 0.01, 100,PlotRange −> All]

-1 -0.5 0.5 1 1.5Re

-3

-2.5

-2

-1.5

-1

-0.5

Im

Out[6]= Graphics

This defines an RLC filtercircuit.

In[7]:= rlcf = Netlist[V1, 1, 0, Symbolic −> V, Value −> 1,R1, 1, 2, Symbolic −> R1, Value −> 1000.,L1, 2, 3, Symbolic −> L, Value −> 0.001,C1, 3, 0, Symbolic −> C, Value −> 2.2*10^−6,R2, 3, 0, Symbolic −> R2, Value −> 1000.

];

Set up modified nodalequations.

In[8]:= eqsrlcf = CircuitEquations[rlcf]

Out[8]= DAEAC, 44

Page 352: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

350 3. Reference Manual

Do an AC analysis fromHz to MHz.

In[9]:= acsweep = ACAnalysis[eqsrlcf, f, 10, 10^6]

Out[9]=V$1 InterpolatingFunction10., 1.106, ,V$2 InterpolatingFunction10., 1.106, ,V$3 InterpolatingFunction10., 1.106, ,I$V1 InterpolatingFunction10., 1.106,

Display the trace ofV$2[f].

In[10]:= NyquistPlot[acsweep, V$2[f], f, 10, 10^6]

0.2 0.4 0.6 0.8 Re

-0.2-0.1

0.10.20.30.40.5

Im

V$2[f]

Out[10]= Graphics

Display severalexpressions in a Nyquistplot.

In[11]:= NyquistPlot[acsweep, V$2[f]−0.5, 0.5−V$2[f],f, 10, 10^6, Frame −> True, ShowLegend −> False]

-0.4 -0.2 0 0.2 0.4

-0.4

-0.2

0

0.2

0.4

Re

Im

Out[11]= Graphics

Page 353: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 351

Display the unit circle. In[12]:= NyquistPlot[H2[I w], w, 0.01, 100,PlotRange −> −3, 3, −3.5, 1.5,ShowUnitCircle −> True]

-3 -2 -1 1 2 3Re

-3

-2

-1

1

Im

Out[12]= Graphics

Display the unit circleusing a different style.

In[13]:= NyquistPlot[H2[I w], w, 0.01, 100,PlotRange −> −3, 3, −3.5, 1.5,ShowUnitCircle −> True,UnitCircleStyle −>

GrayLevel[0], Dashing[0.04, 0.03]]

-3 -2 -1 1 2 3Re

-3

-2

-1

1

Im

Out[13]= Graphics

Page 354: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

352 3. Reference Manual

3.9.5 RootLocusPlot

RootLocusPlot[func, k, k, k]displays the root locus of func as k is swept from k to k

RootLocusPlot[func] displays a pole/zero diagram of func

RootLocusPlot[rootloc] displays a root locus calculated with RootLocusByQZ

Command structure of RootLocusPlot.

RootLocusPlot displays a root locus plot of a transfer function Hs k, where k denotes a real-valued parameter. A root locus plot shows the trajectories of the poles and zeros of Hs k in thecomplex plane as k varies from k to k. RootLocusPlot can also be used to produce a pole/zerodiagram of transfer function Hs without parameters as well as to display root loci calculated withRootLocusByQZ.

By default, RootLocusPlot chooses a logarithmic representation of the complex plane for bettervisualization of widely separated poles and zeros. However, as logarithmic scaling is inappropriatefor coordinates near the axes, the regions around the axes are scaled semi-logarithmically, and theregion around the origin is scaled linearly. RootLocusPlot marks the linearly scaled region with agray background. The semi-logarithmic regions are the regions above and below as well as to theleft and the right of the linear region.

You can customize the appearance of root locus plots with the following options. In addition,RootLocusPlot inherits many options from Graphics. Both the options which are specific toRootLocusPlot as well as the inherited options can be set with SetOptions[RootLocusPlot, opts].

Page 355: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 353

option name default value

LinearRegionLimit 1.0 the extent of the linearly scaled plot region

LinearRegionSize 0.3 the relative size of the linearly scaled plotregion

LinearRegionStyle GrayLevel[0.9] the fill color used to mark the linear region

PlotPoints 5 the number of points between k and k atwhich the poles and zeros are calculated

PlotRange Automatic the plot range

PoleStyle CrossMark[0.02, Hue[0.15 (1. − #1)] & , Thickness[0.007]]the mark and plot style for poles

ShowLegend True whether to display a plot legend

ZeroStyle CircleMark[0.02, Hue[0.25 #1 + 0.3] & , Thickness[0.007]]the mark and plot style for zeros

Options for RootLocusPlot.

See also: PolesAndZerosByQZ (Section 3.8.3), RootLocusByQZ (Section 3.8.6).

Options Description

A detailed description of all options that are specific to RootLocusPlot or are used in a non-standardway is given below in alphabetical order:

LinearRegionLimit

With LinearRegionLimit −> value, you can specify the extent of the linearly scaled plot regionaround the origin. For example, the setting LinearRegionLimit −> 100 causes the region where x and y to be scaled linearly. LinearRegionLimit −> Infinity turnsoff logarithmic scaling.

LinearRegionSize

LinearRegionSize −> size specifies the percentage of the total plot area occupied by the linearregion. The option value size must be a real number between and .

LinearRegionStyle

With LinearRegionStyle −> style, you can specify the fill color RootLocusPlot uses for the linearlyscaled region.

Page 356: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

354 3. Reference Manual

PlotRange

The meaning of the PlotRange option is the same as for other Mathematica graphics functions, butthe option has slightly different formats.

xmin, xmax, ymin, ymax specify individual limits for all axes directions

xmin, xmax specify plot range for the x-axis.

value equivalent to −value, value, −value, value

Automatic or All determine plot range automatically

Values for the PlotRange option.

PoleStyle

With the option PoleStyle −> style, you can change the appearance of the symbol RootLocusPlotuses to mark poles. The following styles are available:

CrossMark[size, colorfunc, grstyle]marks a root with a cross

PlusMark[size, colorfunc, grstyle]marks a root with a plus

CircleMark[size, colorfunc, grstyle]marks a root with a circle

SquareMark[size, colorfunc, grstyle]marks a root with a square

PointMark[size, colorfunc, grstyle]marks a root with a point

Styles for the PoleStyle and ZeroStyle options.

In the above table, size denotes the size of a root marker in scaled coordinates, colorfunc a purefunction that returns a color value for an argument between 0 and 1, and grstyle an additional list ofgraphics styles for the root marker. The color function is used to visualize the parameter dependencyof the root.

ZeroStyle

With the option ZeroStyle −> style, you can change the appearance of the symbol RootLocusPlotuses to mark zeros. For a list of available styles see the description of the PoleStyle option.

Page 357: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 355

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define a transfer functionHas a.

In[2]:= Ha[s_, a_] := (a + 2*s + s^2)/(10 + 3*a*s + 4*s^2 + s^3)

Display a root locus plotof Has a as a is sweptfrom to .

In[3]:= RootLocusPlot[Ha[s, a], a, −4, 10, PlotPoints −> 10]

a = -4.000e0 .. 1.000e1 (0% .. 100%)

Re s

Im s

-2.0E0-5.0E0 -1. 1.

-2.0E0

-5.0E0

-1.

1.

2.0E0

5.0E0

100

0%Poles

100

0%Zeros

Out[3]= Graphics

Display the pole/zerodistribution of Has a fora .

In[4]:= RootLocusPlot[Ha[s, 0], PlotRange −> 6]

Re s

Im s

-2.0E0-5.0E0 -1. 1. 2.0E0 5.0E0

-2.0E0

-5.0E0

-1.

1.

2.0E0

5.0E0

Out[4]= Graphics

Page 358: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

356 3. Reference Manual

Change boundaries, plotsize, and color of thelinear region.

In[5]:= RootLocusPlot[Ha[s, a], a, −4, 10,PlotPoints −> 10, LinearRegionLimit −> 4.0,LinearRegionSize −> 0.8,LinearRegionStyle −> GrayLevel[0.95]]

a = -4.000e0 .. 1.000e1 (0% .. 100%)

Re s

Im s

-4. -3. -2. -1. 1.

-4.

-2.

2.

4.

100

0%Poles

100

0%Zeros

Out[5]= Graphics

Set equal plot limits for allaxes directions.

In[6]:= RootLocusPlot[Ha[s, a], a, −4, 10,PlotPoints −> 10, PlotRange −> 100, Frame −> True]

a = -4.000e0 .. 1.000e1 (0% .. 100%)

Re s

Im s

100

0%Poles

100

0%Zeros

Out[6]= Graphics

Page 359: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 357

Change the style for poleand zero markers.

In[7]:= RootLocusPlot[Ha[s, a], a, −4, 10,PlotPoints −> 10,PoleStyle −> PlusMark[0.02,

GrayLevel[1−0.8*#]&, Thickness[0.005]],ZeroStyle −> SquareMark[0.02,

GrayLevel[1−0.8*#]&, Thickness[0.005]]]

a = -4.000e0 .. 1.000e1 (0% .. 100%)

Re s

Im s

-2.0E0-5.0E0 -1. 1.

-2.0E0

-5.0E0

-1.

1.

2.0E0

5.0E0

100

0%Poles

100

0%Zeros

Out[7]= Graphics

3.9.6 TransientPlot

TransientPlot[func, tvar, t, t]displays the transient waveform func[tvar] as theindependent variable tvar is swept from t to t

TransientPlot[func, func, † † † , tvar, t, t]displays the transient waveforms func, func, † † †simultaneously in a single plot

Command structure of TransientPlot.

TransientPlot displays one or several transient waveforms in a single plot, where the signal valuesare usually plotted versus time.

Note that TransientPlot has attribute HoldAll.

Additionally,TransientPlot supports the multi-dimensional data format of Analog Insydes described in Sec-tion 3.7.1, which consists of lists of rules, where the variables are assigned InterpolatingFunctionobjects. Therefore, call TransientPlot where the first argument is compatible to the return value ofthe numerical solver functions NDAESolve (Section 3.7.5) and NDSolve, or the data interface functionReadSimulationData (Section 3.10.3):

Page 360: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

358 3. Reference Manual

TransientPlot[traces, expr, tvar, t, t]displays the transient waveform of an expression in termsof the computed traces as the independent variable tvar isswept from t to t

TransientPlot[traces, expr, expr, † † † , tvar, t, t]displays the transient waveforms of several expressionsexpr, expr, † † † simultaneously in a single plot

Displaying numerical data with TransientPlot.

TransientPlot inherits most of its options from Plot and GraphicsArray. Both the options whichare specific to TransientPlot as well as the inherited options can be set withSetOptions[TransientPlot, opts].

option name default value

Parametric False whether to carry out a parametric plot

PlotRange Automatic the plot ranges for the different transientwaveforms

ShowLegend True whether to display a plot legend

ShowSamplePoints False generates a ListPlot of the simulation data

SingleDiagram True combines plots of several functions in asingle diagram

SweepParameters Automatic allows for filtering the multi-dimensionaldata

Options for TransientPlot.

See also: NDSolve, NDAESolve (Section 3.7.5), ReadSimulationData (Section 3.10.3).

Options Description

A detailed description of all options that are specific to TransientPlot or are used in a non-standardway is given below in alphabetical order:

Page 361: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 359

Parametric

Changing the default setting from False to True allows for carrying out parametric plots of transientwaveforms. Therefore, specify a list of two expressions, where the first one refers to the x-axis andthe second to the y-axis. The expressions are automatically added as labels to the x and y-axes.

Please note that this option also supports the multi-dimensional data format.

PlotRange

The usage of the option PlotRange is different as compared to Plot. The PlotRange of each tran-sient waveform can be separately modified for the setting SingleDiagram −> False. The defaultsetting is PlotRange −> Automatic. Possible option values are as follows:

Automatic or All determine PlotRange automatically

ymin, ymax specify same PlotRange for all waveforms

Automatic | All | ymin, ymax, † † † specify individual PlotRange for each waveform

Values for the PlotRange option.

ShowLegend

The option ShowLegend allows for displaying a plot legend. The default setting isShowLegend −> True.

ShowSamplePoints

Changing the default setting from False to True allows for generating a ListPlot of the simulationdata.

Please note that this option also supports the multi-dimensional data format.

SingleDiagram

The option SingleDiagram combines plots of several transient waveforms in a single diagram.Changing the default setting from True to False produces a GraphicsArray of separately plottedtransient waveforms.

Please note that this option also supports the multi-dimensional data format.

Page 362: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

360 3. Reference Manual

SweepParameters

The option SweepParameters allows for filtering the multi-dimensional data. The default setting isSweepParameters −> Automatic. Possible option values are as follows:

Automatic leave the multi-dimensional data unchanged

param −> value | param −> _, † † † specify explicit value or Blank[] for each valid sweepparameter

Values for the SweepParameters option.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Plot two sinusoidalfunctions.

In[2]:= S[T_] := Sin[10.T];TransientPlot[S[T], 2 S[T−1], T, 0, 1]

0.2 0.4 0.6 0.8 1T

-2

-1

1

2

2 S[T - 1

S[T]

Out[3]= Graphics

In the following, the transient solution of the diode rectifier circuit shown below is plotted us-ing TransientPlot.

V0 C1 R1 Vout

1 2D1

Page 363: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 361

Define netlist descriptionof a simple diode rectifiercircuit.

In[4]:= rectifier =Circuit[

Netlist[V0, 1, 0, Symbolic −> V0,

Value −> 2. Sin[10^6 Time],R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice"]

]

Out[4]= Circuit

Set up system of symbolictime-domain equations.

In[5]:= rectifiereqs = CircuitEquations[rectifier,AnalysisMode −> Transient, ElementValues −> Symbolic]

Out[5]= DAETransient, 44

Perform numericaltransient analysis.

In[6]:= tran = NDAESolve[rectifiereqs, t, 0., 2.*^−5]

Out[6]=V$2 InterpolatingFunction0, 0.00002, ,V$1 InterpolatingFunction0, 0.00002, ,I$V0 InterpolatingFunction0, 0.00002, ,I$AC$D1 InterpolatingFunction0, 0.00002,

Display the simulationresult with TransientPlotfor the variables V$1[t]and V$2[t].

In[7]:= TransientPlot[tran, V$1[t], V$2[t], t, 0., 2.*^−5,Axes −> False, Frame −> True, GridLines −> Automatic]

0 -65. 10

0.00001 0.000015 0.00002

t

-2

-1

0

1

2

V$2[t]

V$1[t]

Out[7]= Graphics

Page 364: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

362 3. Reference Manual

View signals separately. In[8]:= Vd[t_] := V$1[t] − V$2[t];TransientPlot[tran, Vd[t], V$2[t], t, 0., 2.*^−5,

PlotRange −> −4., 2., 0., 1.5,SingleDiagram −> False]

-65. 10

0.00001 0.000015 0.00002t

0.2

0.4

0.6

0.8

1

1.2

1.4

V$2[

-65. 10

0.00001 0.000015 0.00002t

-4

-3

-2

-1

1

2

Vd[t

Out[9]= GraphicsArray

Display the simulationdata.

In[10]:= TransientPlot[tran, V$1[t], V$2[t], t, 0., 2.*^−5,ShowSamplePoints −> True]

-65. 10

0.00001 0.000015 0.00002t

-2

-1

1

2

V$2[t]

V$1[t]

Out[10]= Graphics

Page 365: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.9 Graphics Functions 363

Generate a parametricplot.

In[11]:= TransientPlot[tran, V$1[t], V$2[t],t, 2.*^−6, 2.*^−5, Parametric −> True]

-2 -1 1 2V$1[t]

0.8

0.9

1.1

1.2

V$2[t]

Out[11]= Graphics

Perform parametrictransient analysis.

In[12]:= paramtran = NDAESolve[rectifiereqs, t, 0., 2.*^−5,R1, Table[10^i, i, 0, 3]]

Out[12]=V$2 InterpolatingFunction0, 0.00002, ,V$1 InterpolatingFunction0, 0.00002, ,I$V0 InterpolatingFunction0, 0.00002, ,I$AC$D1 InterpolatingFunction0, 0.00002, ,SweepParameters R1 1.,

V$2 InterpolatingFunction0, 0.00002, ,V$1 InterpolatingFunction0, 0.00002, ,I$V0 InterpolatingFunction0, 0.00002, ,I$AC$D1 InterpolatingFunction0, 0.00002, ,SweepParameters R1 10.,

V$2 InterpolatingFunction0, 0.00002, ,V$1 InterpolatingFunction0, 0.00002, ,I$V0 InterpolatingFunction0, 0.00002, ,I$AC$D1 InterpolatingFunction0, 0.00002, ,SweepParameters R1 100.,

V$2 InterpolatingFunction0, 0.00002, ,V$1 InterpolatingFunction0, 0.00002, ,I$V0 InterpolatingFunction0, 0.00002, ,I$AC$D1 InterpolatingFunction0, 0.00002, ,SweepParameters R1 1000.

Page 366: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

364 3. Reference Manual

Display themulti-dimensionalsimulation result: show alltraces of the parametersweep.

In[13]:= TransientPlot[paramtran, V$2[t], t, 0., 2.*^−5]

-65. 10

0.00001 0.000015 0.00002t

0.2

0.4

0.6

0.8

1

1.2

V$2[t]

Out[13]= Graphics

Filter themulti-dimensional data:display only the tracecorresponding to theparameter value R1=1.

In[14]:= TransientPlot[paramtran, V$2[t], t, 0., 2.*^−5,SweepParameters −> R1 −> 1.]

-65. 10

0.00001 0.000015 0.00002t

0.2

0.4

0.6

0.8

1

V$2[t]

Out[14]= Graphics

Page 367: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.10 Interfaces 365

3.10 Interfaces

In the following chapter the different import and export features of Analog Insydes are discussed.Section 3.10.1 describes how to translate netlists from external simulators to the internal AnalogInsydes netlist format using ReadNetlist. The commands ReadSimulationData (Section 3.10.3)and WriteSimulationData (Section 3.10.4) can be used to import or export numerical simulationdata. For behavioral model generation the command WriteModel (Section 3.10.5) can be used, whichtranslates a symbolic DAEObject to an external behavioral model description language such asSaber MAST. For importing schematics stored in DXF format (Drawing Interchange File) as nativeMathematica graphic objects see DXFGraphics (Section 3.13.2).

3.10.1 ReadNetlist

ReadNetlist["netfile", Simulator−>sim]reads a netlist file "netfile" from a simulator sim andconverts it into an Analog Insydes netlist

ReadNetlist["netfile", "outfile", Simulator−>sim]additionally adds the operating-point information from thesimulator output file "outfile"

Command structure of ReadNetlist.

This function converts a simulator-specific netlist file netfile into an Analog Insydes netlist description.Additionally, the operating-point information can be extracted from a given simulator-specific outputfile outfile. ReadNetlist then returns a Circuit object which can be used for setting up circuitequations by applying the function CircuitEquations (Section 3.5.1). For more information on thesimulator-specific features see Section 3.10.2.

ReadNetlist has the following options:

Page 368: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

366 3. Reference Manual

option name default value

CharacterMapping "_" −> "$" list of translation rules for charactermapping used while transforming simulatorparameters to Mathematica symbols

InstanceNameSeparator Inherited[AnalogInsydes]specifies the character or string AnalogInsydes uses to separate name componentsof reference designators and nodeidentifiers generated for instantiatedsubcircuit objects (see Section 3.14.2)

KeepPrefix True if set to False the prefix of the referencedesignator introduced by the PSpiceSchematics Editor and the Saber Designerwill be omitted

LevelSeparator "/" specifies the character or string AnalogInsydes uses to separate name componentsof local models, parameters, and subcircuitsgenerated by ReadNetlist

LibraryPath "." specifies the directories which containdevice model libraries

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Simulator Inherited[AnalogInsydes]standard Analog Insydes simulatorspecification (see Section 3.14.6)

Options for ReadNetlist.

See also: ReadSimulationData (Section 3.10.3), Simulator (Section 3.14.6), Section 3.10.2.

Options Description

A detailed description of all ReadNetlist options is given below in alphabetical order:

CharacterMapping

With CharacterMapping −> charactera −> characterb the internal character mapping scheme canbe modifed. Use this option with caution, because this rule will be applied to each symbol andexpression in the netlist. For example CharacterMapping −> "." −> "$" will replace all dots

Page 369: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.10 Interfaces 367

(".") into dollar signs ("$"), even if it is a decimal dot like in "1.234", which will lead to asyntax error ("1$234"). This option is useful if your netlist contains e.g. element names includ-ing "_" and "$" and which will be ambiguous if the "_" is mapped to a "$". You can useCharacterMapping −> "_" −> "x" to avoid this ambiguity.

KeepPrefix

Some schematic capture tools add a prefix to all element names to make sure that the element typeis correct and independent from the actual element name. If KeepPrefix −> False is set, the prefixwill be removed. If a Saber netlist is read, the template name is removed.

Use this option with caution. It might cause ambiguous element names.

LevelSeparator

Locally defined subcircuits must be transformed to a top-level subcircuit with unique names. Togenerate unique names the value of LevelSeparator −> string is used to separate the different levelsof subcircuits. Because these names are never converted to a Mathematica symbol it is possible tospecifiy a non-alphanumeric character.

The default is LevelSeparator −> "/".

LibraryPath

A netlist can contain calls to further files and libraries. With LibraryPath the search path for thesefiles can be specified.

The default is LibraryPath −> ".". The current working directory is set to the directory from thefile name specification for netfile (see also the Mathematica command DirectoryName).

Protocol

This option describes the standard Analog Insydes protocol specification (see Section 3.14.5). Thetop-level function for the Protocol option is ReadNetlist. The second-level function isExpandSubcircuits.

Simulator

ReadNetlist supports the following simulators and file types:

Page 370: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

368 3. Reference Manual

simulator netlist file type output file type

"AnalogInsydes" *.m file

"Eldo" *.cir file *.chi file

"PSpice" *.cir file *.out file

"Saber" *.sin file saved ssparam output

Supported simulators and file types by ReadNetlist.

ReadNetlist appends Simulator −> simulator to the GlobalParameters field of the returnedCircuit object. This enables the Analog Insydes models to determine which simulator-specificproperties of the models have to be chosen. For more information on the simulator-specific featuressee Section 3.10.2.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Read and convert a PSpicenetlist.

In[2]:= netdc = ReadNetlist["AnalogInsydes/DemoFiles/Multivibrator.cir",Simulator −> "PSpice"]

Out[2]= Circuit

Display the netlist. In[3]:= DisplayForm[netdc]

Out[3]//DisplayForm=Circuit:

Netlist Raw, 9 Entries:R1, 1, 2, Type Resistor, Value 4700., Symbolic R1R2, 2, 0, Type Resistor, Value 4700., Symbolic R2R3, 4, 0, Type Resistor, Value 39000., Symbolic R3R4, 5, 0, Type Resistor, Value 82000., Symbolic R4R5, 1, 3, Type Resistor, Value 18000., Symbolic R5IC, 4, 5, Type CurrentSource, Value AC 0, DC Transient

Q1, 3 C, 2 B, 4 E, Model ModelBJT, BC182, Q1, SelectorQ2, 1 C, 3 B, 5 E, Model ModelBJT, BC182, Q2, SelectorVCC, 1, 0, Type VoltageSource, Value AC 0, DC Transien

ModelParametersName BC182, Type NPN, CJC 1.1012GlobalParametersSimulator PSpice

Read a PSpice netlistincluding operating-pointinformation.

In[4]:= buffer = ReadNetlist["AnalogInsydes/DemoFiles/Buffer.cir","AnalogInsydes/DemoFiles/Buffer.out",Simulator −> "PSpice"]

Out[4]= Circuit

Page 371: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.10 Interfaces 369

3.10.2 Simulator-Specific Remarks on ReadNetlist

The command ReadNetlist translates netlists from several external simulators to the Analog Insydesnetlist format. The following section describes the different features supported by ReadNetlist foreach simulator.

AnalogInsydes

ReadNetlist["netfile", Simulator −> "AnalogInsydes"] is basically only a wrapper function forthe Mathematica command Get. Additionally, ReadNetlist checks if the netfile loaded contains aCircuit object and appends Simulator −> "AnalogInsydes" to the GlobalParameters field.

PSpice

ReadNetlist["netfile", Simulator −> "PSpice"] supports the following devices:

PSpice reference designator Analog Insydes type

C Capacitor or model call

D model call

E VCVSource or model template

F CCCSource

G VCCSource or model template

H CCVSource

I CurrentSource

J model call

L Inductor or model call

M model call

Q model call

R Resistor or model call

V VoltageSource

X subcircuit call

PSpice reference designators supported by ReadNetlist.

All model calls have functions as references for Model, Selector, and Parameters were applicable:

Page 372: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

370 3. Reference Manual

rd, n1 −> p1, ,Model −> Model[type, model, rd],Selector −> Selector[type, model, rd],Parameters −> Parameters[type, model, rd],

where type is one of "BJT", "CAP", "Diode", "IND", "JFET", "MOSFET", or "RES". The value modelis the model name, rd the reference designator of the device.

Linear resistors (R), capacitors (C), and inductors (L) are converted to their generic counterpart inAnalog Insydes. Model calls are generated if temperature dependencies are given or a model isdefined.

Linear controlled sources (E, F, G, H) are converted to their generic counterpart in Analog Insydes. Incase of current controlled sources (F, H) additional nodes are introduced. In case of nonlinear voltagecontrolled sources (E, G) a behavioral model is generated and appended to the netlist. Supportedtypes are POLY, VALUE, and TABLE.

Independent sources (I, V) of type EXP, PULSE, PWL, SFFM, and SIN are supported (see Chapter 4.1).

Parameterized subcircuits without optional nodes are also supported and may contain local modelcards.

The following cards are supported:

PSpice card action

.INCLUDE include the given file

.LIB search for missing models and subcircuits

.MODEL convert to ModelParameters

.PARAM convert to GlobalParameters

.OPTIONS scan for GMIN, DEFL, DEFW, DEFAD, DEFAS, DEFPD, DEFPS,DEFNRD, DEFNRS, TNOM and convert to GlobalParameters

.SUBCKT convert to Subcircuit

.TEMP convert to GlobalParameters

.TRAN scan for tstep and tstop and convert to GlobalParameters

.TITLE print title according the setting of the Protocol option

PSpice cards supported by ReadNetlist.

The following cards are ignored:

Page 373: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.10 Interfaces 371

.AC

.ALIASES

.DC

.NOISE

.PLOT

.PRINT

.PROBE

.OP

.WIDTH

PSpice cards ignored by ReadNetlist.

Note that all temperatures like TEMP are converted from C to K.

ReadNetlist["netfile", "outfile", Simulator −> "PSpice"] additionally scans the operating-pointinformation section in the output file outfile. Afterwards the circuit is flattened via an internal callto ExpandSubcircuits and the small-signal parameters are appended to the corresponding modelinstance. The parameter names are postfixed with "$ac" to avoid ambiguities.

Eldo

ReadNetlist["netfile", Simulator −> "Eldo"] supports the following devices:

Page 374: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

372 3. Reference Manual

Eldo reference designator Analog Insydes type

C Capacitor or model call

D model call

E VCVSource or model template

F CCCSource or model template

G VCCSource

H CCVSource

I CurrentSource

J model call

L Inductor or model call

M model call

Q model call

R Resistor or model call

V VoltageSource

X subcircuit call

Y model call

Eldo reference designators supported by ReadNetlist.

All model calls have functions as references for Model, Selector, and Parameters were applicable:

rd, n1 −> p1, ,Model −> Model[type, model, rd],Selector −> Selector[type, model, rd],Parameters −> Parameters[type, model, rd],

where type is one of "BJT", "CAP", "Diode", "IND", "JFET", "MOSFET", or "RES". The value modelis the model name, rd the reference designator of the device.

Linear resistors (R), capacitors (C), and inductors (L) are converted to their generic counterpart inAnalog Insydes. Model calls are generated if temperature dependencies are given or a model isdefined.

Linear controlled sources (E, F, G, H) are converted to their generic counterpart in Analog Insydes. Incase of current controlled sources (F, H) additional nodes are introduced. In case of nonlinear voltagecontrolled sources (E, G) a behavioral model is generated and appended to the netlist. Supportedtypes are POLY, VALUE, and TABLE.

Independent sources (I, V) of type EXP, PULSE, PWL, SFFM, and SIN are supported (see Chapter 4.1).

Page 375: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.10 Interfaces 373

Parameterized subcircuits are also supported and may contain local model cards and local subcircuitdefinitions.

For calls to HDLA models (Y), ReadNetlist reads the file "hdlaInfo" and scans the section[HdlaPins] to set up the correct node to port mapping:

rd, n1 −> p1, ,Model −> Model[entity, architecture, rd],Selector −> architecture,

with the HDLA entity name entity and the HDLA architecture name architecture. If the file cannotbe found a generic port list is generated:

rd, n1 −> 1, n2 −> 2, Model −> Model[entity, architecture, rd],Selector −> architecture,

The environment variables HDLALIBPATH and HDLAWORKPATH are taken into account while searchingfor the file "hdlaInfo".

The following cards are supported:

Eldo card action

.ADDLIB search for missing models and subcircuits

.DC scan for TEMP and convert to GlobalParameters

.HDLALIB search for macro interface definitions of HDLA models

.INCLUDE include the given file

.LIB search for missing models and subcircuits

.MODEL convert to ModelParameters

.PARAM convert to GlobalParameters or subcircuit parameters

.OPTIONS scan for GMIN, DEFL, DEFW, DEFAD, DEFAS, DEFPD, DEFPS,DEFNRD, DEFNRS, TNOM and convert to GlobalParameters

.SUBCKT convert to Subcircuit

.TEMP convert to GlobalParameters

.TRAN scan for tstep and tstop and convert to GlobalParameters

.TITLE print according the setting of the Protocol option

Eldo cards supported by ReadNetlist.

The following cards are ignored:

Page 376: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

374 3. Reference Manual

.AC

.ALIASES

.NOISE

.PLOT

.PRINT

.PROBE

.OP

.RAMP

.VIEW

.WIDTH

Eldo cards ignored by ReadNetlist.

Note that all temperatures like TEMP are converted from C to K.

ReadNetlist["netfile", "outfile", Simulator −> "Eldo"] additionally scans the operating-point in-formation section in the output file outfile. Afterwards the circuit is flattened via an internal callto ExpandSubcircuits and the small-signal parameters are appended to the corresponding modelinstance. The parameter names are postfixed with "$ac" to avoid ambiguities.

Saber

ReadNetlist["netfile", Simulator −> "Saber"] reads in Saber netlists. Due to the fact that all ele-ments in Saber MAST are calls to MAST templates, ReadNetlist replaces some template calls withgeneric Analog Insydes elements:

Page 377: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.10 Interfaces 375

MAST template name Analog Insydes type

C Capacitor

CL Capacitor

CAP Capacitor

L Inductor

R Resistor

RES Resistor

SPI_DC CurrentSource

I_DC CurrentSource

I_PULSE CurrentSource

I_SIN CurrentSource

I CurrentSource

SPV_DC VoltageSource

V_DC VoltageSource

V_PULSE VoltageSource

V_SIN VoltageSource

V VoltageSource

MAST templates replaced with generic Analog Insydes elements.

All other elements are converted to

name, n1 −> p1, ,Model −> Model[model, model, name],Selector −> Selector[model, model, name],Parameters −> Parameters[model, model, name],

where name is the name of the element and model is the template name.

Page 378: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

376 3. Reference Manual

3.10.3 ReadSimulationData

ReadSimulationData["file", Simulator−>sim]reads a data file "file" from a simulator sim and convertsits content to the Analog Insydes data format

ReadSimulationData["file", key, Simulator−>sim]reads data sets marked with key

Command structure of ReadSimulationData.

ReadSimulationData returns the result according to the Analog Insydes numerical data for-mat described in Section 3.7.1. It consists of lists of rules, where the variables are assignedInterpolatingFunction objects. Note that Analog Insydes supports a multi-dimensional dataformat.

The return value of ReadSimulationData can be used as first argument to most Analog Insydesgraphics functions such as BodePlot (Section 3.9.1) or TransientPlot (Section 3.9.6) for visualizingthe simulation data.

ReadSimulationData has the following options:

option name default value

InterpolationOrder 1 specifies the interpolation order of theresulting InterpolingFunction

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Simulator Inherited[AnalogInsydes]standard Analog Insydes simulatorspecification (see Section 3.14.6)

Options for ReadSimulationData.

See also: WriteSimulationData (Section 3.10.4), ReadNetlist (Section 3.10.1), BodePlot (Sec-tion 3.9.1), TransientPlot (Section 3.9.6), Simulator (Section 3.14.6), Section 3.7.1.

Options Description

InterpolationOrder

With InterpolationOrder −> integer, you can change the interpolation order of the resulting inter-polating functions. See the Mathematica object InterpolatingFunction .

Page 379: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.10 Interfaces 377

The default setting is InterpolationOrder −> 1, which is linear interpolation.

Simulator

To distinguish between different file formats used by different simulators it is necessary to specifythe simulator which generated the data file. Possible values for Simulator are:

simulator file type

"AnalogInsydes" Mathematica *.m file

"Eldo" Binary *.cou file

"PSpice" CSDF file, *.csd or *.txt

"Saber" SaberScope file

Supported simulators and file types by ReadSimulationData.

If file contains multiple data sets like DC and AC analysis results, a key can be given as a secondargument to ReadSimulationData to distinguish between these sets ("Eldo" and "PSpice" only):

simulator possible keys

"Eldo" "HERTZ", "VOLT", "SEC"

"PSpice" "AC Sweep", "DC Sweep", "Transient"

Simulator-dependent keys for ReadSimulationData.

Please note that the keys may depend on the used simulator version.

The return value has the data format as described in Section 3.7.1. The labels are of type String.

Reading a CSDF file generated with PSpice which contains simulation data from various simulationruns, results in misleading values for SweepParameters.

An Eldo "*.cou" file generated with the Eldo command line option "−dbp" (the default) containsthe complex data expressed as magnitude and phase, with "−ri" as real and imaginary values.ReadSimulationData automatically adds the corresponding complex waveforms.

Only Eldo "*.cou" binary files written with big endian machines are supported.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 380: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

378 3. Reference Manual

Read simulation data fromPSpice data file.

In[2]:= data = ReadSimulationData["AnalogInsydes/DemoFiles/Multivibrator.txt",Simulator −> "PSpice"]

Out[2]=V4 InterpolatingFunction0.00018, 0.00012, ,V5 InterpolatingFunction0.00018, 0.00012, ,SweepParameters VCC 0.,

V4 InterpolatingFunction0.00018, 0.00012, ,V5 InterpolatingFunction0.00018, 0.00012, ,SweepParameters VCC 6.,

V4 InterpolatingFunction0.00018, 0.00012, ,V5 InterpolatingFunction0.00018, 0.00012, ,SweepParameters VCC 12.

The data can easily beplotted withTransientPlot.

In[3]:= TransientPlot[data, "V(4)"[IC], "V(5)"[IC],IC, −0.00018, 0.00012]

-0.00015-0.0001-0.00005 0.000050.0001IC

2

4

6

8

10

V(5)[IC]

V(4)[IC]

Out[3]= Graphics

3.10.4 WriteSimulationData

WriteSimulationData["file", exprs, x, xmin, xmax, Simulator−>sim]writes sampled data of exprs to file for usage withsimulator sim

WriteSimulationData["file", traces, vars, x, xmin, xmax, Simulator−>sim]writes sampled data of the variables vars as a function of xfrom xmin to xmax where traces corresponds to the returnvalue of numerical equation solvers like NDSolve orNDAESolve

Command structure of WriteSimulationData.

WriteSimulationData can be used for displaying Analog Insydes results in a post-processor ofan external design framework. Therefore WriteSimulationData writes different file formats whichare addressed by the option Simulator. WriteSimulationData does not support multi-dimensionaldata.

Page 381: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.10 Interfaces 379

WriteSimulationData has the following options:

option name default value

ComplexValues False whether the data should be written ascomplex numbers

Compiled True if exprs should be compiled

DataLabels Automatic list of strings to give the traces a moreconvenient name

InterpolationOrder 1 specifies the interpolation order of theresulting interpolating functions

PlotPoints 100 number of sample points

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Sampling Linear whether to sample Linear or Exponential

Simulator Inherited[AnalogInsydes]standard Analog Insydes simulatorspecification (see Section 3.14.6)

Options for WriteSimulationData.

See also: ReadSimulationData (Section 3.10.3), Simulator (Section 3.14.6).

Options Description

A detailed description of all WriteSimulationData options is given below in alphabetical order:

ComplexValues

To generate complex-valued data from a small-signal analysis set ComplexValues −> True to writethe data as complex numbers.

The default ComplexValues −> False writes real numbers which can be used for DC and transientanalyses.

Compiled

With Compiled −> True the expression exprs is compiled with the Mathematica command Compilebefore evaluation.

Page 382: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

380 3. Reference Manual

DataLabels

With DataLabels −> string, string, † † † you can specifiy new labels for the return value of exprsor for each variable in vars. This is necessary because post-processors often rely on a special namescheme for trace names. Using a Mathematica expression may irritate the post-processor.

InterpolationOrder

With InterpolationOrder −> integer, you can change the interpolation order of the resulting inter-polating functions which are generated if the option Simulator is set to "AnalogInsydes". See theMathematica object InterpolatingFunction.

The default setting is InterpolationOrder −> 1, which is linear interpolation.

PlotPoints

The option PlotPoints −> integer specifies the number of sample points. The default is 100.

Sampling

With Sampling −> Exponential the functions are sampled exponentially. The default isSampling −> Linear.

Simulator

The following file formats are supported:

simulator file type

"AnalogInsydes" Mathematica *.m file

"PSpice" CSDF file, *.csd or *.txt

"Saber" ASCII SaberScope file

Simulators and file types supported by WriteSimulationData.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Write a SaberScope file. In[2]:= WriteSimulationData["Test.p1.dat",(1. − Exp[−t])*Cos[t], t, 0., 10.,DataLabels −> "F", Simulator −> "Saber"]

Page 383: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.10 Interfaces 381

View the file"Test.p1.dat" withSaberScope. Alternatively,read it again intoMathematica withReadSimulationData .

In[3]:= data = ReadSimulationData["Test.p1.dat",Simulator −> "Saber"]

Out[3]=F InterpolatingFunction0., 10.,

Plot the data withTransientPlot.

In[4]:= TransientPlot[data, "F"[t], t, 0., 10.]

2 4 6 8 10t

-1

-0.5

0.5

1

F[t]

Out[4]= Graphics

3.10.5 WriteModel

WriteModel["file", modelname, dae, ports, connections, Simulator−>sim]converts a DAEObject dae into a simulator-specific modelwith respect to the ports and the defined circuit interfacegiven by connections

Command structure of WriteModel.

The function WriteModel converts a DAEObject dae into a behavioral model for a given simulator.An interface can be defined which connects the model with a circuit. The connections are then givenby a list of rules of the form:

param1 −> Voltage[port1, port2],param2 −> Current[port3, port4],var1 −> Voltage[port5, port6],var2 −> Current[port7, port8]

This interface definition will generate two input port branches from port to port (voltage) and fromport to port (current) and two output branches from port to port (voltage) and from port to port(current).

WriteModel has the following options:

Page 384: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

382 3. Reference Manual

option name default value

DesignPoint Automatic specifies a list of numerical reference valuesfor symbolic element values in a set ofcircuit equations

InitialConditions Automatic specifies alternative initial conditions

InitialGuess Automatic specifies an alternative initial guess

Simulator Inherited[AnalogInsydes]standard Analog Insydes simulatorspecification (see Section 3.14.6)

Options for WriteModel.

Options Description

A detailed description of all WriteModel options is given below in alphabetical order:

DesignPoint

WithDesignPoint −> symbol −> value, † † † you can overwrite the design point given in the DAEObject(see also CircuitEquations in Section 3.5.1). The default setting is DesignPoint −> Automatic,which means to use the design point given in the DAEObject.

InitialConditions

The option InitialConditions allows for explicitly specifying initial conditions. The default set-ting is InitialConditions −> Automatic, which means to use the initial conditions given in theDAEObject. Valid option values are as follows:

Automatic uses initial conditions given in the DAEObject

var == value, † † † uses specified equations as initial conditions

Values for the InitialConditions option.

InitialGuess

The option InitialGuess allows for explicitly specifying an initial guess for the Newton iterationwhen computing the operating point. The default setting is InitialGuess −> Automatic, whichmeans to use the initial guess given in the DAEObject. Possible option values are as follows:

Page 385: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.10 Interfaces 383

Automatic uses initial guess given in the DAEObject

var −> value, † † † uses specified values as initial guess

Values for the InitialGuess option.

Simulator

The following simulator-dependent modeling languages are supported:

simulator model type

"AnalogInsydes" Analog Insydes Model object

"PSpice" netlist model consisting of controlled sources

"Saber" Saber MAST model

Simulators and model types supported by WriteModel.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Read a netlist. In[2]:= net = ReadNetlist["AnalogInsydes/DemoFiles/Multivibrator.cir",Simulator −> "PSpice"]

Out[2]= Circuit

Set up a system ofequations.

In[3]:= dae = CircuitEquations[net,ElementValues −> Symbolic, AnalysisMode −> DC]

Out[3]= DAEDC, 1616

Display the variables ofdae. These variables canbe used as outputs.

In[4]:= GetVariables[dae]

Out[4]=V$1, V$2, V$3, V$4, V$5, I$BS$Q1, I$CS$Q1, I$ES$Q1, ib$Q1, ic$Q1,I$BS$Q2, I$CS$Q2, I$ES$Q2, ib$Q2, ic$Q2, I$VCC

Display the parameters ofdae. These parameters canbe used as inputs.

In[5]:= GetParameters[dae]

Out[5]=AREA$Q1, AREA$Q2, BF$Q1, BF$Q2, BR$Q1, BR$Q2, GMIN, IS$Q1, IS$Q2,R1, R2, R3, R4, R5, TEMP, TNOM, VCC, $k, $q

Page 386: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

384 3. Reference Manual

Generate the Saber MASTmodel test. The firstbranch ("IP" −> "IN")defines IC as thecorresponding inputcurrent. The secondbranch ("VP" −> "VN")defines an input voltageVCC and an output currentI$VCC.

In[6]:= WriteModel["test.sin", "test", dae,"IP", "IN", "VP", "VN",IC −> Current["IP", "IN"], VCC −> Voltage["VP", "VN"],

I$VCC −> Current["VP", "VN"],Simulator −> "Saber"]

Page 387: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.11 Linear Simplification Techniques 385

3.11 Linear Simplification Techniques

A special feature of Analog Insydes is its capability of analyzing large analog circuits symbolicallyby means of symbolic approximation techniques. Analog Insydes provides two different methodsfor computing approximated transfer functions, namely a simplification-before-generation (SBG, seefunction ApproximateMatrixEquation in Section 3.11.3) and a simplification-after-generation method(SAG, see function ApproximateTransferFunction in Section 3.11.2). SBG refers to methods thatsimplify a circuit analysis problem before a symbolic transfer function is generated from a systemof equations or a network graph. SAG algorithms approximate a transfer function by discardinginsignificant terms after the exact expression has been computed.

Furthermore, this section contains the function ComplexityEstimate (Section 3.11.1) for estimatingthe number of product terms in a symbolic transfer function, and the functionCompressMatrixEquation (Section 3.11.4) for compressing a system of matrix equations.

3.11.1 ComplexityEstimate

ComplexityEstimate[dae] estimates the number of product terms in the expandeddeterminant of dae, which must be a system of AC circuitequations in matrix form

ComplexityEstimate[netlist] estimates the complexity of any transfer function calculatedfrom netlist, which must be a flat netlist

Command structure of ComplexityEstimate.

Before you try to solve a system of circuit equations symbolically with Solve (Section 3.5.4), youshould use the function ComplexityEstimate to check whether the computation is feasible at all.ComplexityEstimate computes an estimate of the number of product terms in a transfer functioncomputed from a symbolic matrix equation A x b. More precisely, the function computes a lowerbound for the number of product terms in the determinant of A.

As a rule of thumb, solving a system of circuit equations symbolically is technically feasible if thenumber returned by ComplexityEstimate is less than . If you expect a symbolic expressionto be interpretable, its complexity should be in the range from to .

See also: Statistics (Section 3.6.17).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 388: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

386 3. Reference Manual

Define an AC model forBJTs.

In[2]:= Circuit[Model[

Name −> BJT,Selector −> AC,Scope −> Global,Ports −> B, C, E,Parameters −> Rbe, Cbc, Cbe, beta, Ro,

RBE, CBC, CBE, BETA, RO,Definition −> Netlist[

CBE, B, E, Symbolic −> Cbe, Value −> CBE,RBE, X, E, Symbolic −> Rbe, Value −> RBE,CBC, B, C, Symbolic −> Cbc, Value −> CBC,CC, B, X, C, E,

Symbolic −> beta, Value −> BETA,RO, C, E, Symbolic −> Ro, Value −> RO

]]

] // ExpandSubcircuits;

This netlist describes acommon-emitter amplifier.

In[3]:= ceamplifier =Circuit[

Netlist[V1, 1, 0, 1,V0, 6, 0, 0,C1, 1, 2, Symbolic −> C1, Value −> 1.0*^−7,R1, 2, 6, Symbolic −> R1, Value −> 1.0*^5,R2, 2, 0, Symbolic −> R2, Value −> 47000.,RC, 6, 3, Symbolic −> RC, Value −> 2200.,RE, 4, 0, Symbolic −> RE, Value −> 1000.,C2, 3, 5, Symbolic −> C2, Value −> 1.0*^−6,RL, 5, 0, Symbolic −> RL, Value −> 47000.,Q1, 2 −> B, 3 −> C, 4 −> E,

Model −> BJT, Selector −> AC,CBE −> 30.*^−12, CBC −> 5.*^−12, RBE −> 1000.,RO −> 10000., BETA −> 200.

]]

Out[3]= Circuit

Set up a system ofsymbolic AC equations.

In[4]:= eqs = CircuitEquations[ceamplifier,ElementValues −> Symbolic]

Out[4]= DAEAC, 1010

Compute the complexityestimate.

In[5]:= ComplexityEstimate[eqs]

Out[5]= 132

The number returned by ComplexityEstimate indicates that solving the equations for any transferfunction is feasible, but the result cannot be expected to yield much insight into circuit behavior.

Page 389: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.11 Linear Simplification Techniques 387

Compute the voltagetransfer functionsymbolically and expandthe result.

In[6]:= solution = Solve[eqs, V$5];v5 = Together[V$5 /. First[solution]]

Out[7]=C2 R1 R2 RC RL s C1 RE s beta$Q1 C1 Ro$Q1 s C1 Cbc$Q1 Rbe$Q1 RE s2

C1 Cbe$Q1 Rbe$Q1 RE s2 C1 Cbc$Q1 Rbe$Q1 Ro$Q1 s2 C1 Cbc$Q1 RE Ro$Q1 s2 beta$Q1 C1 Cbc$Q1 RE Ro$Q1 s2 C1 Cbc$Q1 Cbe$Q1 Rbe$Q1 RE Ro$Q1 s3

R1 R2 RC R1 Rbe$Q1 RC R2 Rbe$Q1 RC R1 R2 RE R1 Rbe$Q1 RE R2 Rbe$Q1 RE R1 RC RE R2 RC RE R1 R2 Ro$Q1 R1 Rbe$Q1 Ro$Q1 R2 Rbe$Q1 Ro$Q1 R1 RE Ro$Q1 beta$Q1 R1 RE Ro$Q1 R2 RE Ro$Q1 beta$Q1 R2 RE Ro$Q1 C1 R1 R2 Rbe$Q1 RC s Cbc$Q1 R1 R2 Rbe$Q1 RC s Cbe$Q1 R1 R2 Rbe$Q1 RC s C1 R1 R2 Rbe$Q1 RE s 94 C2 Cbe$Q1 R2 Rbe$Q1 RE RL Ro$Q1 s2 C2 Cbc$Q1 R1 RC RE RL Ro$Q1 s2 beta$Q1C2 Cbc$Q1 R1 RC RE RL Ro$Q1 s2 C2 Cbc$Q1 R2 RC RE RL Ro$Q1 s2 beta$Q1 C2 Cbc$Q1 R2 RC RE RL Ro$Q1 s2 C1 C2 Cbc$Q1R1 R2 Rbe$Q1 RC RE RL s3 C1 C2 Cbe$Q1 R1 R2 Rbe$Q1 RC RE RL s3 C1 C2 Cbe$Q1 R1 R2 Rbe$Q1 RC RE Ro$Q1 s3 C1Cbc$Q1 Cbe$Q1 R1 R2 Rbe$Q1 RC RE Ro$Q1 s3 C2 Cbc$Q1 Cbe$Q1 R1 R2Rbe$Q1 RC RE Ro$Q1 s3 C1 C2 Cbc$Q1 R1 R2 Rbe$Q1 RC RL Ro$Q1 s3 C2 Cbc$Q1 Cbe$Q1 R1 R2 Rbe$Q1 RC RL Ro$Q1 s3 C1 C2 Cbe$Q1 R1 R2 Rbe$Q1 RE RL Ro$Q1 s3 C2 Cbc$Q1 Cbe$Q1R1 R2 Rbe$Q1 RE RL Ro$Q1 s3 C1 C2 Cbc$Q1 R1 R2 RC RE RL Ro$Q1 s3 beta$Q1 C1 C2 Cbc$Q1 R1 R2 RC RE RL Ro$Q1 s3 C2 Cbc$Q1 Cbe$Q1 R1 Rbe$Q1 RC RE RL Ro$Q1 s3 C2 Cbc$Q1 Cbe$Q1 R2 Rbe$Q1 RC RE RL Ro$Q1 s3 C1 C2 Cbc$Q1 Cbe$Q1 R1 R2 Rbe$Q1 RC RE RL Ro$Q1 s4

Here, the complexity estimate is identical to the true number of terms in the denominator of thesymbolic transfer function. In the general case, the estimate yields a lower bound for this number.

Determine number ofterms in the denominatorof the transfer function.

In[8]:= Length[Denominator[v5]]

Out[8]= 132

3.11.2 ApproximateTransferFunction

ApproximateTransferFunction[expr, fvar, dp, error]approximates the transfer function expr by discardinginsignificant terms where fvar, dp, and error denote thecomplex frequency variable, the design point, and thebound for the coefficient error

Command structure of ApproximateTransferFunction.

ApproximateTransferFunction approximates a symbolic transfer function by discarding insignifi-cant terms from its coefficients (simplification after generation, SAG). The significance or insignifi-cance of a term is evaluated on the basis of numerical reference values for the symbols (the designpoint). For each coefficient, the algorithm removes the numerically least significant terms until themaximum coefficient error is reached.

Page 390: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

388 3. Reference Manual

The fourth argument of ApproximateTransferFunction denotes the maximum coefficienterror. It does not constitute a bound on the absolute error of a transfer function. Theabsolute error may be larger or lower than the maximum coefficient error.

See also: ApproximateMatrixEquation (Section 3.11.3).

Examples

Below, we approximate the transfer function of the common-emitter amplifier. We allow for amaximum error of in all coefficients of powers of the complex frequency s.

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define an AC model forBJTs.

In[2]:= Circuit[Model[

Name −> BJT,Selector −> AC,Scope −> Global,Ports −> B, C, E,Parameters −> Rbe, Cbc, Cbe, beta, Ro,

RBE, CBC, CBE, BETA, RO,Definition −> Netlist[

CBE, B, E, Symbolic −> Cbe, Value −> CBE,RBE, X, E, Symbolic −> Rbe, Value −> RBE,CBC, B, C, Symbolic −> Cbc, Value −> CBC,CC, B, X, C, E,

Symbolic −> beta, Value −> BETA,RO, C, E, Symbolic −> Ro, Value −> RO

]]

] // ExpandSubcircuits;

This netlist describes acommon-emitter amplifier.

In[3]:= ceamplifier =Circuit[

Netlist[V1, 1, 0, 1,V0, 6, 0, 0,C1, 1, 2, Symbolic −> C1, Value −> 1.0*^−7,R1, 2, 6, Symbolic −> R1, Value −> 1.0*^5,R2, 2, 0, Symbolic −> R2, Value −> 47000.,RC, 6, 3, Symbolic −> RC, Value −> 2200.,RE, 4, 0, Symbolic −> RE, Value −> 1000.,C2, 3, 5, Symbolic −> C2, Value −> 1.0*^−6,RL, 5, 0, Symbolic −> RL, Value −> 47000.,Q1, 2 −> B, 3 −> C, 4 −> E,

Model −> BJT, Selector −> AC,CBE −> 30.*^−12, CBC −> 5.*^−12, RBE −> 1000.,RO −> 10000., BETA −> 200.

]]

Out[3]= Circuit

Page 391: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.11 Linear Simplification Techniques 389

Set up a system ofsymbolic AC equations.

In[4]:= eqs = CircuitEquations[ceamplifier,ElementValues −> Symbolic]

Out[4]= DAEAC, 1010

Compute the complexityestimate.

In[5]:= ComplexityEstimate[eqs]

Out[5]= 132

Compute the voltagetransfer functionsymbolically and extractthe result from thesolution vector.

In[6]:= solution = Solve[eqs, V$5];v5 = Together[V$5 /. First[solution]]

Out[7]=C2 R1 R2 RC RL s C1 RE s beta$Q1 C1 Ro$Q1 s C1 Cbc$Q1 Rbe$Q1 RE s2

C1 Cbe$Q1 Rbe$Q1 RE s2 C1 Cbc$Q1 Rbe$Q1 Ro$Q1 s2 C1 Cbc$Q1 RE Ro$Q1 s2 beta$Q1 C1 Cbc$Q1 RE Ro$Q1 s2 C1 Cbc$Q1 Cbe$Q1 Rbe$Q1 RE Ro$Q1 s3

R1 R2 RC R1 Rbe$Q1 RC R2 Rbe$Q1 RC R1 R2 RE R1 Rbe$Q1 RE R2 Rbe$Q1 RE R1 RC RE R2 RC RE R1 R2 Ro$Q1 R1 Rbe$Q1 Ro$Q1 R2 Rbe$Q1 Ro$Q1 R1 RE Ro$Q1 beta$Q1 R1 RE Ro$Q1 R2 RE Ro$Q1 beta$Q1 R2 RE Ro$Q1 C1 R1 R2 Rbe$Q1 RC s Cbc$Q1 R1 R2 Rbe$Q1 RC s Cbe$Q1 R1 R2 Rbe$Q1 RC s C1 R1 R2 Rbe$Q1 RE s 94 C2 Cbe$Q1 R2 Rbe$Q1 RE RL Ro$Q1 s2 C2 Cbc$Q1 R1 RC RE RL Ro$Q1 s2 beta$Q1C2 Cbc$Q1 R1 RC RE RL Ro$Q1 s2 C2 Cbc$Q1 R2 RC RE RL Ro$Q1 s2 beta$Q1 C2 Cbc$Q1 R2 RC RE RL Ro$Q1 s2 C1 C2 Cbc$Q1R1 R2 Rbe$Q1 RC RE RL s3 C1 C2 Cbe$Q1 R1 R2 Rbe$Q1 RC RE RL s3 C1 C2 Cbe$Q1 R1 R2 Rbe$Q1 RC RE Ro$Q1 s3 C1Cbc$Q1 Cbe$Q1 R1 R2 Rbe$Q1 RC RE Ro$Q1 s3 C2 Cbc$Q1 Cbe$Q1 R1 R2Rbe$Q1 RC RE Ro$Q1 s3 C1 C2 Cbc$Q1 R1 R2 Rbe$Q1 RC RL Ro$Q1 s3 C2 Cbc$Q1 Cbe$Q1 R1 R2 Rbe$Q1 RC RL Ro$Q1 s3 C1 C2 Cbe$Q1 R1 R2 Rbe$Q1 RE RL Ro$Q1 s3 C2 Cbc$Q1 Cbe$Q1R1 R2 Rbe$Q1 RE RL Ro$Q1 s3 C1 C2 Cbc$Q1 R1 R2 RC RE RL Ro$Q1 s3 beta$Q1 C1 C2 Cbc$Q1 R1 R2 RC RE RL Ro$Q1 s3 C2 Cbc$Q1 Cbe$Q1 R1 Rbe$Q1 RC RE RL Ro$Q1 s3 C2 Cbc$Q1 Cbe$Q1 R2 Rbe$Q1 RC RE RL Ro$Q1 s3 C1 C2 Cbc$Q1 Cbe$Q1 R1 R2 Rbe$Q1 RC RE RL Ro$Q1 s4

Get the design-pointinformation from theDAEObject.

In[8]:= dp = GetDesignPoint[eqs]

Out[8]=C1 1.107, R1 100000., R2 47000., RC 2200., RE 1000.,

C2 1.106, RL 47000., Cbe$Q1 3.1011, Rbe$Q1 1000.,Cbc$Q1 5.1012, beta$Q1 200., Ro$Q1 10000.

Discard insignificant termsin the transfer function.

In[9]:= sag = ApproximateTransferFunction[v5, s, dp, 0.2]

Out[9]=beta$Q1 C1 C2 R1 R2 RC RL Ro$Q1 s2

beta$Q1 C1 C2 Cbc$Q1 R1 R2 RC RE RL Ro$Q1 s3 C1 C2 Cbc$Q1 Cbe$Q1 R1 R2 Rbe$Q1 RC RE RL Ro$Q1 s4 R1 R2 Ro$Q1 beta$Q1 R1 RE Ro$Q1 beta$Q1 R2 RE Ro$Q1 C2 R1 R2 RL Ro$Q1

beta$Q1 C2 R1 RE RL Ro$Q1 beta$Q1 C2 R2 RE RL Ro$Q1 s beta$Q1 C1 C2 R1 R2 RE RL Ro$Q1 s2 beta$Q1 C1 C2 Cbc$Q1 R1 R2 RC RE RL Ro$Q1 s3 C1 C2 Cbc$Q1 Cbe$Q1 R1 R2 Rbe$Q1 RC RE RL Ro$Q1 s4

Page 392: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

390 3. Reference Manual

Determine the complexityof the approximatedexpression.

In[10]:= Length[Denominator[sag]]

Out[10]= 7

Simplify the result. In[11]:= Simplify[sag]

Out[11]=C1 C2 R1 R2 RC RL s2

Cbc$Q1 Cbe$Q1 Rbe$Q1 RE s2 beta$Q1 1 Cbc$Q1 RE s beta$Q1 R2 RE 1 C2 RL s R1 beta$Q1 RE 1 C2 RL s R2 1 C2 RL s

beta$Q1 C1 C2 RE RL s2 beta$Q1 C1 C2 Cbc$Q1 RC RE RL s3 C1 C2 Cbc$Q1 Cbe$Q1 Rbe$Q1 RC RE RL s4

To validate the result, we compute the frequency response of the original system numerically andcompare it graphically with the approximated result.

Compute the frequencyresponse numerically.

In[12]:= acsweep = ACAnalysis[eqs, V$5, f, 1, 1.0*^9]

Out[12]=V$5 InterpolatingFunction1., 1.109,

Evaluate the approximatedexpression numerically.

In[13]:= sagn[s_] = sag /. dp

Out[13]=9.71961010 s2 485.98 s3 7.2897108 s4 3.411014

1.60271013 s 4.4181010 s2 485.98 s3 7.2897108 s4

Plot the exact andapproximated functionstogether.

In[14]:= BodePlot[acsweep, V$5[f], sagn[2 Pi I f],f, 1, 1.0*^9, TraceNames −> "Exact", "Approximated"]

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-10-7.5-5

-2.50

2.55

Magnitude (dB) 1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-350-300-250-200-150-100-50

0

Phase (deg)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

Exact Approximated

Out[14]= Graphics

Page 393: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.11 Linear Simplification Techniques 391

3.11.3 ApproximateMatrixEquation

ApproximateMatrixEquation[dae, var, errspec]approximates a symbolic matrix equation dae with respectto the output variable var and the error specification errspec

Command structure of ApproximateMatrixEquation.

The function ApproximateMatrixEquation approximates a linear symbolic matrix equation by dis-carding insignificant matrix entries before the system is solved (simplification before generation,SBG). The significance of a symbolic matrix entry is determined by calculating its numerical influ-ence on the magnitude of the transfer function in one or several frequency sampling points. Theapproximation process follows a term ranking obtained by computing the large-change sensitivities ofthe output variable with respect to all matrix entries and sorting the resulting list by least influence.The algorithm deletes all matrix entries whose cumulative influence is less than the user-specifiederror bound. The error specification errspec has to be given in the following form:

fvar−>freq, MaxError−>maxerr error specification for a single frequency sampling point

fvar−>freq, MaxError−>maxerr, fvar−>freq, MaxError−>maxerr, † † † error specification for several frequency sampling points

Format for sampling point and error specifications.

For a given errspec, the algorithm assures that the relative magnitude deviation of the outputvariable var measured at the frequency points fvar = freqi is less than maxerri.

To approximate the frequency response of a dynamic circuit, sampling points must beplaced on the imaginary axis where s jΩ, or equivalently s Πj f . Therefore, you shouldspecify frequency sampling points in the form s −> 2. Pi I f.

By placing sampling points to the left and right of a corner in a frequency response, you canuse ApproximateMatrixEquation to extract poles and zeros symbolically.

For optimal approximation results, you should set up circuit equations in Sparse Tableauformulation (Formulation −> SparseTableau, see Section 3.5.1).

ApproximateMatrixEquation has the following options:

Page 394: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

392 3. Reference Manual

option name default value

AbsolutePivotThreshold1.0*10^−8 the absolute pivot threshold for the sparse

matrix solver used in the MathLink binaryMSBG.exe

CompressEquations False whether to compress the matrix equationafter approximation

DesignPoint Automatic the numerical reference data for the symbols

NumericalAccuracy 1.0*10^−8 the numerical accuracy threshold forranking recomputations

PivotThreshold 0.01 the relative pivot threshold for the sparsematrix solver used in the MathLink binaryMSBG.exe

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Options for ApproximateMatrixEquation, Part I.

option name default value

QuasiSingularity 1.0*10^−15 threshold for detecting numericalsingularities

RecomputationThreshold2.0 threshold for triggering a ranking

recomputation

SortingMethod PrimaryDesignPointhow to sort the list of matrix entryinfluences to obtain a term ranking

StripIndependentBlocksFalse whether to search for and discard

algebraically independent blocks from amatrix equation after approximation

UseExternals Inherited[AnalogInsydes]whether to use the MathLink binaryMSBG.exe (see Section 3.14.7)

Options for ApproximateMatrixEquation, Part II.

Page 395: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.11 Linear Simplification Techniques 393

See also: ApproximateTransferFunction (Section 3.11.2).

Options Description

A detailed description of all ApproximateMatrixEquation options is given below in alphabeticalorder:

AbsolutePivotThreshold

With AbsolutePivotThreshold −> posreal you can specify the minimum absolute value a matrixentry must have to be considered as a pivot candidate during LU decomposition. There is noneed to change the value of this option unless ApproximateMatrixEquation reports problems withill-conditioned equations.

CompressEquations

The setting CompressEquations −> True causes the matrix equation to be compressed after ap-proximation. The option is realized by an internal call of the function CompressMatrixEquation(Section 3.11.4). You should turn matrix compression on whenever you are working with largematrices, i.e. when the matrix dimensions are significantly larger than .

DesignPoint

With DesignPoint −> symbol −> value, † † † you can overwrite the design point given in theDAEObject. The default setting is DesignPoint −> Automatic, which means to use the designpoint stored in the DAEObject.

NumericalAccuracy

The option NumericalAccuracy −> posreal specifies the minimum influence a matrix entry must haveto trigger a recomputation of the term ranking. This threshold is used to prevent frequent rankingrecomputations due to numerical inaccuracies in very small influence values.

If the ranking is recomputed too often at the beginning of the approximation process, you shouldincrease the value of NumericalAccuracy by an order of magnitude. Note that information aboutranking recomputations is available only if UseExternals −> False and Protocol −> Notebook.

See also the description of RecomputationThreshold.

PivotThreshold

With PivotThreshold −> posreal you can specify the minimum relative magnitude a matrix entrymust have to be considered as a pivot candidate during LU decomposition. The value posreal mustbe a number between and . If it is , then the pivoting method becomes complete pivoting,

Page 396: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

394 3. Reference Manual

which is very slow and tends to fill up the matrix. If it is set close to zero, the pivoting methodbecomes strict Markowitz with no threshold. There is no need to change the value of this optionunless ApproximateMatrixEquation reports problems with ill-conditioned equations.

Protocol

This option describes the standard Analog Insydes protocol specification (see Section 3.14.5). Notethat detailed protocol information is not available if UseExternals −> True.

QuasiSingularity

QuasiSingularity −> posreal specifies a threshold value for determining whether a matrix is nu-merically singular. In case the matrix approximation function returns a singular matrix, increase thevalue of QuasiSingularity by one or several orders of magnitude.

RecomputationThreshold

RecomputationThreshold −> posreal specifies a factor for determining whether the current termranking should be recomputed. For example, a value of means that a ranking recomputation istriggered if the true influence of a matrix entry at the current approximation step turns out to be twotimes larger than predicted initially. Ranking recomputations are triggered only by influence valuesgreater than the value of NumericalAccuracy.

SortingMethod

The option SortingMethod specifies how the list of matrix entry influences is sorted to obtain a termranking.

PrimaryDesignPoint sort matrix entries by least influence on the primarydesign-point solution

LeastMeanInfluence sort matrix entries by mean influence on all design-pointsolutions

Values for the SortingMethod option.

With the default setting SortingMethod −> PrimaryDesignPoint, the influence list is sorted byinfluence on the solution of the matrix equation at the first sampling point specified in errspec. Thesetting SortingMethod −> LeastMeanInfluence causes the least to be sorted by average influenceon the solutions at all sampling points.

The setting of the SortingMethod option is relevant only if you specify more than one samplingpoint. In general, SortingMethod −> LeastMeanInfluence is the preferred setting for multiplesampling points.

Page 397: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.11 Linear Simplification Techniques 395

StripIndependentBlocks

With StripIndependentBlocks −> True, clusters of equations which are decoupled from the vari-able of interest, are searched for and discarded after approximation. This option is effective only inconjunction with the setting CompressEquations −> True.

UseExternals

The setting UseExternals −> True causes the MathLink application MSBG.exe to be used for matrixapproximation. This is the recommended setting for all platforms for which native Analog Insydesversions exist. You can set UseExternals −> False to run Analog Insydes on other platforms orfor debugging purposes in conjunction with the option Protocol. Alternatively, you can also loadand unload the module manually as described in Section 3.13.3. For more information refer toUseExternals (Section 3.14.7).

Examples

In the following we approximate the system of nodal equations representing the small-signal equiv-alent circuit of the common-emitter amplifier with respect to the output variable V$5. To obtain anapproximation of the amplifier’s passband voltage gain, we select a sampling frequency of kHz.At the sampling point we allow the magnitude of the solution of the approximated equations todeviate from the original design-point value by .

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define an AC model forBJTs.

In[2]:= Circuit[Model[

Name −> BJT,Selector −> AC,Scope −> Global,Ports −> B, C, E,Parameters −> Rbe, Cbc, Cbe, beta, Ro,

RBE, CBC, CBE, BETA, RO,Definition −> Netlist[

CBE, B, E, Symbolic −> Cbe, Value −> CBE,RBE, X, E, Symbolic −> Rbe, Value −> RBE,CBC, B, C, Symbolic −> Cbc, Value −> CBC,CC, B, X, C, E,

Symbolic −> beta, Value −> BETA,RO, C, E, Symbolic −> Ro, Value −> RO

]]

] // ExpandSubcircuits;

Page 398: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

396 3. Reference Manual

This netlist describes acommon-emitter amplifier.

In[3]:= ceamplifier =Circuit[

Netlist[V1, 1, 0, 1,V0, 6, 0, 0,C1, 1, 2, Symbolic −> C1, Value −> 1.0*^−7,R1, 2, 6, Symbolic −> R1, Value −> 1.0*^5,R2, 2, 0, Symbolic −> R2, Value −> 47000.,RC, 6, 3, Symbolic −> RC, Value −> 2200.,RE, 4, 0, Symbolic −> RE, Value −> 1000.,C2, 3, 5, Symbolic −> C2, Value −> 1.0*^−6,RL, 5, 0, Symbolic −> RL, Value −> 47000.,Q1, 2 −> B, 3 −> C, 4 −> E,

Model −> BJT, Selector −> AC,CBE −> 30.*^−12, CBC −> 5.*^−12, RBE −> 1000.,RO −> 10000., BETA −> 200.

]]

Out[3]= Circuit

Set up a system ofsymbolic AC equations.

In[4]:= eqs = CircuitEquations[ceamplifier,ElementValues −> Symbolic]

Out[4]= DAEAC, 1010

Compute the complexityestimate.

In[5]:= ComplexityEstimate[eqs]

Out[5]= 132

Allow for magnitudeerror at kHz.

In[6]:= errspec = s −> 2. Pi I 10^4, MaxError −> 0.1

Out[6]= s 62831.9 I, MaxError 0.1

Approximate the system ofcircuit equations.

In[7]:= sbg = ApproximateMatrixEquation[eqs, V$5, errspec]

Out[7]= DAEAC, 1010

Estimate the number ofterms after approximation.

In[8]:= ComplexityEstimate[sbg]

Out[8]= 1

Compute the solution ofthe approximatedequations.

In[9]:= sbgresult = Solve[sbg, V$5]

Out[9]= V$5 RCRE

To validate the result, we compute the frequency response of the original system numerically andcompare it graphically with the approximated result.

Compute the frequencyresponse numerically.

In[10]:= acsweep = ACAnalysis[eqs, V$5, f, 1, 1.0*^9]

Out[10]=V$5 InterpolatingFunction1., 1.109,

Evaluate the approximatedexpression numerically.

In[11]:= sbgn = V$5 /. First[sbgresult] /. GetDesignPoint[eqs]

Out[11]= 2.2

Note that the approximated expression is valid only within the passband because we did not specifysampling points at low or high frequencies.

Page 399: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.11 Linear Simplification Techniques 397

Plot the exact andapproximated functionstogether.

In[12]:= BodePlot[acsweep, V$5[f], sbgn,f, 1, 1.0*^9, TraceNames −> "Exact", "Approximated"]

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-10

-5

0

5

10

Magnitude (dB) 1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-350-300-250-200-150-100-50

0

Phase (deg)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

Exact Approximated

Out[12]= Graphics

Below, we specify a second sampling point at Hz to extend the validity region of the approximationto low frequencies. Note that you may use a different error bound for each sampling point.

Add a second samplingpoint at Hz.

In[13]:= errspec2 = errspec, s −> 2. Pi I, MaxError −> 0.3

Out[13]=s 62831.9 I, MaxError 0.1, s 6.28319 I, MaxError 0.3

Approximate the matrixequation.

In[14]:= sbg2 = ApproximateMatrixEquation[eqs, V$5, errspec2,SortingMethod −> LeastMeanInfluence]

Out[14]= DAEAC, 1010

Estimate the number ofterms after approximation.

In[15]:= ComplexityEstimate[sbg2]

Out[15]= 9

Solve the approximatedequations.

In[16]:= sbgresult2 = Solve[sbg2, V$5] // Simplify

Out[16]=

V$5 C1 C2 R1 R2 RC RL s2

RE R1 R2 C1 R1 R2 s 1 C2 RC RL s

Extract the solution forV$5.

In[17]:= v52 = V$5 /. First[sbgresult2]

Out[17]= C1 C2 R1 R2 RC RL s2

RE R1 R2 C1 R1 R2 s 1 C2 RC RL s

Evaluate the approximatedexpression numerically.

In[18]:= sbgn2[s_] = v52 /. GetDesignPoint[eqs]

Out[18]= 48.598 s2

1 0.0492 s 147000. 470. s

Page 400: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

398 3. Reference Manual

Plot the exact andapproximated functionstogether.

In[19]:= BodePlot[acsweep, V$5[f], sbgn2[2. Pi I f],f, 1, 1.0*^9, TraceNames −> "Exact", "Approximated"]

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-10-7.5-5

-2.50

2.55

Magnitude (dB) 1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8Frequency

-350-300-250-200-150-100-50

0

Phase (deg)

1.0E0 1.0E2 1.0E4 1.0E6 1.0E8

Exact Approximated

Out[19]= Graphics

Note that matrix approximation has reduced the polynomial order of the transfer function from fourto two. Therefore, we can now solve the transfer function for the low-frequency poles.

Solve for thelow-frequency poles.

In[20]:= Solve[Denominator[v52] == 0, s]

Out[20]= s R1 R2C1 R1 R2

, s 1

C2 RC RL

3.11.4 CompressMatrixEquation

CompressMatrixEquation[dae, var]compresses the matrix equation dae with respect to thevariable of interest var

Command structure of CompressMatrixEquation.

Computing a transfer function from a linear system of circuit equations A x b requires solvingthe matrix equation for one single variable xk. The values of all other variables xj, j , k, are ofno interest in this context. Systems of circuit equations usually contain a significant amount ofinformation which is only needed to determine the irrelevant variables, and the proportion of suchinformation increases during the approximation process as equations are algebraically decoupled byremoving negligible terms.

To reduce the computational effort needed for solving an approximated matrix, all unnecessaryinformation should be discarded from the equations prior to calling Solve (Section 3.5.4), using thefunction CompressMatrixEquation . This function performs a recursive search on a matrix equationto find and delete all rows and columns which are not needed to compute the variable of interest.Note that compressing a matrix equation is a mathematically exact operation which does not changethe value of the output variable.

Page 401: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.11 Linear Simplification Techniques 399

CompressMatrixEquation has the following option:

option name default value

StripIndependentBlocksFalse whether to search for and discard

algebraically independent blocks which aredecoupled from the variable of interest

Option for CompressMatrixEquation.

See also: CompressNonlinearEquations (Section 3.12.2),ApproximateMatrixEquation (Section 3.11.3).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define an AC model forBJTs.

In[2]:= Circuit[Model[

Name −> BJT,Selector −> AC,Scope −> Global,Ports −> B, C, E,Parameters −> Rbe, Cbc, Cbe, beta, Ro,

RBE, CBC, CBE, BETA, RO,Definition −> Netlist[

CBE, B, E, Symbolic −> Cbe, Value −> CBE,RBE, X, E, Symbolic −> Rbe, Value −> RBE,CBC, B, C, Symbolic −> Cbc, Value −> CBC,CC, B, X, C, E,

Symbolic −> beta, Value −> BETA,RO, C, E, Symbolic −> Ro, Value −> RO

]]

] // ExpandSubcircuits;

Page 402: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

400 3. Reference Manual

This netlist describes acommon-emitter amplifier.

In[3]:= ceamplifier =Circuit[

Netlist[V1, 1, 0, 1,V0, 6, 0, 0,C1, 1, 2, Symbolic −> C1, Value −> 1.0*^−7,R1, 2, 6, Symbolic −> R1, Value −> 1.0*^5,R2, 2, 0, Symbolic −> R2, Value −> 47000.,RC, 6, 3, Symbolic −> RC, Value −> 2200.,RE, 4, 0, Symbolic −> RE, Value −> 1000.,C2, 3, 5, Symbolic −> C2, Value −> 1.0*^−6,RL, 5, 0, Symbolic −> RL, Value −> 47000.,Q1, 2 −> B, 3 −> C, 4 −> E,

Model −> BJT, Selector −> AC,CBE −> 30.*^−12, CBC −> 5.*^−12, RBE −> 1000.,RO −> 10000., BETA −> 200.

]]

Out[3]= Circuit

Set up a system ofsymbolic AC equations.

In[4]:= eqs = CircuitEquations[ceamplifier,ElementValues −> Symbolic]

Out[4]= DAEAC, 1010

Approximate the system ofcircuit equations.

In[5]:= sbg = ApproximateMatrixEquation[eqs, V$5,s −> 2. Pi I 10^4, MaxError −> 0.1]

Out[5]= DAEAC, 1010

Inspect the list ofunknowns in the matrixequation.

In[6]:= GetVariables[sbg]

Out[6]=V$1, V$2, V$3, V$4, V$5, V$6, V$X$Q1, I$V1, I$V0, IC$CC$Q1

Solve the equations forV$5.

In[7]:= Solve[sbg, V$5]

Out[7]= V$5 RCRE

Discard rows and columnswhich are not needed tocompute V$5.

In[8]:= cmat = CompressMatrixEquation[sbg, V$5]

Out[8]= DAEAC, 77

Inspect the list ofremaining unknowns.

In[9]:= GetVariables[cmat]

Out[9]= V$1, V$2, V$3, V$4, V$5, V$X$Q1, IC$CC$Q1Note that matrix compression does not change the solution of the equations.

Solve the compressedequations for V$5.

In[10]:= Solve[cmat, V$5]

Out[10]= V$5 RCRE

Page 403: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.12 Nonlinear Simplification Techniques 401

3.12 Nonlinear Simplification Techniques

As of version 2, Analog Insydes provides completely new functionality for the simplification of non-linear circuits: Besides the main functions CompressNonlinearEquations and CancelTerms, thereare a number of supporting procedures. The following table shows all commands which build thesimplification functionality for nonlinear circuits:

NonlinearSetup (Section 3.12.1) setting up the nonlinear approximation procedure

CompressNonlinearEquations (Section 3.12.2)eliminating variables in a DAEObject

CancelTerms (Section 3.12.3) removing terms in different levels in a DAEObject

SimplifySamplePoints (Section 3.12.4)generating sparsed sample-point grids

NonlinearSettings (Section 3.12.5)showing nonlinear settings in a DAEObject

ShowLevel (Section 3.12.6) showing terms of a DAEObject in different levels

ShowCancellations (Section 3.12.7)showing terms of a DAEObject which have been removed

3.12.1 NonlinearSetup

NonlinearSetup[dae, inputs, outputs, mode−>settings, † † † ]initializes the nonlinear approximation routines

Command structure of NonlinearSetup.

Before applying the nonlinear simplification routines the DAEObject has to be set up usingNonlinearSetup. This function returns a DAEObject containing additional information which isautomatically used later on by the simplification functions. Furthermore, NonlinearSetup performsthe numerical reference simulations which are used for error calculation. Besides the input and outputvariables you have to specify which analysis modes to consider during subsequent simplifications.

The DAEObject dae has to be a DC or Transient DAEObject. The argument inputs is a symbol ora list of symbols denoting the input parameters to be swept. In this context input parameters areparameters of the DAEObject (not variables). Use GetParameters (Section 3.6.9) to obtain a list ofvalid parameters. Further, outputs is a symbol or a list of symbols denoting the output variableswhich are used for error control. In this context output variables are variables of the DAEObject (notparameters). Use GetVariables (Section 3.6.7) to obtain a list of valid variables.

Page 404: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

402 3. Reference Manual

The rules modei −> settingsi specify the analysis modes to be used during error control and somemode-specific settings for the simplification routines. Here, modei can be DT (DC-transfer analysis) orAC. If the AC analysis is chosen, DT settings have to be specified, too. The mode settings settingsiare given by a sequence of rules. The format is described below.

Additionally, NonlinearSetup provides the following option:

option name default value

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Options for NonlinearSetup.

You can use NonlinearSettings (Section 3.12.5) to inspect the settings of the nonlinear simplifica-tions currently stored in a DAEObject. Use GetDAEOptions[dae, NonlinearOptions] to get a list ofall nonlinear simplification settings stored in the DAEObject.

See also: GetVariables (Section 3.6.7), GetParameters (Section 3.6.9), NonlinearSettings (Sec-tion 3.12.5), Section 3.7.2.

DT mode specifications

Range−>paramsweep parameter sweep specification for all input variables

SimulationFunction−>simfct simulation function used for DT analysis; default value:DefaultDTSimulation

ErrorFunction−>errfct error function used for DT analysis; default value:DefaultDTError

MaxError−>errlist Maximum error specification for the output variables;default value:

Settings for DT mode.

The range in which to sweep the input parameters during simplification is specified by the paramsweepvalue of the Range option. The range specification has to be given in the standard format for AnalogInsydes parameter sweeps which is described in Section 3.7.2. Note that you have to specify a rangefor each input parameter.

SimulationFunction, ErrorFunction, and MaxError are optional, whereas Range is a requiredargument.

If no SimulationFunction option is specified, the default function is used. The default DT simu-lation function DefaultDTSimulation calls NDAESolve (Section 3.7.5) to calculate the DC operating

Page 405: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.12 Nonlinear Simplification Techniques 403

points. DefaultDTSimulation inherits almost all options from NDAESolve. The following optionshave a special meaning when used with DefaultDTSimulation:

option name default value

MaxIterations Inherited[NDAESolve]maximum number of iterations forNDAESolve (only used if optionInitialGuess is set to Automatic)

InitialGuess None if set to Automatic, the values of thereference simulation are used as initialguess for NDAESolve

Options for DefaultDTSimulation.

Besides the default simulation function you can define your own DT simulation function and specifyit as SimulationFunction in the DT mode settings for NonlinearSetup. During the setup and thenonlinear simplifications this function will be called with the following arguments:

simfct[dae_, refsim_List:, opts___]

Pattern for a user-defined DT simulation function.

Here, dae is a DC or Transient DAEObject, refsim is the list of numerical reference values and optsare additional options.

The simulation function must return the DC operating points in the same format as NDAESolvereturns DC operating points of a parameter sweep (see Section 3.7.2).

Similarly, you can define your own DT error function instead of the default error function andspecify it as ErrorFunction in the DT mode settings for NonlinearSetup. During the simplificationroutines this function is used to calculate the error with the following arguments:

errfct[newval_List, oldval_List, outputsymbols_List]

Pattern for a user-defined DT error function.

Here, newval and oldval are the numerical solutions of the simplified and the original DAE system,outputsymbols is a list of all output symbols.

The error function must return a list of rules symb −> err, † † † , which specifies the numerical errorfor each output symbol. The default DT error function calculates the maximum absolute error.

An example for a user-defined simulation and error function and of the corresponding call toNonlinearSetup is given in the example section below.

Page 406: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

404 3. Reference Manual

Instead of specifying the maximum allowed error for output variables for each call to the nonlinearsimplifications routines separately, you can specify global maximum errors for output variables usingthe MaxError argument. These values are used if no error value is given in the call to the nonlinearsimplification routine. The value of this argument has to be a list of rules of the form outvar −> error.

AC mode specifications

Range−>paramsweep, freqlist, sourcevalparamsweep must be a subset of the sweep given in the DTsettings, freqlist is a list of frequency points and sourceval isa list of replacement rules for all AC sources

SimulationFunction−>simfct simulation function used for AC analysis; default value:DefaultACSimulation

ErrorFunction−>errfct error function used for AC analysis; default value:DefaultACError

MaxError−>errlist Maximum error specification for the output variables;default value:

Settings for AC mode.

SimulationFunction, ErrorFunction, and MaxError are optional, whereas Range is a requiredargument.

If you specifiy AC settings you have to specify DT settings, too. The parameter sweep settingsparamsweep must be a subset of the parameter sweep given in the DT settings.

The default AC simulation function is called DefaultACSimulation. This function calls ACAnalysis(Section 3.7.3) to perform the numerical calculation. DefaultACSimulation inherits almost all op-tions from ACAnalysis.

Besides the default simulation function you can define your own AC simulation function and specifyit as SimulationFunction in the AC mode settings for NonlinearSetup. During the setup and thenonlinear simplifications this function will be called with the following arguments:

simfct[dae_, refsim_List:, opts___]

Pattern for a user-defined AC simulation function.

Here, dae is a Transient DAEObject, refsim is the list of numerical reference values and opts areadditional options.

The simulation function must return a list of the AC solutions in the same format as ACAnalysisreturns the result (with the option setting InterpolateResult −> False).

Page 407: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.12 Nonlinear Simplification Techniques 405

Similarly, you can define your own AC error function instead of the default error function andspecify it as ErrorFunction in the AC mode settings for NonlinearSetup. During the simplificationroutines this function is used to calculate the error with the following arguments:

errfct[newval_List, oldval_List, outputsymbols_List]

Pattern for a user-defined AC error function.

Here, newval and oldval are the numerical solutions of the simplified and the original dae system,outputsymbols is a list of all output symbols.

The error function must return a list of rules symb −> err, † † † which specifies the numerical errorfor each output symbol. The default AC error function calculates the maximum relative error.

Instead of specifying the maximum allowed error for output variables for each call to the nonlinearsimplifications routines separately, you can specify global maximum errors for output variables usingthe MaxError argument. These values are used if no error value is given in the call to the nonlinearsimplification routine. The value of this argument has to be a list of rules of the form outvar −> error.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Read PSpice netlist. In[2]:= net = ReadNetlist["AnalogInsydes/DemoFiles/Sqrt.cir",Simulator −> "PSpice"]

Out[2]= Circuit

Set up DAE system. In[3]:= dae = CircuitEquations[net,AnalysisMode −> DC, ElementValues −> Symbolic]

Out[3]= DAEDC, 2727

Get all valid symbols thatcan be used as inputs forNonlinearSetup.

In[4]:= GetParameters[dae]

Out[4]=AREA$Q1, AREA$Q2, AREA$Q3, AREA$Q4, BF$Q1, BF$Q2, BF$Q3, BF$Q4,BR$Q1, BR$Q2, BR$Q3, BR$Q4, GMIN, IB, II, IS$Q1, IS$Q2, IS$Q3,IS$Q4, TEMP, TNOM, VDC, VLOAD, $k, $q

Get all valid symbols thatcan be used as outputs forNonlinearSetup.

In[5]:= GetVariables[dae]

Out[5]=V$1, V$3, V$4, V$5, V$OUT, I$BS$Q1,I$CS$Q1, I$ES$Q1, ib$Q1, ic$Q1, I$BS$Q2, I$CS$Q2, I$ES$Q2,ib$Q2, ic$Q2, I$BS$Q3, I$CS$Q3, I$ES$Q3, ib$Q3, ic$Q3, I$BS$Q4,I$CS$Q4, I$ES$Q4, ib$Q4, ic$Q4, I$VLOAD, I$VDC

In the following we choose VLOAD and II as inputs and V$5 and I$VLOAD as outputs, treating dae asa multi-input/multi-output system. We want to control the DC behavior sweeping VLOAD betweenV and V and II between A and A on a uniform two-dimensional grid with points.The following call to NonlinearSetup prepares a DAEObject with these settings.

Page 408: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

406 3. Reference Manual

Specify settings fornonlinear simplifications.

In[6]:= step1=NonlinearSetup[dae, VLOAD, II, V$5, I$VLOAD,DT −> Range −>

VLOAD, 0, 3, 1, II, 0, 0.003, 0.001 ]

Out[6]= DAEDC, 2727

Display settings stored instep1.

In[7]:= NonlinearSettings[step1]

Input symbols : II, VLOAD

Output symbols : I$VLOAD, V$5

Ranking−Cache : −not set−

DT range : VLOAD −> 0., II −> 0., <<15>>

DTSimulation : DefaultDTSimulation

DTError : DefaultDTError

DTReference : <<16>>

OperatingPoints : <<16>>

The following code illustrates how to define your own simulation and error function and how tocall NonlinearSetup such that these functions are used during nonlinear simplifications.

Define a DT simulationfunction.

In[8]:= MyDTSimulationFct[dae_, refsim_List:, opts___] :=Block[

nonlinopts, indepvar, inittime,

indepvar, inittime, nonlinopts = GetDAEOptions[dae,IndependentVariable, InitialTime, NonlinearOptions

];NDAESolve[

dae,indepvar, inittime,Range /. (DT /. nonlinopts),opts

]]

Define a DT errorfunction.

In[9]:= MyDTErrorFct[newval_, oldval_, outputsymbols_] :=Map[

Rule[#, Max[Abs[(# /. newval) − (# /. oldval)]]] &,outputsymbols

]

Set up nonlinearsimplifications using newsimulation and errorfunction.

In[10]:= step1 = NonlinearSetup[dae, VLOAD, II, V$5, I$VLOAD,DT −>

Range −> VLOAD, 0, 3, 1, II, 0, 0.003, 0.001,SimulationFunction −> MyDTSimulationFct,ErrorFunction −> MyDTErrorFct

]

Out[10]= DAEDC, 2727

Page 409: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.12 Nonlinear Simplification Techniques 407

Display settings stored instep1.

In[11]:= NonlinearSettings[step1]

Input symbols : II, VLOAD

Output symbols : I$VLOAD, V$5

Ranking−Cache : −not set−

DT range : VLOAD −> 0., II −> 0., <<15>>

DTSimulation : MyDTSimulationFct

DTError : MyDTErrorFct

DTReference : <<16>>

OperatingPoints : <<16>>

3.12.2 CompressNonlinearEquations

CompressNonlinearEquations[dae, outvars]removes equations and eliminates variables from anonlinear DAEObject dae which are irrelevant for solvingfor the variables outvars

CompressNonlinearEquations[dae]removes as many equations and variables as possible

Command structure of CompressNonlinearEquations.

This function contains a compression algorithm which allows for identification and elimination ofirrelevant equations and variables and the removal of decoupled clusters of equations and variablesin a system of symbolic nonlinear differential and algebraic circuit equations. The return value isagain a DAEObject.

Note that the argument outvars also supports string patterns. Additionally,CompressNonlinearEquations automatically retrieves the settings made by NonlinearSetup, sothere is no need to specify the variables of interest as a second argument.

Note that CompressNonlinearEquations also supports the data format from Release 1, whereequations are given as eqns, vars, instead of a DAEObject:

CompressNonlinearEquations[eqns, vars, outvars]removes equations and eliminates variables from a set ofnonlinear equations eqns formulated in the variables varswhich are irrelevant for solving for the variables outvars

CompressNonlinearEquations[eqns, vars]removes as many equations and variables as possible

Additional patterns of CompressNonlinearEquations.

CompressNonlinearEquations has the following options:

Page 410: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

408 3. Reference Manual

option name default value

EliminateVariables Automatic eliminates irrelevant variables

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

StripIndependentBlocksTrue removes irrelevant independent subsystems

of equations

Options for CompressNonlinearEquations.

See also: CompressMatrixEquation (Section 3.11.4).

Options Description

EliminateVariables

EliminateVariables allows for eliminating variables from a set of equations. Settings areAutomatic for eliminating variables occuring linear everywhere, All for eliminating variables oc-curing linear somewhere, and None for no variable elimination, respectively. The default setting isEliminateVariables −> Automatic.

StripIndependentBlocks

With StripIndependentBlocks −> True irrelevant independent subsystems of equations will besearched for and removed. The default setting is StripIndependentBlocks −> True.

Examples

V0 C1 R1 Vout

1 2D1

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 411: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.12 Nonlinear Simplification Techniques 409

Define netlist descriptionof a simple diode rectifiercircuit.

In[2]:= rectifier =Circuit[

Netlist[V0, 1, 0, Symbolic −> V0,

Value −> 2. Sin[10^6 Time],R1, 2, 0, Symbolic −> R1, Value −> 100.,C1, 2, 0, Symbolic −> C1, Value −> 1.*^−7,D1, 1 −> A, 2 −> C,

Model −> "Diode", Selector −> "Spice"]

]

Out[2]= Circuit

Set up the system ofsymbolic time-domainequations.

In[3]:= rectifiereqs = CircuitEquations[rectifier,AnalysisMode −> Transient,ElementValues −> Symbolic] // UpdateDesignPoint

Out[3]= DAETransient, 44

Show equation system. In[4]:= DisplayForm[rectifiereqs]

Out[4]//DisplayForm=

I$AC$D1t I$V0t 0, I$AC$D1t V$2t

R1 C1 V$2 t 0,

V$1t V0, I$AC$D1t AREA$D1 E1.11 1.

TEMPTNOM $q

TEMP $k

1 E1. $q V$1tV$2tTEMP $k IS$D1 TEMP

TNOM

3.

GMIN V$1t V$2t,V$1t, V$2t, I$V0t, I$AC$D1t,DesignPoint V0 2. Sin1000000 t, R1 100., C1 1.107,

AREA$D1 1., GMIN 1.1012, IS$D1 1.1014, TEMP 300.15,

TNOM 300.15, $k 1.380621023, $q 1.602191019

Eliminate variables whichoccur linear everywhere.

In[5]:= rectifiercomp = CompressNonlinearEquations[rectifiereqs,V$2[t], EliminateVariables −> Automatic]

Out[5]= DAETransient, 22

Show compressed equationsystem.

In[6]:= DisplayForm[rectifiercomp]

Out[6]//DisplayForm=

1. AREA$D1 E1.11 1.

TEMPTNOM $q

TEMP $k 1. E1. $q V$1tV$2tTEMP $k IS$D1 TEMP

TNOM

3.

1. GMIN V$1t 1. V$2t V$2t

R1 C1 V$2 t 0,

V$1t V0, V$1t, V$2t,DesignPoint V0 2. Sin1000000 t, R1 100., C1 1.107,

AREA$D1 1., GMIN 1.1012, IS$D1 1.1014, TEMP 300.15,

TNOM 300.15, $k 1.380621023, $q 1.602191019

Eliminate variables whichoccur linear somewhere.

In[7]:= rectifiercomp = CompressNonlinearEquations[rectifiereqs,V$2[t], EliminateVariables −> All]

Out[7]= DAETransient, 11

Page 412: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

410 3. Reference Manual

Show compressed equationsystem.

In[8]:= DisplayForm[rectifiercomp]

Out[8]//DisplayForm=

1. AREA$D1 E1.11 1.

TEMPTNOM $q

TEMP $k 1. E1. $q V0V$2tTEMP $k IS$D1 TEMP

TNOM

3.

1. GMIN V0 1. V$2t V$2t

R1 C1 V$2 t 0, V$2t,

DesignPoint V0 2. Sin1000000 t, R1 100., C1 1.107,

AREA$D1 1., GMIN 1.1012, IS$D1 1.1014, TEMP 300.15,

TNOM 300.15, $k 1.380621023, $q 1.602191019

Perform numericaltransient analyses withNDAESolve.

In[9]:= orig = NDAESolve[rectifiereqs, t, 0., 2.*^−5];comp = NDAESolve[rectifiercomp, t, 0., 2.*^−5];

Compare the simulationresults withTransientPlot.

In[11]:= V$2Orig := V$2 /. First[orig];TransientPlot[comp, V$2[t], V$2Orig[t],

t, 0., 2.*^−5]

-65. 10

0.00001 0.000015 0.00002t

0.2

0.4

0.6

0.8

1

1.2

V$2Orig[t

V$2[t]

Out[12]= Graphics

3.12.3 CancelTerms

CancelTerms[dae, maxerrors] applies cancellation of terms in dae for a given errorspecification maxerrors

CancelTerms[dae] applies cancellation of terms using error specification givenby NonlinearSetup

Command structure of CancelTerms.

CancelTerms simplifies the given DAEObject by successive removal of terms in the equation system.It assures that the behavior of the simplified system differs not more than maxerrors from the behaviorof the original system. Before using CancelTerms, the DAEObject has to be prepared for nonlinearsimplification using NonlinearSetup (Section 3.12.1). CancelTerms performs the numerical anal-yses set by the call to NonlinearSetup to calculate the error a simplification causes. The error

Page 413: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.12 Nonlinear Simplification Techniques 411

list maxerrors must contain an error bound value for each analysis mode and each output variable,i.e. it has to be a list of the form

mode1 −> var1 −> bound1, ,

Variables for which an error value has been specified in the call to NonlinearSetup can be omitted.If error specifications have been given for each analysis mode and each output variable in the callto NonlinearSetup, the maxerrors specification can be omitted completely. If the error caused by asimplification exceeds any of the maximum errors given in the error list, the simplification is undone.Note that the error is measured by the error function specified in the call to NonlinearSetup.

Removal of terms is done in the level given by the option Level (see below).

CancelTerms returns the simplified DAEObject. All settings for nonlinear simplifications stored inthe original system are added to the returned DAEObject, too. This means that you do not have tocall NonlinearSetup again on the new system in order to apply subsequent simplifications.

Note that CancelTerms reduces the number of terms only. Use CompressNonlinearEquations(Section 3.12.2) to reduce the number of equations.

CancelTerms provides the following options:

option name default value

Clusterbound −1 logarithmic bound for cluster calculation

Errorbound 3 number of successive error-bound violationsbefore the algorithm terminates

Level 0 level in which to remove terms

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

Ranking Automatic method to use for ranking

RecordCancellations True whether to record term cancellations

Options for CancelTerms.

After removal of one or more terms a numerical simulation is performed. Comparing the result toa reference calculation yields the error on the output variables.

See also: NonlinearSetup (Section 3.12.1), ShowCancellations (Section 3.12.7), ShowLevel (Sec-tion 3.12.6), Statistics (Section 3.6.17).

Options Description

A detailed description of all CancelTerms options is given below in alphabetical order:

Page 414: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

412 3. Reference Manual

Clusterbound

Usually, CancelTerms deletes several terms at once before performing a numerical error calculation.The computation of suitable term clusters for this is done automatically by CancelTerms. If theprecasted influence of a term exceeds a given threshold, calculation of clusters is stopped and can-cellation is done term by term. This threshold value is specified by the option Clusterbound. Thefollowing values are allowed:

integer stop calculation of clusters if the logarithm (to base ) ofthe precasted term influence is bigger than integer

−Infinity do not cancel terms in clusters

Infinity always cancel terms in clusters

Values for the Clusterbound option.

The default setting is Clusterbound −> −1. Note that deletion of terms using clusters speeds up thecomputation significantly.

Errorbound

If the computed error exceeds the given error bound maxerrors, then the term or terms are re-inserted.The option Errorbound specifies the number of successive re-insertions before the algorithm termi-nates. Use Errorbound −> Infinity to check all terms for cancellation. The default setting isErrorbound −> 3.

Level

By default, CancelTerms removes terms from top-level sums (level 0). It is also possible to simplifysums in deeper levels, i.e. sums occuring inside of expressions. The option Level determines whichlevel is affected by the simplification. Possible values are:

n apply cancellation in level n

n, n, † † † apply cancellation in levels n, n,

All apply cancellation in all levels, starting on top level

Level specifications for CancelTerms.

If given explicitly, level specifications have to be non-negative integers. The default setting isLevel −> 0.

Page 415: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.12 Nonlinear Simplification Techniques 413

The level specification of CancelTerms does not correspond to the level of the internalMathematica representation of dae. Use ShowLevel (Section 3.12.6) or Statistics(Section 3.6.17) to see which levels can be influenced by CancelTerms.

Ranking

Cancellation of terms is performed in a pre-calculated order which sorts the terms by increasinginfluence. A method which estimates the influence of a cancellation on the output behavior iscalled ranking. CancelTerms lets you choose which ranking method to use for each analysis modeseparately by means of the Ranking option. Possible values are:

mode−>Automatic|Simulation, † † † set mode dependent ranking functions

Automatic equivalent to _−>Automatic

Simulation equivalent to _−>Simulation

Values for the Ranking option.

The ranking method can either be Automatic, which means to use the internal implemented rankingfunction, or Simulation, which means to use the corresponding simulation function to calculatethe influence. The former is much more efficient while the latter is more accurate. If the optionvalue is the symbol Automatic or Simulation the corresponding ranking function is set for allanalysis modes simultaneously. If you want to set the ranking function for each mode separately,you have to give a list of rules. The current analysis mode is then matched against the left handside of the rules and the corresponding right hand sides are chosen as ranking functions. Thus, modecan either be one of the symbols DT or AC, or a pattern specification like _. The default setting isRanking −> Automatic.

RecordCancellations

The value of the RecordCancellations option determines whether term cancellations are recordedduring computation. If set to True, a cancellation history is written to the options section of theDAEObject given as argument to CancelTerms. Note that it is not written to the returned DAEOb-ject. The command ShowCancellations (Section 3.12.7) can then be used to visualize the history list.If set to False, no history list is recorded. The default setting is RecordCancellations −> True.

If you cancel terms in different levels, the history list of the first level will be recorded only.

Page 416: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

414 3. Reference Manual

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Read PSpice netlist. In[2]:= netlist = ReadNetlist["AnalogInsydes/DemoFiles/Sqrt.cir",Simulator −> "PSpice"]

Out[2]= Circuit

Set up symbolic circuitequations.

In[3]:= mnaFull = CircuitEquations[netlist,AnalysisMode −> DC, ElementValues −> Symbolic,Value −> "*" −> TEMP, TNOM, $q, $k]

Out[3]= DAEDC, 2727

Prepare DAE system fornonlinear simplifications.

In[4]:= step1 = NonlinearSetup[mnaFull, II, VLOAD, I$VLOAD,DT −> Range −>

VLOAD, 0., 3.5, 0.5, II, 0., 0.001, 0.0002 ]

Out[4]= DAEDC, 2727

Display complexityinformation of the originalsystem.

In[5]:= Statistics[step1]

Number of equations : 27

Number of variables : 27

Length of equations : 4, 4, 3, 3, 2, 3, 2, 3, 8, 8,

3, 2, 3, 9, 9, 3, 2, 3, 9, 9, 3, 2, 3, 4, 4, 3, 2

Terms with derivatives : 0

Sums in levels : 113, 20

Cancel top-level terms inthe equations.

In[6]:= step2 = CancelTerms[step1, DT −> I$VLOAD −> 25.*^−6]

Out[6]= DAEDC, 2727

Display complexityinformation of thesimplified system. Notethat the number of termsdecreased, while thenumber of equationsstayed the same.

In[7]:= Statistics[step2]

Number of equations : 27

Number of variables : 27

Length of equations : 1, 2, 2, 2, 2, 2, 1, 2, 2, 1,

1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1

Terms with derivatives : 0

Sums in levels : 32, 4

3.12.4 SimplifySamplePoints

SimplifySamplePoints[func, range, tolerance]reduces the number of points in range for a given tolerancespecification tolerance

Command structure of SimplifySamplePoints.

Page 417: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.12 Nonlinear Simplification Techniques 415

SimplifySamplePoints returns a sparsed list of sample points such that the function values, eval-uated on adjacent points, do not exceed the given tolerance. The argument range must be a validparameter sweep specification as described in Section 3.7.2. If range is a n-dimensional sweep rangethen func must be a function of n arguments which returns a single real number.

SimplifySamplePoints provides the following options:

option name default value

ReturnSymbols True whether to return a list of rules or a list ofnumerical values

SearchDirections All specifies the direction in which to search foradjacent points

Options for SimplifySamplePoints.

See also: Section 3.7.2.

Options Description

ReturnSymbols

If ReturnSymbols is set to True, the sparsed list is returned as a flat list of rules. If it is setto False, the sparsed list is returned as a flat list of numerical values. In the former case the returnvalue is a valid parameter sweep specification and can be used as argument to NonlinearSetup(Section 3.12.1). The default setting is ReturnSymbols −> True.

SearchDirections

The option SearchDirections specifies the direction in which to search for adjacent points. Thevalue can be All or a list of symbols which appear in the given parameter sweep. If the value isa list of symbols, adjacent points are only searched for the given variables. The default setting isSearchDirections −> All which means to search in all directions.

3.12.5 NonlinearSettings

NonlinearSettings[dae] prints all settings for nonlinear simplifications stored in dae

Command structure of NonlinearSettings.

Page 418: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

416 3. Reference Manual

As mentioned in the description of NonlinearSetup (Section 3.12.1) additional data has to bestored in a DAE system in order to apply the nonlinear simplification routines. The commandNonlinearSettings prints the according data currently stored in a DAEObject.

NonlinearSettings provides the following information:

list of input symbols

list of output symbols

value of the ranking cache

mode-specific settings (range, simulation function, error function, and reference values)

See also: NonlinearSetup (Section 3.12.1).

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Read PSpice netlist. In[2]:= net = ReadNetlist["AnalogInsydes/DemoFiles/Sqrt.cir",Simulator −> "PSpice"]

Out[2]= Circuit

Set up DAE system. In[3]:= dae = CircuitEquations[net,AnalysisMode −> DC, ElementValues −> Symbolic]

Out[3]= DAEDC, 2727

Specify settings fornonlinear simplifications.

In[4]:= setup = NonlinearSetup[dae, VLOAD, II, V$5, I$VLOAD,DT −> Range −>

VLOAD, 0, 3, 1, II, 0, 0.003, 0.001 ]

Out[4]= DAEDC, 2727

Display settings stored inthe DAEObject.

In[5]:= NonlinearSettings[setup]

Input symbols : II, VLOAD

Output symbols : I$VLOAD, V$5

Ranking−Cache : −not set−

DT range : VLOAD −> 0., II −> 0., <<15>>

DTSimulation : DefaultDTSimulation

DTError : DefaultDTError

DTReference : <<16>>

OperatingPoints : <<16>>

Page 419: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.12 Nonlinear Simplification Techniques 417

3.12.6 ShowLevel

ShowLevel[dae] highlights parts of dae influenced by nonlinearsimplification routines for all levels

ShowLevel[dae, level] highlights parts in levels of dae given by level

Command structure of ShowLevel.

The command ShowLevel displays the equation system dae and highlights those parts of the equationswhich are influenced by nonlinear simplification functions such as CancelTerms (Section 3.12.3).

The second argument level can either be a number or a list of numbers. If it is a number, then exactlythis level is highlighted. If it is a list of numbers l, † † †, ln then the levels l, , ln are highlighted.

The level argument corresponds to the level argument of CancelTerms and to the output ofStatistics (Section 3.6.17).

The level specification of ShowLevel does not correspond to the level of the internalMathematica representation of dae.

See also: ShowCancellations (Section 3.12.7), Statistics (Section 3.6.17), CancelTerms (Sec-tion 3.12.3).

3.12.7 ShowCancellations

ShowCancellations[dae] highlights those parts of dae which have been removed bynonlinear simplification routines

Command structure of ShowCancellations.

The command ShowCancellations displays the equation system dae and highlights those parts ofthe equations which have been removed by nonlinear simplification functions such as CancelTerms(Section 3.12.3). You have to set the value of the CancelTerms option RecordCancellations to Trueto activate the history recording feature.

Note that dae is not the return value of a nonlinear simplification routine but its argument.

See also: ShowLevel (Section 3.12.6), CancelTerms (Section 3.12.3).

Page 420: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

418 3. Reference Manual

3.13 Miscellaneous Functions

3.13.1 ConvertDataTo2D

ConvertDataTo2D[data] converts numerical simulation data into two-dimensionalinterpolating functions

Command structure of ConvertDataTo2D.

All Analog Insydes functions which return numerical data, e. g. ACAnalysis (Section 3.7.3),NoiseAnalysis (Section 3.7.4), NDAESolve (Section 3.7.5), or ReadSimulationData (Section 3.10.3)use the data format described in Section 3.7.1. This format is suitable for representing one, two, andmulti-dimensional numerical data. As standard Mathematica graphic functions do not support themulti-dimensional Analog Insydes data format, ConvertDataTo2D converts the data such that it canbe plotted with standard Mathematica graphic functions such as Plot3D.

The input data must be two-dimensional data as described in Section 3.7.1, for example:

Data format fortwo-dimensional numericalsimulation data.

V$1 −> InterpolatingFunction[t1, t2, <>], ,SweepParameters −> VIN −> v1

, ,

V$1 −> InterpolatingFunction[t1, t2, <>], ,SweepParameters −> VIN −> v2

The data will then be converted to a set of two-dimensional interpolating functions:

Converted data format. V$1 −> InterpolatingFunction[v1, v2, t1, t2, <>], ,

Please note the order of the parameters for the two-dimensional interpolating function. The interpo-lation order is set to 1, 1.

See also: Section 3.7.1, Section 3.7.2.

Page 421: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.13 Miscellaneous Functions 419

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Read the simulation datawith ReadSimulationData .

In[2]:= data = ReadSimulationData["AnalogInsydes/DemoFiles/Multivibrator.txt",Simulator −> "PSpice"]

Out[2]=V4 InterpolatingFunction0.00018, 0.00012, ,V5 InterpolatingFunction0.00018, 0.00012, ,SweepParameters VCC 0.,

V4 InterpolatingFunction0.00018, 0.00012, ,V5 InterpolatingFunction0.00018, 0.00012, ,SweepParameters VCC 6.,

V4 InterpolatingFunction0.00018, 0.00012, ,V5 InterpolatingFunction0.00018, 0.00012, ,SweepParameters VCC 12.

Convert it intotwo-dimensionalinterpolating functions.

In[3]:= data2d = ConvertDataTo2D[data]

Out[3]=V4 InterpolatingFunction

0., 12., 0.00018, 0.00012, , V5 InterpolatingFunction0., 12., 0.00018, 0.00012,

Display simulation resultwith Plot3D.

In[4]:= Plot3D[Evaluate[("V(4)"[VCC, IC]−"V(5)"[VCC, IC]) /. data2d],IC, −0.00018, 0.00011, VCC, 0., 12.,BoxRatios −> 1., 1., 1.,AxesLabel −> "IC", "VCC", "V(4)−V(5)"]

-0.000100.0001

IC

02.5

57.5

10VCC

-10

-5

0

5

V(4)-V(5)

0.00010IC

02.5

57.5

10VCC

Out[4]= SurfaceGraphics

3.13.2 DXFGraphics

DXFGraphics["file"] displays a DXF file as a native Mathematica graphic object

Command structure of DXFGraphics.

Page 422: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

420 3. Reference Manual

The main purpose of importing DXF (Drawing Interchange File) is to include a schematics into aMathematica notebook for a better understanding and documentation of circuit analysis tasks. If yourschematic editor does not support the generation of DXF files it might be possible to use tools likepstoedit and hpgl2ps to convert the graphic data to DXF.

The DXF file should only contain two-dimensional graphic objects. The following DXF entities aresupported by DXFGraphics:

ARC

CIRCLE

LINE

POINT

POLYLINE

SHAPE

SOLID

TEXT

DXF entities supported by DXFGraphics.

DXFGraphics inherits all options from Graphics. Additional options for DXFGraphics are:

option name default value

FillColors None specifies the colors to be filled

LayerColor False whether the layer color should be used

LineDashingScale 5000. the line dashing scale

Protocol Inherited[AnalogInsydes]standard Analog Insydes protocolspecification (see Section 3.14.5)

ShowColors False whether to display the legend of used colors

TextSizing True whether to size the text

TextStyle FontSize −> 12 the used TextStyle

ThicknessFunction AbsoluteThickness function translating the DXF line thicknessinto a graphics primitive

ColorList † † † list which translates DXF colors intoMathematica colors

Options for DXFGraphics.

Page 423: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.13 Miscellaneous Functions 421

Options Description

A detailed description of all DXFGraphics options is given below in alphabetical order:

FillColors

Most DXF generators are not able to convert filled graphic objects into DXF correctly. The optionFillColors can be used to fill POLYLINE and CIRCLE entities by specifying a list of pairs of DXFcolors and Mathematica graphic primitives. For example, FillColor −> 1, RGBColor[0, 0, 0]will fill all converted POLYLINE and CIRCLE entities of color 1 with the Mathematica color directiveRGBColor[0, 0, 0]. More fill colors can be set as lists of pairs of a DXF color and a Mathematicagraphic primitive or a DXF color. If only a DXF color number is given the entity will be filled withits original color.

LayerColor

Each DXF entity belongs to a layer having its own color property. DXFGraphics takes the color ofthe entity if LayerColor −> False and the color of the layer otherwise.

LineDashingScale

The value given by the option LineDashingScale is directly multiplied with the DXF dashing value.The result is the argument of AbsoluteDashing used by DXFGraphics.

ShowColors

ShowColors −> True displays a legend of used colors which allows for identifying the wanted DXFcolors easily.

TextSizing

If TextSizing is set to True, the text will be scaled according to the DXF data. The average sizeof all text primitives in the resulting Mathematica graphics object is calculated. Afterwards the textsizes are fitted such that the average equals the value of FontSize given by the option TextStyle(see below).

TextStyle

The option TextStyle specifies the default style and font options used for displaying text. Theformat is opt −> val, † † † . If TextStyle contains the rule TextStyle −> val, the value val denotesthe average size of the font sizes if TextSizing is True.

Page 424: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

422 3. Reference Manual

ThicknessFunction

This option can be used for setting the line thickness. To generate a graphic using a ten times largerline thickness and a minimum line thickness of five specifyThicknessFunction −> (AbsoluteThickness[10.*#+5.]&).

ColorList

The option ColorList can be used to modify the color translation table. For example, to set theDXF color 7 to the Mathematica color white use the optionColorList −> ReplacePart[Options[DXFColor, ColorList][[1,2]], GrayLevel[1], 7].

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Import a DXF file intoMathematica.

In[2]:= DXFGraphics["AnalogInsydes/DemoFiles/Buffer.dxf"]

+-VDDQ2N2222T1

+-I1+-VIN +-I2

Q2N2907aT3Q2N2907aT4Q2N2907aT5

Q2N2222T2

0

VDB

5

2143

VOUT

Out[2]= Graphics

Page 425: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.13 Miscellaneous Functions 423

Use the option TextStyleto fit the font size.

In[3]:= DXFGraphics["AnalogInsydes/DemoFiles/Buffer.dxf",TextStyle −> FontSize −> 4]

+-VDD

Q2N2222T1

+-

I1+-VIN

+-

I2

Q2N2907a

T3Q2N2907a

T4

Q2N2907a

T5

Q2N2222T2

0

VDB

5

21

43

VOUT

Out[3]= Graphics

With the optionFillColors certain pictureelements can be filled.

In[4]:= DXFGraphics["AnalogInsydes/DemoFiles/colorcirc.dxf",FillColors −> 0, 1, 2, 3, 4, 5, 6,

7, −1, 8, 9, 20, 30, 33, 40, 60,70, 80, 100, 110, 120, 140, 150,160, 180, 190, 200, 220, 230, 240,250, 251, 252, 253, 254,

TextStyle −> FontSize −> 4]

Red GreenBlue YellowPink Cyan’White’

Out[4]= Graphics

Page 426: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

424 3. Reference Manual

3.13.3 MathLink Module MSBG

LoadMSBG[] or LoadMSBG[False]loads and installs the MathLink module if it is not installedyet

LoadMSBG[True] loads and installs the MathLink module; forces unloadingand reinstallation if the module was already installed

UnloadMSBG[] uninstalls the MathLink module

Manually loading and unloading of the MathLink module MSBG.exe.

Analog Insydes loads the MathLink SBG module automatically when it is needed, but you canalso load and unload the module manually by applying one of the above functions. Note thatsince the SBG module is a MathLink application, the global Analog Insydes option UseExternals(Section 3.14.7) must be set to True to enable these functions.

3.13.4 MathLink Module QZ

LoadQZ[] or LoadQZ[False] loads and installs the MathLink module if it is not installedyet

LoadQZ[True] loads and installs the MathLink module; forces unloadingand reinstallation if the module was already installed

UnloadQZ[] uninstalls the MathLink module

Manually loading and unloading of the MathLink module QZ.exe.

Analog Insydes loads the MathLink QZ module automatically when it is needed, but you can also loadand unload the module manually by applying one of the above functions. Note that since the QZmodule is a MathLink application, the global Analog Insydes option UseExternals (Section 3.14.7)must be set to True to enable these functions.

Page 427: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.14 Global Options 425

3.14 Global Options

Analog Insydes provides a number of global options for controlling some fundamental settingsshared by all program modules. An overview of the global options and their default settings (Sec-tion 3.14.1) as well as a detailed description of each option (Section 3.14.2 – Section 3.14.7) are givenbelow. Section 3.14.8 describes the option inheritance scheme implemented in Analog Insydes.

3.14.1 Options[AnalogInsydes]

The current settings of the global Analog Insydes options can be inspected withOptions[AnalogInsydes] . You can change the value of a global option in a Mathematica sessionwith SetOptions[AnalogInsydes, optname −> value].

There are the following global Analog Insydes options available:

option name default value

InstanceNameSeparator "$" separator string for name components ofmodel variables and reference designators

LibraryPath Prepend[$Path, "aidir/AnalogInsydes/ModelLibrary"]the search path for device model libraries

ModelLibrary "FullModels‘" the default device model library searchedby ExpandSubcircuits

Protocol StatusLine the amount and location of protocolinformation generated by Analog Insydescommands

Simulator "AnalogInsydes" the source/target simulator for dataimport/export and circuit simulationfunctions

UseExternals True whether to use external MathLink modules

Global options for Analog Insydes.

See also: Options, SetOptions.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 428: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

426 3. Reference Manual

View global AnalogInsydes option settings.

In[2]:= Options[AnalogInsydes]

Out[2]=InstanceNameSeparator $,LibraryPath Prepend$Path, aidirAnalogInsydesModelLibrary,ModelLibrary FullModels‘, Protocol StatusLine,Simulator AnalogInsydes, UseExternals True

3.14.2 InstanceNameSeparator

The option InstanceNameSeparator −> "string" specifies the character or string Analog Insydesuses to separate name components of variables, node identifiers, and reference designators generatedfor device model or subcircuit instances.

For example, the default setting InstanceNameSeparator −> "$" causes the transconductance gm ofa transistor Q1 to be named gm$Q1 after model instantiation.

The value of InstanceNameSeparator must be a valid symbol name.

The given "string" may not contain characters which have a special meaning in Mathematica,such as _ or ‘.

See also: CircuitEquations (Section 3.5.1).

3.14.3 LibraryPath

With the option LibraryPath, you can specify the paths to be searched for device model libraryfiles. Possible values are:

"path" search for model libraries in "path"

"path", "path", † † † search paths "path", "path", † † † in the given order formodel libraries

Values for the LibraryPath option.

The default setting is LibraryPath :> Prepend[$Path, "aidir/AnalogInsydes/ModelLibrary"],which adds the installation path of your Analog Insydes model library to the Mathematica vari-able $Path.

See also: Info[AnalogInsydes] (Section 3.15.6), Chapter 3.3.

Page 429: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.14 Global Options 427

3.14.4 ModelLibrary

With the option ModelLibrary, you can specify the names of the files or contexts searched byExpandSubcircuits for device model definitions during netlist expansion. Possible values are:

"lib" select file or context "lib" as default device model library

"lib", "lib", † † † select files or contexts "lib", "lib", † † † as default devicemodel libraries (files are searched in the given order)

Values for the ModelLibrary option.

Analog Insydes provides the following semiconductor device model libraries:

"FullModels‘" full-precision SPICE device models

"SimplifiedModels‘" medium-precision device models (some parasitic effectsexcluded)

"BasicModels‘" low-precision device models (without parasitic effects)

Analog Insydes device model libraries.

The default setting is ModelLibrary −> "FullModels‘", which applies the full-precision SPICEdevice models.

See also: LibraryPath (Section 3.14.3), CircuitEquations (Section 3.5.1), Chapter 3.3, Chapter 4.3.

Examples

Load Analog Insydes. In[3]:= <<AnalogInsydes‘

Use basic models for allsemiconductor devices.

In[4]:= SetOptions[AnalogInsydes,ModelLibrary −> "BasicModels‘"]

Out[4]=InstanceNameSeparator $,LibraryPath Prepend$Path, aidirAnalogInsydesModelLibrary,ModelLibrary BasicModels‘, Protocol StatusLine,Simulator AnalogInsydes, UseExternals True

The fact that library files are searched in the given order and the way in which the Analog Insydesmodel library is organized allow you to change the default model complexity setting for a particulardevice type by using the ModelLibrary option as follows.

Page 430: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

428 3. Reference Manual

Use full-precision modelsfor diodes and basicmodels for all otherdevices.

In[5]:= SetOptions[AnalogInsydes,ModelLibrary −> "FullDiodeModels‘", "BasicModels‘"]

Out[5]=InstanceNameSeparator $, LibraryPath Prepend

$Path, aidirAnalogInsydesModelLibrary, ModelLibrary FullDiodeModels‘, BasicModels‘, Protocol StatusLine,Simulator AnalogInsydes, UseExternals True

3.14.5 Protocol

With the option setting Protocol −> levelspecs, you can control the amount of protocol informationgenerated by Analog Insydes commands and specify the location on the screen where protocolmessages are displayed. You can distinguish between top-level functions and lower-level functions(i.e. functions called by top-level functions). Possible values are:

leveltop specify destination for protocol messages generated bytop-level function; do not show protocol messages fromlower levels

leveltop, level, † † † specify destinations for protocol messages generated bytop-level function and lower-level functions called bytop-level function

The format of levelspecs.

Protocol information can be printed in a notebook or displayed in a notebook’s status line. Thefollowing values may be specified as destinations level for Protocol, where the default setting isProtocol −> StatusLine.

Notebook display protocol information in notebook

StatusLine display protocol information in status line

All display protocol information in both notebook and statusline

None do not print protocol information

Destinations for protocol messages.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Page 431: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.14 Global Options 429

Turn off protocol display. In[2]:= SetOptions[AnalogInsydes, Protocol −> None]

Out[2]=InstanceNameSeparator $,LibraryPath Prepend$Path, aidirAnalogInsydesModelLibrary,ModelLibrary FullModels‘, Protocol None,Simulator AnalogInsydes, UseExternals True

Display top-levelinformation in status line,send messages fromsecond level to notebook.

In[3]:= SetOptions[AnalogInsydes,Protocol −> StatusLine, Notebook]

Out[3]=InstanceNameSeparator $,LibraryPath Prepend$Path, aidirAnalogInsydesModelLibrary,ModelLibrary FullModels‘, Protocol StatusLine, Notebook,Simulator AnalogInsydes, UseExternals True

3.14.6 Simulator

The value of the option Simulator −> "string" determines the source or target simulator for AnalogInsydes’ simulator interfaces and circuit analysis functions. The following simulators are supported:

"AnalogInsydes" Analog Insydes (Fraunhofer-ITWM)

"PSpice" PSpice (MicroSim, OrCAD)

"Eldo" Eldo (Anacad)

"Saber" Saber (Avant!)

Supported circuit simulators.

The default setting is Simulator −> "AnalogInsydes", which disables the usage of the externalsimulator interface.

Although the Simulator option of ReadNetlist, ReadSimulationData, etc. is inherited from theglobal Analog Insydes option Simulator, it is recommended to specify the Simulator option ineach call of the above mentioned commands rather than altering the global value.

3.14.7 UseExternals

The option UseExternals enables or disables the use of the external MathLink applications of AnalogInsydes. You can set UseExternals −> False if you prefer not to use MathLink programs or if youwish to run Analog Insydes on a platform for which no native support is provided. Possible valuesare:

Page 432: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

430 3. Reference Manual

True use the MathLink extensions of Analog Insydes

False do not use the MathLink extensions; use internal algorithmsif available

Values for the UseExternals option.

The default setting is UseExternals −> True, which enables the usage of the MathLink applications.

If you set UseExternals −> False, some functions may not be available or run withreduced performance.

Note that the external routines are called transparently for the user. There is no need to performany additional setup.

3.14.8 Option Inheritance

Analog Insydes employs an option inheritance scheme that allows you to change the values of sharedoptions both globally and locally in a convenient way. If the value of an option optname is specifiedas Inherited[symbol], then the actual value of optname will be retrieved from Options[symbol] assoon as it is needed.

For example, the Analog Insydes functions ExpandSubcircuits and ReadNetlist both inherit theoptions InstanceNameSeparator and Protocol from Options[AnalogInsydes]. You can changethe settings for both functions simultaneously by specifying new values forOptions[AnalogInsydes] . You can also change any of these options locally for either function inOptions[ExpandSubcircuits] or Options[ReadNetlist]. See example below.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Display the options ofExpandSubcircuits .

In[2]:= Options[ExpandSubcircuits]

Out[2]=AutoloadModels True, DefaultSelector None, HoldModels None,InstanceNameSeparator InheritedAnalogInsydes,KeepLocalModels False, LibraryPath InheritedAnalogInsydes,ModelLibrary InheritedAnalogInsydes,Protocol InheritedAnalogInsydes, Symbolic All,Value None

Note that some of the option values are marked as Inherited[AnalogInsydes]. The values of theseoptions will be retrieved from Options[AnalogInsydes] when they are neeeded.

Page 433: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.14 Global Options 431

Display the options ofReadNetlist.

In[3]:= Options[ReadNetlist]

Out[3]=CharacterMapping _ $,InstanceNameSeparator InheritedAnalogInsydes,KeepPrefix True, LevelSeparator ,LibraryPath ., Protocol InheritedAnalogInsydes,Simulator InheritedAnalogInsydes

Change the value ofInstanceNameSeparatorglobally.

In[4]:= SetOptions[AnalogInsydes, InstanceNameSeparator −> "$$"]

Out[4]=InstanceNameSeparator $$,LibraryPath Prepend$Path, aidirAnalogInsydesModelLibrary,ModelLibrary FullModels‘, Protocol StatusLine,Simulator AnalogInsydes, UseExternals True

Change the value ofProtocol locally forExpandSubcircuits .

In[5]:= SetOptions[ExpandSubcircuits, Protocol −> None]

Out[5]=AutoloadModels True, DefaultSelector None, HoldModels None,InstanceNameSeparator InheritedAnalogInsydes,KeepLocalModels False, LibraryPath InheritedAnalogInsydes,ModelLibrary InheritedAnalogInsydes, Protocol None,Symbolic All, Value None

Internally, Analog Insydes resolves inherited options by means of the function ResolveOptions.We use ResolveOptions here for documentation purposes only. Option inheritance is taken care ofautomatically by Analog Insydes. Below, ResolveOptions is used to determine the final values ofthe options for ExpandSubcircuits. Note that the local value of the Protocol option overrides thevalue from Options[AnalogInsydes].

Get option settings forExpandSubcircuits .

In[6]:= ResolveOptions[, ExpandSubcircuits,InstanceNameSeparator, Protocol] // InputForm

Out[6]//InputForm= "$$", None

For ReadNetlist, the values of both options are retrieved from Options[AnalogInsydes].

Get option settings forReadNetlist.

In[7]:= ResolveOptions[, ReadNetlist,InstanceNameSeparator, Protocol] // InputForm

Out[7]//InputForm= "$$", StatusLine

Page 434: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

432 3. Reference Manual

3.15 The Analog Insydes Environment

The Analog Insydes loading procedure is completed by execution of several init files which allow foradapting Analog Insydes to your local needs. Section 3.15.1 explains the details of the initializationprocedure.

Once Analog Insydes is started, there are several commands for obtaining detailed informationconcerning your local Analog Insydes installation:

ReleaseInfo[AnalogInsydes] (Section 3.15.2)Analog Insydes license type information

ReleaseNumber[AnalogInsydes] (Section 3.15.3)Analog Insydes release number

License[AnalogInsydes] (Section 3.15.4)Analog Insydes license number

Version[AnalogInsydes] (Section 3.15.5)Analog Insydes version information

Info[AnalogInsydes] (Section 3.15.6)Analog Insydes installation information

Obtaining Analog Insydes release information.

3.15.1 The Initialization Procedure

At the end of the Analog Insydes loading procedure, after setting up autoload declarations for allAnalog Insydes functions, three configurable init files are loaded (via the Mathematica function Get)in the following order:

If a file called aiinit.m exists in the Analog Insydes installation directory, this file is loaded first.

If a file called .airc exists in the directory given by the Mathematica variable $HomeDirectory,this file is loaded next.

If a file called .airc exists in the current working directory (i.e. the directory returned byDirectory[]; see the Mathematica command Directory), this file is loaded last.

These files allow for adapting Analog Insydes to your local needs: Simply add the correspondingMathematica commands to one of the init files (see example below).

By setting the following environment variables you can suppress loading of init files:

Page 435: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.15 The Analog Insydes Environment 433

AI_NO_SITE_INIT suppress loading of init file in Analog Insydes installationdirectory

AI_NO_USER_INIT suppress loading of init file in home directory

AI_NO_WORKDIR_INIT suppress loading of init file in current working directory

Environment variables for suppressing init file loading.

Since the init files are loaded after installing the package autoload declarations, you can access allAnalog Insydes functions and options in the init files. For example, if you always want to produceprotocol output in your notebook, you can set the global Analog Insydes option Protocol by addingthe following line to your user init file:

Setting the defaultprotocol.

SetOptions[AnalogInsydes, Protocol −> Notebook];

If you want to configure the location of an init file by an environment variable, add the following toyour user init file:

Loading an init file givenby an environmentvariable.

If[ (file = Environment["MY_AI_INIT_FILE"]) =!= $Failed,Get[file]];

This loads the init file given by the environment variable MY_AI_INIT_FILE if the variable is set.

3.15.2 ReleaseInfo

ReleaseInfo[AnalogInsydes] prints information on your local Analog Insydesinstallation

Command structure of ReleaseInfo.

The command ReleaseInfo[AnalogInsydes] prints general information concerning your local Ana-log Insydes installation such as the release number and a copyright notice.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Print information onAnalog Insydes release.

In[2]:= ReleaseInfo[AnalogInsydes]

Analog Insydes for Mathematica, Release 2.0

Copyright (c) 1996−2001 by Fraunhofer−ITWM

Page 436: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

434 3. Reference Manual

3.15.3 ReleaseNumber

ReleaseNumber[AnalogInsydes]returns the release number of your local Analog Insydesinstallation

Command structure of ReleaseNumber.

The command ReleaseNumber[AnalogInsydes] returns the release number of your Analog Insydesinstallation as a real number.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Get Analog Insydesrelease number.

In[2]:= ReleaseNumber[AnalogInsydes]

Out[2]= 2.

3.15.4 License

License[AnalogInsydes] returns the Analog Insydes license number currently used

Command structure of License.

The command License[AnalogInsydes] returns the license string used by your Analog Insydesinstallation. As your license file might contain a list of licenses, License[AnalogInsydes] displaysthe license actually used.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Get Analog Insydes licensenumber.

In[2]:= License[AnalogInsydes]

Out[2]=AIM1200R0100014238592786992445254318

3.15.5 Version

Version[AnalogInsydes] shows detailed information on the version of your localAnalog Insydes installation

Command structure of Version.

Page 437: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

3.15 The Analog Insydes Environment 435

The command Version[AnalogInsydes] returns a list of version strings of your Analog Insydesinstallation. Each loaded Analog Insydes package contributes a separate version string to this list,thus the return value of this commands differs depending on the commands used during the currentsession. Please always state Version[AnalogInsydes] when reporting problems or bugs.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Print detailed AnalogInsydes versioninformation.

In[2]:= Version[AnalogInsydes]

Out[2]=Common: 2.157, Main: 2.96, Master: 2.45, Miscellaneous: 2.70

3.15.6 Info

Info[AnalogInsydes] prints general information of your running Analog Insydesinstallation

Command structure of Info.

The command Info[AnalogInsydes] provides general information of the running Analog Insydesinstallation. It prints:

path to the Analog Insydes installation directory

list of all init files loaded during startup

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Print general informationon Analog Insydesinstallation.

In[2]:= Info[AnalogInsydes]

Path to Analog Insydes:

/usr/local/Mathematica/3.0/AddOns/Applications/AnalogIns\

ydes

Init files loaded: /usr/local/Mathematica/3.0/AddOns/App\

lications/AnalogInsydes/aiinit.m, /home/aiuser/.airc

Page 438: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog
Page 439: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

Appendix

4.1 Stimuli Sources . . . . . . . . . . . . . . . . . . . . . . . 438

4.2 Netlist Elements . . . . . . . . . . . . . . . . . . . . . . 446

4.3 Model Library . . . . . . . . . . . . . . . . . . . . . . . 460

4.3 Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . 492

Page 440: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

438 4. Appendix

4.1 Stimuli Sources

This chapter describes time-dependent (HSPICE-compatible) sources which can be used for numericalcircuit simulations. The following table shows the supported time-dependent stimuli sources andtheir corresponding Analog Insydes functions:

AMWave (Section 4.1.1) amplitude-modulated source

ExpWave (Section 4.1.2) exponential source

PulseWave (Section 4.1.3) pulse source

PWLWave (Section 4.1.4) piecewise linear source

SFFMWave (Section 4.1.5) frequency-modulated source

SinWave (Section 4.1.6) sinusoidal source

4.1.1 AMWave

AMWave[time, u, u, fm, fc, td]describes a time-dependent amplitude modulation source

Command structure of AMWave.

AMWave returns a numerical value in case the first argument is numeric, otherwise a CheckedAMWaveis returned. CheckedAMWave is a data type which marks a AMWave description as being syntacticallycorrect. CheckedAMWave should not be defined directly.

A CheckedAMWave can be displayed with standard Mathematica graphic functions such as Plot orwith Analog Insydes graphic functions such as TransientPlot.

AMWave has the following optional arguments:

Page 441: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.1 Stimuli Sources 439

argument name default value

u 0 V or A voltage or current amplitude

u 0 offset constant

fm 1 Hz modulation frequency

fc 1 Hz carrier frequency

td 0 s delay time

Arguments of AMWave.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define time-dependentamplitude modulatedsource.

In[2]:= Vam[t_] = AMWave[t, 10, 1, 100, 1.*^3, 1.*^−3]

Out[2]=CheckedAMWavet, 10., 1., 100., 1000., 0.001

Display the signal. In[3]:= TransientPlot[Vam[t], t, 0, 5.*^−3]

0.001 0.002 0.003 0.004 0.005t

-20

-10

10

20

Vam[t]

Out[3]= Graphics

4.1.2 ExpWave

ExpWave[time, u, u, tdr, taur, tdf, tauf]describes a time-dependent exponential source

Command structure of ExpWave.

ExpWave returns a numerical value in case the first argument is numeric, otherwise a CheckedExpWaveis returned. CheckedExpWave is a data type which marks a ExpWave description as being syntacticallycorrect. CheckedExpWave should not be defined directly.

Page 442: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

440 4. Appendix

A CheckedExpWave can be displayed with standard Mathematica graphic functions such as Plot orwith Analog Insydes graphic functions such as TransientPlot.

ExpWave has the following optional arguments:

argument name default value

u 0 V or A initial value of voltage or current

u 0 V or A pulsed value of voltage or current

tdr 0 s rise delay time

taur 1 s rise time constant

tdf 0 s fall delay time

tauf 1 s fall time constant

Arguments of ExpWave.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define time-dependentexponential source.

In[2]:= Vexp[t_] = ExpWave[t, 1, −1, 1, 0.1, 2]

Out[2]= CheckedExpWavet, 1., 1., 1., 0.1, 2., 1.

Display the signal. In[3]:= TransientPlot[Vexp[t], t, 0, 8]

2 4 6 8t

-1

-0.5

0.5

1

Vexp[t]

Out[3]= Graphics

Page 443: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.1 Stimuli Sources 441

4.1.3 PulseWave

PulseWave[time, u, u, td, tr, tf, pw, per]describes a time-dependent pulse source

Command structure of PulseWave.

PulseWave returns a numerical value in case the first argument is numeric, otherwise aCheckedPulseWave is returned. CheckedPulseWave is a data type which marks a PulseWave de-scription as being syntactically correct. CheckedPulseWave should not be defined directly.

A CheckedPulseWave can be displayed with standard Mathematica graphic functions such as Plotor with Analog Insydes graphic functions such as TransientPlot.

PulseWave has the following optional arguments:

argument name default value

u 0 V or A initial value for voltage or current pulse

u 0 V or A pulse value for voltage or current pulse

td 0 s delay time

tr 0 s rise time

tf 0 s fall time

pw 0 s pulse width

per $MaxMachineNumber s pulse period

Arguments of PulseWave.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define time-dependentpulse source.

In[2]:= Vpulse[t_] =PulseWave[t, 0.5, 2, 0.2, 0.2, 0.3, 0.3, 0.9]

Out[2]=CheckedPulseWavet, 0.5, 2., 0.2, 0.2, 0.3, 0.3, 0.9

Page 444: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

442 4. Appendix

Display the signal. In[3]:= TransientPlot[Vpulse[t], t, 0, 2]

0.5 1 1.5 2t

0.6

0.8

1.2

1.4

1.6

1.8

2

Vpulse[t]

Out[3]= Graphics

4.1.4 PWLWave

PWLWave[time, data, delay, repeat]describes a time-dependent piecewise linear source

Command structure of PWLWave.

PWLWave returns a numerical value in case the first argument is numeric, otherwise a CheckedPWLWaveis returned. If the last argument is not specified PWLWave returns an interpolating function object.CheckedPWLWave is a data type which marks a PWLWave description as being syntactically correct.CheckedPWLWave should not be defined directly.

A CheckedPWLWave can be displayed with standard Mathematica graphic functions such as Plot orwith Analog Insydes graphic functions such as TransientPlot.

PWLWave has the following optional arguments:

argument name default value

data 0, 0 sV or sA data pairs t, v, † † † of time valuesand voltage or current values

delay 0 s delay time

repeat Null s time point at which the waveform is tobe repeated

Arguments of PWLWave.

Page 445: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.1 Stimuli Sources 443

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Select data pairs. In[2]:= data = 0.1, 0, 0.5, 0, 1, 1, 1.5, 1,2, 0.5, 2.5, 0.5, 3, 0;

Define piecewise linearsource.

In[3]:= Vpwl1[t_] = PWLWave[t, data]

Out[3]=InterpolatingFunction1.7976910308, 1.7976910308, t

Define repeated piecewiselinear source.

In[4]:= Vpwl2[t_] = PWLWave[t, data, 0.5, 1]

Out[4]=CheckedPWLWavet,InterpolatingFunction1.7976910308, 1.7976910308, ,0.5, 1., 3.

Display the signals. In[5]:= TransientPlot[Vpwl1[t], Vpwl2[t], t, −1, 7]

2 4 6t

0.2

0.4

0.6

0.8

1

Vpwl2[t]

Vpwl1[t]

Out[5]= Graphics

4.1.5 SFFMWave

SFFMWave[time, u, u, fc, mi, fs]describes a time-dependent single-frequency frequencymodulation source

Command structure of SFFMWave.

SFFMWave returns a numerical value in case the first argument is numeric, otherwise aCheckedSFFMWave is returned. CheckedSFFMWave is a data type which marks a SFFMWave descriptionas being syntactically correct. CheckedSFFMWave should not be defined directly.

A CheckedSFFMWave can be displayed with standard Mathematica graphic functions such as Plot orwith Analog Insydes graphic functions such as TransientPlot.

SFFMWave has the following optional arguments:

Page 446: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

444 4. Appendix

argument name default value

u 0 V or A voltage or current offset

u 0 V or A voltage or current amplitude

fc 1 Hz carrier frequency

mi 0 modulation index

fs 1 Hz signal frequency

Arguments of SFFMWave.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define time-dependentfrequency modulatedsource.

In[2]:= Vfm[t_] = SFFMWave[t, 0, 1.*^6, 2.*^4, 10, 5.*^3]

Out[2]=CheckedSFFMWavet, 0., 1.106, 20000., 10., 5000.

Display the signal. In[3]:= TransientPlot[Vfm[t], t, 0, 2.*^−4]

0.00005 0.0001 0.00015 0.0002t

6-1. 10

-500000

500000

61. 10

Vfm[t]

Out[3]= Graphics

4.1.6 SinWave

SinWave[time, u, u, freq, td, alpha, phi]describes a time-dependent sinusoidal source

Command structure of SinWave.

SinWave returns a numerical value in case the first argument is numeric, otherwise a CheckedSinWaveis returned. CheckedSinWave is a data type which marks a SinWave description as being syntacticallycorrect. CheckedSinWave should not be defined directly.

Page 447: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.1 Stimuli Sources 445

A CheckedSinWave can be displayed with standard Mathematica graphic functions such as Plot orwith Analog Insydes graphic functions such as TransientPlot.

SinWave has the following optional arguments:

argument name default value

u 0 V or A voltage or current offset

u 0 V or A voltage or current amplitude

freq 1 Hz frequency

td 0 s delay time

alpha 0 s damping factor

phi 0 phase delay

Arguments of SinWave.

Examples

Load Analog Insydes. In[1]:= <<AnalogInsydes‘

Define time-dependentsinusoidal source.

In[2]:= Vsin[t_] = SinWave[t, 0.5, 1, 2, 0.2, 1.5, 180]

Out[2]=CheckedSinWavet, 0.5, 1., 2., 0.2, 1.5, 180.

Display the signal. In[3]:= TransientPlot[Vsin[t], t, 0, 3]

0.5 1 1.5 2 2.5 3t

-0.2

0.2

0.4

0.6

0.8

1

Vsin[t]

Out[3]= Graphics

Page 448: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

446 4. Appendix

4.2 Netlist Elements

Analog Insydes supports the following primitive electrical circuit and control network elements:

element type type tag

Resistor R Section 4.2.1

Conductance G Section 4.2.2

Admittance Y Section 4.2.3

Impedance Z Section 4.2.4

Capacitor C Section 4.2.5

Inductor L Section 4.2.6

OpenCircuit OC Section 4.2.7

ShortCircuit SC Section 4.2.8

Linear two-terminal elements.

element type type tag

CurrentSource I Section 4.2.9

VoltageSource V Section 4.2.10

Independent sources.

element type type tag

CCCSource CC Section 4.2.11

CCVSource CV Section 4.2.12

VCCSource VC Section 4.2.13

VCVSource VV Section 4.2.14

OPAmp OP Section 4.2.15

OTAmp OT Section 4.2.16

Controlled sources.

Page 449: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.2 Netlist Elements 447

element type type tag

Nullator NUL Section 4.2.17

Norator NOR Section 4.2.18

Fixator FIX Section 4.2.19

Singular network elements.

element type type tag

SignalSource HS Section 4.2.20

Amplifier HP Section 4.2.21

Integrator HI Section 4.2.22

Differentiator HD Section 4.2.23

TransmissionLine HT Section 4.2.24

TransferFunction H Section 4.2.25

Control network elements.

4.2.1 Resistor

type name syntax

Resistor Rname, node1, node2, valueRdenotes a linear resistor

Circuit element type Resistor.

Rnode1 node2

Modified nodal equation setup for admittances is influenced by the value-field option Pattern. Notethat the symbol Admittance is also a possible option value for the value-field option Pattern.

Page 450: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

448 4. Appendix

4.2.2 Conductance

type name syntax

Conductance Gname, node1, node2, valueGdenotes a linear conductance

Circuit element type Conductance.

Gnode1 node2

Modified nodal equation setup for conductances is influenced by the value-field option Pattern.

4.2.3 Admittance

type name syntax

Admittance Yname, node1, node2, valueYdenotes a linear (complex) admittance

Circuit element type Admittance.

Y

node1 node2

Modified nodal equation setup for admittances is influenced by the value-field option Pattern. Notethat the symbol Admittance is also a possible option value for the value-field option Pattern.

4.2.4 Impedance

type name syntax

Impedance Zname, node1, node2, valueZdenotes a linear (complex) impedance

Circuit element type Impedance.

Z

node1 node2

Page 451: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.2 Netlist Elements 449

Modified nodal equation setup for impedances is influenced by the value-field option Pattern. Notethat the symbol Impedance is also a possible option value for the value-field option Pattern.

4.2.5 Capacitor

type name syntax

Capacitor Cname, node1, node2, valueCdenotes a linear capacitor

Circuit element type Capacitor.

C

node1 node2

Modified nodal equation setup for capacitors is influenced by the value-field option Pattern.

4.2.6 Inductor

type name syntax

Inductor Lname, node1, node2, valueLdenotes a linear inductor

Circuit element type Inductor.

L

node1 node2

Modified nodal equation setup for inductors is influenced by the value-field option Pattern.

4.2.7 OpenCircuit

type name syntax

OpenCircuit OCname, node1, node2, 0denotes an open-circuit branch

Circuit element type OpenCircuit.

Page 452: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

450 4. Appendix

V1

node1

node2

An open-circuit branch is essentially the same as an independent current source with zero sourcecurrent. The value specification is ignored. However, it should be set to 0 (zero) to reflect the factthat the source current is zero. Note that open circuits are mostly used implicitly as controllingbranches of voltage-controlled sources but they may also be used explicitly in a netlist when avoltage meter is needed. In the latter case, modified nodal analysis employs a special matrix fill-inpattern which augments the vector of unknown node voltages by the branch voltage across the opencircuit. This allows for directly computing the differential voltage between two nodes neither ofwhich is ground. Without the voltage sensor, two node voltages would have to be solved for andthen subtracted from one another, which would be computationally more expensive.

4.2.8 ShortCircuit

type name syntax

ShortCircuit SCname, node1, node2, 0denotes a short-circuit branch

Circuit element type ShortCircuit.

I1

node1

node2

A short-circuit branch is essentially the same as a voltage source with zero source voltage. Thevalue specification is ignored. However, it should be set to 0 (zero) to reflect the fact that thesource voltage is zero. Note that short circuits are mostly used implicitly as controlling branches ofcurrent-controlled sources. They may also be used explicitly as current meters in combination withmodified nodal analysis.

Page 453: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.2 Netlist Elements 451

4.2.9 CurrentSource

type name syntax

CurrentSource Iname, node+, node−, valueI0denotes an independent current source

Circuit element type CurrentSource.

node+

node-

I0

The positive reference direction for the source current is from node+ to node−.

4.2.10 VoltageSource

type name syntax

VoltageSource Vname, node+, node−, valueV0denotes an independent voltage source

Circuit element type VoltageSource.

node+

node-

V0

The positive reference direction for the source voltage as well as the current through the source isfrom node+ to node−.

Page 454: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

452 4. Appendix

4.2.11 CCCSource

type name syntax

CCCSource CCname, cnode+, cnode−, node+, node−, valuebetadenotes a linear current-controlled currentsource (CCCS) with gain valuebeta

Circuit element type CCCSource.

I1

beta*I1

cnode+

cnode- node-

node+

The terminals of the controlling branch are denoted by cnode+ and cnode−. The positive referencedirection for the sensor current and the source current is from cnode+ to cnode− and from node+ tonode−, respectively. Note that Analog Insydes automatically inserts a short circuit in between cnode+and cnode− as a current meter. As opposed to the SPICE netlist format there is no need to add asensor voltage source to the netlist.

4.2.12 CCVSource

type name syntax

CCVSource CVname, cnode+, cnode−, node+, node−, valuerdenotes a linear current-controlled voltagesource (CCVS) with transresistance valuer

Circuit element type CCVSource.

I1 r*I1

cnode+

cnode- node-

node+

The terminals of the controlling branch are denoted by cnode+ and cnode−. The positive referencedirection for the sensor current and the source voltage is from cnode+ to cnode− and from node+ to

Page 455: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.2 Netlist Elements 453

node−, respectively. Note that Analog Insydes automatically inserts a short circuit in between cnode+and cnode− as a current meter. As opposed to the SPICE netlist format there is no need to add asensor voltage source to the netlist.

4.2.13 VCCSource

type name syntax

VCCSource VCname, cnode+, cnode−, node+, node−, valuegmdenotes a linear voltage-controlled currentsource (VCCS) with transconductancevaluegm

Circuit element type VCCSource.

V1

gm*V1

cnode+

cnode- node-

node+

The terminals of the controlling branch are denoted by cnode+ and cnode−. Note that as opposed tothe SPICE netlist format the controlling nodes are listed before the terminals of the controlled branch.

4.2.14 VCVSource

type name syntax

VCVSource VVname, cnode+, cnode−, node+, node−, valuevdenotes a linear voltage-controlled voltagesource (VCVS) with voltage gain valuev

Circuit element type VCVSource.

V1 v*V1

cnode+

cnode- node-

node+

Page 456: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

454 4. Appendix

The terminals of the controlling branch are denoted by cnode+ and cnode−. Note that as opposed tothe SPICE netlist format the controlling nodes are listed before the terminals of the controlled branch.

4.2.15 OPAmp

type name syntax

OPAmp OPname, cnode+, cnode−, node+, node−, valuevdenotes an ideal operational amplifier withfinite or infinite gain valuev

Circuit element type OPAmp.

V1v*V1

cnode+

cnode- node-

node+

For infinite gain, valuev must be Infinity. Note that, functionally, an OpAmp is the same as avoltage-controlled voltage source. The difference to a VCVSource is that during circuit equationsetup another matrix fill-in pattern is used which makes limit calculations for large OpAmp gainseasier.

4.2.16 OTAmp

type name syntax

OTAmp OTname, cnode+, cnode−, node+, node−, valuegmdenotes an ideal operationaltransconductance amplifier with finite orinfinite gain valuegm

Circuit element type OTAmp.

V1gm*V1

cnode+

cnode- node-

node+

Page 457: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.2 Netlist Elements 455

For infinite gain, valuegm must be Infinity. Note that, functionally, an OTAmp is the same as avoltage-controlled current source. The difference to a VCCSource is that during circuit equationsetup another matrix fill-in pattern is used which makes limit calculations for large OTAmp gainseasier.

4.2.17 Nullator

type name syntax

Nullator NULname, node1, node2, 0denotes a nullator

Circuit element type Nullator.

node1

node2

V=0

I=0

A nullator is an ideal two-terminal circuit element which enforces both a zero voltage and a zerocurrent between its terminals. It is thus neither a voltage nor a current source but rather both atthe same time. The value specification in the netlist entry of a nullator is irrelevant and should beset to 0 (zero). Note that an element with a arbitrary but fixed branch current and branch voltageis also known as a fixator. With a zero current and voltage, a nullator is a special case of a fixator.A nullator usually appears paired with a norator, thus forming a nullor. A nullor represents acontrolled source of arbitrary type with infinite gain, such as an ideal operational amplifier.

4.2.18 Norator

type name syntax

Norator NORname, node1, node2, 0denotes a norator

Circuit element type Norator.

Page 458: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

456 4. Appendix

node1

node2

A Norator is an ideal two-terminal circuit element which imposes no constraints on its branch currentand voltage. The value specification is ignored and should be set to 0 (zero). Note that a noratorusually appears paired with a nullator, thus forming a nullor. A nullor represents a controlled sourceof arbitrary type with infinite gain, such as an ideal operational amplifier.

4.2.19 Fixator

type name syntax

Fixator FIXname, node+, node−, valueI0, valueV0denotes a fixator

Circuit element type Fixator.

node+

node-I0

V0

A fixator is an ideal two-terminal circuit element which enforces both a fixed voltage and a fixedcurrent between its terminals. It is thus neither a voltage nor a current source but rather both at thesame time. Note that the netlist entry for fixators has a special form because two element values,a source current and a source voltage, must be specified. Fixators are hardly ever used for circuitanalysis purposes. Their main application field is circuit sizing where they can be used to modeloperating points of nonlinear devices such as transistors.

Page 459: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.2 Netlist Elements 457

4.2.20 SignalSource

type name syntax

SignalSource HSname, output, valueXdenotes a signal source in a control network

Circuit element type SignalSource.

outputX(s)

Signal sources do not have an input node. Therefore, the connectivity field contains only the nodeidentifier of the output node.

4.2.21 Amplifier

type name syntax

Amplifier HPname, input, output, valueAdenotes a proportional amplifier withamplification valueA

Circuit element type Amplifier.

outputinput A

Page 460: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

458 4. Appendix

4.2.22 Integrator

type name syntax

Integrator HIname, input, output, valueTidenotes an integrator with an integrationtime constant valueTi

Circuit element type Integrator.

outputinput Ti

4.2.23 Differentiator

type name syntax

Differentiator HDname, input, output, valueTddenotes a differentiator with adifferentiation time constant valueTd

Circuit element type Differentiator.

outputinput Td

4.2.24 TransmissionLine

type name syntax

TransmissionLine HTname, input, output, valueTdenotes an ideal lossless transmission linewith a delay time constant valueT

Circuit element type TransmissionLine.

Page 461: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.2 Netlist Elements 459

outputinput T

4.2.25 TransferFunction

type name syntax

TransferFunction Hname, input, output, valuetfuncdenotes a generic transfer function block

Circuit element type TransferFunction.

outputinput H(s)

The transfer function valuetfunc may be any function of the Laplace frequency variable s. To avoidconfusion with the other control network element types the block name must not begin with theletters S, P, I, D, or T.

Page 462: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

460 4. Appendix

4.3 Model Library

The Analog Insydes model library provides full-precision SPICE-compatible models for the mostimportant devices such as Diodes (Section 4.3.1), BJTs (Section 4.3.2), MOSFETs (Section 4.3.3), andJFETs (Section 4.3.4).

Each section contains two subsections describing the large-signal as well as the small-signal model.Following an equivalent circuit schematic the particular model parameters are introduced includ-ing their default values and a short description. Note that the default values of the small-signalparameters are given symbolically with the suffix "$ac" as they are automatically generated byReadNetlist (Section 3.10.1). Each model section concludes with a description of those parameterswhich are influenced by the automatic model-complexity reduction controlled via the global AnalogInsydes option ModelLibrary (Section 3.14.4).

4.3.1 Diode

syntax

Dname, n−>A, n−>C, Model−>Diode, Selector−>selector, parametersdenotes a subcircuit reference for a Diode

Subcircuit reference for Diode.

A C

Valid values for selector are: Spice, SpiceDC, SpiceAC, and SpiceNoise. Possible parameters aredescribed below.

Large-Signal Model

The analog behavioral model included in the Analog Insydes model library has the following portcharacteristics:

Voltage[A,C]

Current[A,C]

CA

where A denotes the Anode and C the Cathode, respectively. The port currents can be expressed inthe port variables as follows:

Page 463: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 461

Anode: iAt Current[A,C]t

Cathode: iCt Current[A,C]t

CD

id

A

C

RS

Equivalent schematic for the DC and transient analysis

The large-signal model includes the following model parameters:

parameter name default value

BV - V reverse breakdown voltage

IBV A reverse breakdown current

IS A saturation current

N emission coefficient

NBV reverse breakdown coefficient

DC related model parameters.

parameter name default value

RS ohmic resistance

Parasitic resistance related model parameters.

Page 464: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

462 4. Appendix

parameter name default value

CJO F zero-bias junction capacitance

FC forward-bias depletion capacitancecoefficient

M grading coefficient

TT s transit time

VJ V junction potential

Capacitance related model parameters.

parameter name default value

EG eV energy gap

TEMP K model temperature

TNOM K nominal temperature

XTI saturation current temperature exponent

Temperature related model parameters.

parameter name default value

AF flicker noise exponent

KF flicker noise coefficient

Noise related model parameters.

parameter name default value

AREA relative device area

GMIN minimum conductance

LEVEL model index

Miscellaneous model parameters.

The automatic reduction of the model complexity controlled via the global Analog Insydes optionModelLibrary influences the following parameters:

Page 465: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 463

parameter name FullModels SimplifiedModels BasicModels

BV used used default

RS used default default

TT used default default

Simplification related model parameters.

Small-Signal Model

CdRd

A

C

Rs

Equivalent schematic for the AC analysis

The small-signal model includes the following model parameters:

parameter name default value

Cd CAP$ac junction and diffusion capacitance

Rd REQ$ac small-signal resistance

Rs RS/AREA resistance

Small-signal model parameters.

The automatic reduction of the model complexity controlled via the global Analog Insydes optionModelLibrary influences the following parameters:

Page 466: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

464 4. Appendix

parameter name FullModels SimplifiedModels BasicModels

Rs used ignored ignored

Simplification related model parameters.

4.3.2 Bipolar Junction Transistor

syntax

Qname, n−>C, n−>B, n−>E, n−>S, Model−>BJT, Selector−>selector, parametersdenotes a subcircuit reference for a BJT

Subcircuit reference for BJT.

C

B

E

C

B

E

Valid values for selector are: GummelPoon, GummelPoonDC, Spice, SpiceDC, SpiceAC, and SpiceNoise.Possible parameters are described below. Please note that the substrate port S is optional.

Large-Signal Model

The analog behavioral model included in the Analog Insydes model library has the following portcharacteristics:

C

Current[C,S]

Voltage[C,S]

Voltage[E,S]

Current[E,S]

Voltage[B,S]

Current[B,S]

SB

E

Page 467: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 465

where B denotes the Base, C the Collector, E the Emitter, and S the Substrate, respectively. The portcurrents can be expressed in the port variables as follows:

Base: iBt Current[B,S]t

Collector: iCt Current[C,S]t

Emitter: iEt Current[E,S]t

Substrate: iSt Current[B,S]t Current[C,S]t Current[E,S]t

CBEib

C

E

B

RBCBC

RE

CBX

RC

ics

ic

S

CJS

Equivalent schematic for the DC and transient analysis for the vertical bipolar transistor (NPN, PNP)

Page 468: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

466 4. Appendix

CBEibibs

C

E

BRB

CBC

RE

CBX

RC

ic

S

CXS CJS

Equivalent schematic for the DC and transient analysis for the lateral bipolar transistor (LPNP)

The large-signal model includes the following model parameters:

Page 469: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 467

parameter name default value

BF ideal maximum forward current gain

BR ideal maximum reverse current gain

IKF (IK) - A corner current for forward-beta high-currentroll-off

IKR - A corner current for reverse-beta high-currentroll-off

IS A transport saturation current

ISC (C4) A base-collector leakage saturation current

ISE (C2) A base-emitter leakage saturation current

ISS A substrate junction saturation current

NC base-collector leakage emission coefficient

NE base-emitter leakage emission coefficient

NF forward current emission coefficient

NK high-current roll-off coefficient

NR reverse current emission coefficient

NS (NSS) substrate junction emission coefficient

VAF (VA) - V forward early voltage

VAR (VB, VBAR) - V reverse early voltage

DC related model parameters.

parameter name default value

IRB - A current at which RB falls halfway to itsminimum value

RB zero-bias base ohmic resistance

RBM RB minimum base ohmic resistance

RC collector ohmic resistance

RE emitter ohmic resistance

Parasitic resistance related model parameters.

Page 470: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

468 4. Appendix

parameter name default value

CJC F zero-bias base-collector depletioncapacitance

CJE F zero-bias base-emitter depletion capacitance

CJS (CCS) F zero-bias substrate capacitance

FC forward-bias depletion capacitancecoefficient

MJC (MC) base-collector junction grading factor

MJE (ME) base-emitter junction grading factor

MJS (MS) substrate junction grading factor

VJC (PC) V base-collector built-in potential

VJE (PE) V base-emitter built-in potential

VJS (PS) V substrate junction built-in potential

XCJC fraction of base-collector capacitanceconnected to internal base node

XJBS fraction of base-substrate capacitanceconnected to internal base node (for lateraldevices only)

Junction capacitance related model parameters.

parameter name default value

ITF A transit time dependency on collector current

PTF excess phase at f Π TFHz

TF s ideal forward transit time

TR s ideal reverse transit time

VTF - V transit time dependency on base-collectorvoltage

XTF transit time bias dependence coefficient

Dynamic model parameters.

Page 471: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 469

parameter name default value

EG eV energy gap

GAP1 eVK first bandgap correction factor

GAP2 K second bandgap correction factor

TEMP K model temperature

TNOM K nominal temperature

TRB1 K linear temperature coefficient for RB

TRB2 K quadratic temperature coefficient for RB

TRC1 (TRC) K linear temperature coefficient for RC

TRC2 K quadratic temperature coefficient for RC

TRE1 (TRE) K linear temperature coefficient for RE

TRE2 K quadratic temperature coefficient for RE

TRM1 (TRBM1) K linear temperature coefficient for RBM

TRM2 (TRBM2) K quadratic temperature coefficient for RBM

XTB (TB, TCB) forward and reverse beta temperatureexponent

XTI (PT) IS temperature effect exponent

Temperature related model parameters.

parameter name default value

AF flicker noise exponent

KF flicker noise coefficient

Noise related model parameters.

Page 472: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

470 4. Appendix

parameter name default value

AREA relative device area

GMIN minimum conductance

LEVEL model index

Miscellaneous model parameters.

The automatic reduction of the model complexity controlled via the global Analog Insydes optionModelLibrary influences the following parameters:

Page 473: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 471

parameter name FullModels SimplifiedModels BasicModels

CJS used default default

IKF used default default

IKR used default default

IRB used default default

ISC used default default

ISE used used default

ISS used default default

ITF used default default

PTF used default default

RB used used default

RBM used used default

RC used default default

RE used default default

TF used default default

TR used default default

VAF used used default

VAR used used default

VTF used default default

XCJC used used default

XJBS used used default

XTF used default default

Simplification related model parameters.

Page 474: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

472 4. Appendix

Small-Signal Model

CbeRpi

C

E

Gmu

B

RxCbc

Re

Cbx

Rc

Ro

gm*vpivpi

S

Cjs

Equivalent schematic for the AC analysis for the vertical bipolar transistor (NPN, PNP)

Cbx

CbeRpi

C

E

Gmu

B

RxCbc

Re

Rc

Ro

gm*vpivpi

S

Cxs Cjs

Equivalent schematic for the AC analysis for the lateral bipolar transistor (LPNP)

The small-signal model includes the following model parameters:

Page 475: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 473

parameter name default value

Cbc CBC$ac (CMU$ac) base collector capacitance

Cbe CBE$ac (CPI$ac) base emitter capacitance

Cbx CBX$ac external base collector capacitance

Cjs CJS$ac (CBS$ac, CCS$ac)substrate capacitance

Cxs CXS$ac external base substrate capacitance (forlateral devices only)

gm GM$ac transconductance

Gmu GMU$ac base collector conductance

Rc RC/AREA collector resistance

Re RE/AREA emitter resistance

Ro RO$ac collector emitter resistance

Rpi RPI$ac base emitter resistance

Rx RX$ac base resistance

Small-signal model parameters.

The automatic reduction of the model complexity controlled via the global Analog Insydes optionModelLibrary influences the following parameters:

parameter name FullModels SimplifiedModels BasicModels

Cjs used used ignored

Cxs used used ignored

Gmu used ignored ignored

Rc used ignored ignored

Re used ignored ignored

Rx used ignored ignored

Simplification related model parameters.

Page 476: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

474 4. Appendix

4.3.3 MOS Field-Effect Transistor

syntax

Mname, n−>D, n−>G, n−>S, n−>B, Model−>MOSFET, Selector−>selector, parametersdenotes a subcircuit reference for a MOSFET

Subcircuit reference for MOSFET.

G G

D D

S S

B B

Valid values for selector are: Spice, SpiceDC, SpiceAC, and SpiceNoise. Possible parameters aredescribed below.

Large-Signal Model

The analog behavioral model included in the Analog Insydes model library has the following portcharacteristics:

D

Current[D,B]

Voltage[D,B]

Voltage[S,B]

Current[S,B]

Voltage[G,B]

Current[G,B]

BG

S

where G denotes the Gate, D the Drain, S the Source, and B the Bulk, respectively. The port currentscan be expressed in the port variables as follows:

Gate: iGt Current[G,B]t

Drain: iDt Current[D,B]t

Source: iSt Current[S,B]t

Bulk: iBt Current[G,B]t Current[D,B]t Current[S,B]t

Page 477: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 475

ibsCGS

D

S

CGD

G

ibd

RS

RD

ids

CBD

CBS

B

CGB

Equivalent schematic for the DC and transient analysis

The large-signal model includes the following model parameters:

parameter name default value

GAMMA

V bulk threshold parameter

IS A bulk junction saturation current

JS Am2 bottom bulk junction saturation currentdensity

JSSW Am sidewall bulk junction saturation currentdensity

KP AV2 transconductance parameter

LAMBDA V channel length modulation

N bulk junction emission coefficient

PHI V surface potential

VTO V zero-bias threshold voltage

DC related model parameters.

Page 478: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

476 4. Appendix

parameter name default value

L DEFL m channel length

LD m lateral diffusion length

W DEFW m channel width

WD m lateral diffusion width

Area related model parameters.

parameter name default value

NRD DEFNRD square number of squares for drain resistance

NRS DEFNRS square number of squares for source resistance

RD drain ohmic resistance

RDS - drain source shunt resistance

RS source ohmic resistance

RSH square drain and source diffusion sheet resistance

Parasitic resistance related model parameters.

parameter name default value

CBD F zero-bias bulk drain capacitance

CBS F zero-bias bulk source capacitance

CJ Fm2 zero-bias bottom bulk capacitance

CJSW Fm zero-bias sidewall bulk capacitance

FC forward-bias bulk junction capacitancecoefficient

MJ bulk junction bottom grading coefficient

MJSW bulk junction sidewall grading coefficient

PB V bulk bottom junction potential

PBSW V bulk sidewall junction potential

Junction capacitance related model parameters.

Page 479: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 477

parameter name default value

CGBO Fm gate-bulk overlap capacitance

CGDO Fm gate-drain overlap capacitance

CGSO Fm gate-source overlap capacitance

TT s transit time

Dynamic model parameters.

parameter name default value

TEMP K model temperature

TNOM K nominal temperature

Temperature related model parameters.

parameter name default value

AF flicker noise exponent

KF flicker noise coefficient

Noise related model parameters.

parameter name default value

AD DEFAD m2 drain diffusion area

AS DEFAS m2 source diffusion area

GMIN minimum conductance

LEVEL model index

M DEFM device multiplier

PD DEFPD m drain diffusion perimeter

PS DEFPS m source diffusion perimeter

Miscellaneous model parameters.

Page 480: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

478 4. Appendix

parameter name default value

DEFAD m2 default value for AD

DEFAS m2 default value for AS

DEFL m default value for L

DEFM default value for M

DEFNRD square default value for NRD

DEFNRS square default value for NRS

DEFPD m default value for PD

DEFPS m default value for PS

DEFW m default value for W

Parameter defaults set by global options.

The automatic reduction of the model complexity controlled via the global Analog Insydes optionModelLibrary influences the following parameters:

parameter name FullModels SimplifiedModels BasicModels

CGBO used used default

CGDO used used default

CGSO used used default

CJSW used default default

GAMMA used used default

RD used default default

RDS used default default

RS used default default

RSH used default default

TT used default default

Simplification related model parameters.

Page 481: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 479

Small-Signal Model

GbsCgs

D

S

Cgd

G

Gbd

Rs

Rd

Gds

gmb*vbs

vgs

gm*vgs

Cbd

Cbs

B

vbs

Cgb

Equivalent schematic for the AC analysis for the level 1-3 model

Page 482: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

480 4. Appendix

GbsCgs

D

S

Cgd

G

Gbd

s*DqdDvsb*vsb

s*DqdDvdb*vdbs*DqdDvgb*vgb

Rs

Rd

Gds

gmb*vbs

vgs

gm*vgs

Cbd

Cbs

B

vbs

vbdvgdCgb

s*DqgDvsb*vsb

s*DqgDvdb*vdbs*DqgDvgb*vgb

s*DqsDvsb*vsb

s*DqsDvdb*vdbs*DqsDvgb*vgb

s*DqbDvsb*vsb

s*DqbDvdb*vdbs*DqbDvgb*vgb

Equivalent schematic for the AC analysis for the BSIM model (simulator PSpice)

Page 483: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 481

vgd

Gbs

D

S

G

Gbd

s*Cds*vs

s*Cgs*vs

s*Cbs*vs

s*Css*vs

s*Cdb*vb

s*Cgb*vb

s*Cbb*vb

s*Csb*vb

s*Cdg*vg

s*Cgg*vg

s*Cbg*vg

s*Csg*vg

s*Cdd*vd

s*Cgd*vd

s*Cbd*vd

s*Csd*vd

Rs

Rd

Gds

gmb*vbsvgs

gm*vgsB

vbs

vbd

Equivalent schematic for the AC analysis for the BSIM model (simulator Eldo)

The small-signal model includes the following model parameters:

Page 484: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

482 4. Appendix

parameter name default value

Cbd CBD$ac bulk drain capacitance

Cbs CBS$ac bulk source capacitance

Cgb CGB$ac+CGBOV$ac gate bulk capacitance

Cgd CGD$ac+CGDOV$ac gate drain capacitance

Cgs CGS$ac+CGSOV$ac gate source capacitance

Gbd GBD$ac bulk drain conductance

Gbs GBS$ac bulk source conductance

Gds GDS$ac drain source conductance

gm GM$ac transconductance

gmb GMB$ac bulk transconductance

Rd RD drain resistance

Rs RS source resistance

Level 1-3 small-signal model parameters.

Page 485: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 483

parameter name default value

Cbdb DQBDVDB$ac derivative of bulk charge w.r.t. drain bulkvoltage

Cbgb DQBDVGB$ac derivative of bulk charge w.r.t. gate bulkvoltage

Cbsb DQBDVSB$ac derivative of bulk charge w.r.t. source bulkvoltage

Cddb DQDDVDB$ac derivative of drain charge w.r.t. drain bulkvoltage

Cdgb DQDDVGB$ac derivative of drain charge w.r.t. gate bulkvoltage

Cdsb DQDDVSB$ac derivative of drain charge w.r.t. source bulkvoltage

Cgdb DQGDVDB$ac derivative of gate charge w.r.t. drain bulkvoltage

Cggb DQGDVGB$ac derivative of gate charge w.r.t. gate bulkvoltage

Cgsb DQGDVSB$ac derivative of gate charge w.r.t. source bulkvoltage

Csdb DQSDVDB$ac derivative of source charge w.r.t. drain bulkvoltage

Csgb DQSDVGB$ac derivative of source charge w.r.t. gate bulkvoltage

Cssb DQSDVSB$ac derivative of source charge w.r.t. sourcebulk voltage

Additional small-signal model parameters for BSIM PSpice.

Page 486: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

484 4. Appendix

parameter name default value

Cb Cbb$ac derivative of bulk charge w.r.t. bulkpotential

Cbd0 Cbd$ac derivative of bulk charge w.r.t. drainpotential

Cbg0 Cbg$ac derivative of bulk charge w.r.t. gatepotential

Cbs0 Cbs$ac derivative of bulk charge w.r.t. sourcepotential

Cdb0 Cdb$ac derivative of drain charge w.r.t. bulkpotential

Cd Cdd$ac derivative of drain charge w.r.t. drainpotential

Cdg0 Cdg$ac derivative of drain charge w.r.t. gatepotential

Cds0 Cds$ac derivative of drain charge w.r.t. sourcepotential

Cgb0 Cgb$ac derivative of gate charge w.r.t. bulkpotential

Cgd0 Cgd$ac derivative of gate charge w.r.t. drainpotential

Cg Cgg$ac derivative of gate charge w.r.t. gate potential

Cgs0 Cgs$ac derivative of gate charge w.r.t. sourcepotential

Csb0 Csb$ac derivative of source charge w.r.t. bulkpotential

Csd0 Csd$ac derivative of source charge w.r.t. drainpotential

Csg0 Csg$ac derivative of source charge w.r.t. gatepotential

Cs Css$ac derivative of source charge w.r.t. sourcepotential

Additional small-signal model parameters for BSIM Eldo.

The automatic reduction of the model complexity controlled via the global Analog Insydes optionModelLibrary influences the following parameters:

Page 487: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 485

parameter name FullModels SimplifiedModels BasicModels

Cgb used ignored ignored

Gbd used used ignored

Gbs used used ignored

gmb used used ignored

Rd used ignored ignored

Rs used ignored ignored

Simplification related level 1-3 model parameters.

parameter name FullModels SimplifiedModels BasicModels

Cbd0 used used ignored

Cbg0 used used ignored

Cbs0 used used ignored

Cdb0 used used ignored

Cdg0 used used ignored

Cds0 used used ignored

Cgb0 used used ignored

Cgd0 used used ignored

Cgs0 used used ignored

Csb0 used used ignored

Csd0 used used ignored

Csg0 used used ignored

Simplification related BSIM Eldo model parameters.

4.3.4 Junction Field-Effect Transistor

syntax

Jname, n−>D, n−>G, n−>S, Model−>JFET, Selector−>selector, parametersdenotes a subcircuit reference for a JFET

Subcircuit reference for JFET.

Page 488: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

486 4. Appendix

D

G

S

D

G

S

Valid values for selector are: Spice, SpiceDC, SpiceAC, and SpiceNoise. Possible parameters aredescribed below.

Large-Signal Model

The analog behavioral model included in the Analog Insydes model library has the following portcharacteristics:

S

Current[D,G]

Voltage[D,G]

Voltage[S,G]

Current[S,G]

G

D

where G denotes the Gate, D the Drain, and S the Source, respectively. The port currents can beexpressed in the port variables as follows:

Drain: iDt Current[D,G]t

Source: iSt Current[S,G]t

Gate: iGt Current[D,G]t Current[S,G]t

Page 489: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 487

CGS

igs

D

S

igd

G

CGD

RS

RD

ids

Equivalent schematic for the DC and transient analysis

The large-signal model includes the following model parameters:

parameter name default value

ALPHA V ionization coefficient

BETA AV2 transconductance coefficient

IS A gate junction saturation current

ISR A gate junction recombination currentparameter

LAMBDA V channel length modulation

N gate junction emission coefficient

NR emission coefficient for ISR

VK V ionization knee voltage

VTO V threshold voltage

DC related model parameters.

Page 490: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

488 4. Appendix

parameter name default value

RD drain ohmic resistance

RS source ohmic resistance

Parasitic resistance related model parameters.

parameter name default value

CGD F zero-bias gate drain junction capacitance

CGS F zero-bias gate source junction capacitance

FC forward depletion capacitance coefficient

M gate junction grading coefficient

PB V gate junction potential

Capacitance related model parameters.

parameter name default value

BETATCE (BETATC) K BETA exponential temperature coefficient

EG eV energy gap

TEMP K model temperature

TNOM K nominal temperature

TRD1 K RD temperature coefficient

TRS1 K RS temperature coefficient

VTOTC VK VTO temperature coefficient

XTI saturation current temperature exponent

Temperature related model parameters.

Page 491: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 489

parameter name default value

AF flicker noise exponent

KF flicker noise coefficient

Noise related model parameters.

parameter name default value

AREA relative device area

GMIN minimum conductance

LEVEL model index

Miscellaneous model parameters.

The automatic reduction of the model complexity controlled via the global Analog Insydes optionModelLibrary influences the following parameters:

parameter name FullModels SimplifiedModels BasicModels

ALPHA used default default

ISR used used default

RD used default default

RS used default default

VK used default default

Simplification related model parameters.

Page 492: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

490 4. Appendix

Small-Signal Model

CgsGgs

D

S

Ggd

G

Cgd

Rs

Rd

Gds

gm*vgsvgs

Equivalent schematic for the AC analysis

The small-signal model includes the following model parameters:

parameter name default value

Cgd CGD$ac gate drain capacitance

Cgs CGS$ac gate source capacitance

Gds GDS$ac drain source conductance

Ggd GGD$ac gate drain conductance

Ggs GGS$ac gate source conductance

gm GM$ac transconductance

Rd RD/AREA drain resistance

Rs RS/AREA source resistance

Small-signal model parameters.

The automatic reduction of the model complexity controlled via the global Analog Insydes optionModelLibrary influences the following parameters:

Page 493: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

4.3 Model Library 491

parameter name FullModels SimplifiedModels BasicModels

Ggd used used ignored

Ggs used used ignored

Rd used ignored ignored

Rs used ignored ignored

Simplification related model parameters.

Page 494: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

Credits

Developers

Dipl.-Ing. Thomas Halfmann

Dr.-Ing. Eckhard Hennig

Dipl.-Ing. Jutta Praetorius

Dr.-Ing. Ralf Sommer

Dr.-Ing. Manfred Thole

Dipl.-Math. Tim Wichmann

Contributions

Michael Brickenstein

Dipl.-Math. Yves Drexlmeier

Stefan Feitig

Dipl.-Math. Jan Mark Tweer

Dipl.-Math. Michael Wiese

Anton Winterfeld

Design and Cover Art

Juliette Armbrecht

Dipl.-Math. Steffen Grutzner

Dipl. BK Gertrud Schrenk

Scientific Advisor

Prof. Dr. Gert-Martin Greuel

Director Fraunhofer-ITWM

Prof. Dr. Dieter Pratzel-Wolters

Page 495: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

Index

ABM (analog behavioral model), 90AbsolutePivotThreshold, option for

ApproximateMatrixEquation, 393AbsoluteValues, option value for MagnitudeDisplay,

82, 333AC, mode option for source value specification, 185

mode specification for NonlinearSetup, 404option value for AnalysisMode, 230

AC analysis, 282ACAnalysis, 282

example application, 159examples for, 284options description for, 283

AccuracyGoal, option for ApproximateDeterminant, 321option for LREigenpair, 314option for NDAESolve, 291

ACEquations, 248examples for, 250options description for, 249

AddElements, 256examples for, 256

Admittance, 448option value for Pattern, 183option value for Type, 43

Admittance elements, 43AI_NO_SITE_INIT, 433AI_NO_USER_INIT, 433AI_NO_WORKDIR_INIT, 433aiinit.m, 432airc, 432Amplifier, 457AMWave, 438

examples for, 439Analog behavioral models (ABM), 90AnalogInsydes, option value for Simulator, 429AnalysisMode, option for CircuitEquations, 230

option for NDAESolve, 293ApplyDesignPoint, 269

examples for, 271options description for, 270

ApproximateDeterminant, 318examples for, 327options description for, 321

ApproximateMatrixEquation, 134, 135, 391examples for, 395options description for, 393

ApproximateTransferFunction, 132, 387examples for, 388

Approximation, design point specification, 135methods, 132of expressions, 132of linear circuits, 127, 385of linear equations, ApproximateMatrixEquation,

134, 391of nonlinear circuits, 164, 401of nonlinear equations, CancelTerms, 165, 410of transfer functions,

ApproximateTransferFunction, 387AspectFactor, option for BodePlot, 331AspectRatio, option for BodePlot, 331AutoloadModels, option for ExpandSubcircuits, 222

BasicModels, option value for ModelLibrary, 427Behavioral models, 90

defining, 90referencing, 94

Bias point calculation, example for, 100Bipolar junction transistor (BJT), 464BJT, 464

example implementation, 98large-signal model, 464small-signal model, 472

Bode diagram, 81, 330BodePlot, 81, 330

examples for, 334options description for, 332

Branch currents, naming scheme for, 70Branch voltages, naming scheme for, 70BranchCurrentPrefix, option for CircuitEquations,

70, 231Branches, of controlled sources, 35, 38BranchVoltagePrefix, option for CircuitEquations,

70, 231BreakOnError, option for NDAESolve, 294Bug reports, 12

Page 496: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

494 CancelTerms — Design points Index

CancelTerms, 165, 410example application, 172examples for, 414options description for, 411

Capacitor, 449Capacitors, initial conditions for, 44CCCSource, 452CCVSource, 452CharacterMapping, option for ReadNetlist, 366CheckedAMWave, data type returned by AMWave, 438CheckedExpWave, data type returned by ExpWave, 440CheckedPulseWave, data type returned by PulseWave,

441CheckedPWLWave, data type returned by PWLWave, 442CheckedSFFMWave, data type returned by SFFMWave, 443CheckedSinWave, data type returned by SinWave, 445CircleMark, marker style for options PoleStyle and

ZeroStyle, 87, 354Circuit, 46, 179

examples for, 179Circuit equations, setting up and solving, 227Circuit object, 178

information on, Statistics, 277manipulating, 255showing contents, DisplayForm, 47

Circuit-description language, 178CircuitEquations, 71, 227, 231, 234, 235, 236

examples for, 239options description for, 230

Cleanup, option for ApplyDesignPoint, 270option for UpdateDesignPoint, 272

Clusterbound, option for CancelTerms, 412CMRR, 151ColorList, option for DXFGraphics, 422Common-mode gain, 149Common-mode rejection ratio, 151Compatibility to Version 1, 29Compiled, option for NDAESolve, 291

option for WriteSimulationData, 379Complex frequency, 79Complexity problem, 127ComplexityEstimate, 129, 385

examples for, 386ComplexValues, option for WriteSimulationData, 379CompressEquations, option for

ApproximateMatrixEquation, 393option for NDAESolve, 294

CompressMatrixEquation, 398examples for, 399

CompressNonlinearEquations, 95, 165, 407example application, 171examples for, 409options description for, 408

Conductance, 448Connectivity field, format for referencing subcircuits, 51Connectivity list, 34

Control system description, Circuit, 179Controlled sources, 35, 38Controlling branch, of controlled sources, 38Controlling currents, naming scheme for, 70Controlling voltages, naming scheme for, 70ControllingCurrentPrefix, option for

CircuitEquations, 70, 231ControllingVoltagePrefix, option for

CircuitEquations, 70, 232ConvertDataTo2D, 418

examples for, 419ConvertImmittances, option for CircuitEquations, 74,

232CrossMark, marker style for options PoleStyle and

ZeroStyle, 87, 354Current, into pin, 93

naming scheme for brach currents, 70naming scheme for controlling currents, 70reference direction, 155

Current, 92Current meter, 450Current-controlled sources, connection, 38CurrentSource, 451

DAE (differential-algebraic equations), 104DAEObject, information on, Statistics, 277

manipulating, 255showing contents, DisplayForm, 40

Data format, 280Database, for subcircuits, 62DataLabels, option for WriteSimulationData, 380DC, mode option for source value specification, 185

option value for AnalysisMode, 230, 293DC analysis, 290DC-transfer analysis, 107, 111, 290DCEquations, 251

examples for, 252options description for, 251

Decibels, option value for MagnitudeDisplay, 333DefaultACError, option value for ErrorFunction, 404DefaultACSimulation, option value for

SimulationFunction, 404DefaultDTError, option value for ErrorFunction, 402DefaultDTSimulation, option value for

SimulationFunction, 402Defaults, parameter for Model, 196DefaultSelector, option for CircuitEquations, 232

option for ExpandSubcircuits, 223Definition, parameter for Model, 48, 90, 92, 200Degrees, option value for PhaseDisplay, 333, 343DeleteElements, 257

examples for, 258Demo notebooks, 11DerivativePostfix, option for ACEquations, 249Design points, applying, ApplyDesignPoint, 269

extracting, GetDesignPoint, 268

Page 497: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

Index Design points — GetDAEOptions 495

for matrix approximation, 135generation of, 158numerical reference values, 131updating, UpdateDesignPoint, 272

DesignPoint, option for ApproximateDeterminant, 321option for ApproximateMatrixEquation, 393option for CircuitEquations, 233option for LREigenpair, 314option for MatchSymbols, 274option for NDAESolve, 294option for NoiseAnalysis, 287option for WriteModel, 382

Device mismatch, 149Differential gain, 148Differential-algebraic equations (DAE), 104Differentiator, 458Diode, 460

example model implementation, 91large-signal model, 460small-signal model, 463

DirectedLogError, option value for ErrorFunction, 322DisplayForm, 34, 40, 47Dominant pole, 159DT analysis, 107, 111, 290DXF, 419DXFGraphics, 419

examples for, 422options description for, 421

Ebers-Moll transistor model, example for, 96Eldo, option value for Simulator, 429Element types, 37Element values, 36

numerical values, 41symbolic values, 41

Elements, admittance elements, 43impedance elements, 43

ElementTypes, 37, 185examples for, 185

ElementValues, option for CircuitEquations, 79, 233EliminateVariables, option for

CompressNonlinearEquations, 408Email address, 6Environment variables, 433Equations, compressing nonlinear equations,

CompressNonlinearEquations, 165, 407extracting, GetEquations, 260for behavioral models, 92setting up, CircuitEquations, 227solving nonlinear equations, 95solving of, 72

Equations, parameter value for Definition, 90, 92Error, specification for equations, MaxError, 135

specification for expressions, 133Errorbound, option for CancelTerms, 412

ErrorFunction, AC mode option value forNonlinearSetup, 404

DT mode option value for NonlinearSetup, 402option for ApproximateDeterminant, 322

ESTA (extended sparse tableau analysis), 76ExpandSubcircuits, 53, 221

examples for, 224options description for, 222

Expansion, of subcircuits, 53Exponential, option value for FrequencyScaling, 85,

332, 343, 348option value for Sampling, 380

Exporting, behavioral models, WriteModel, 381simulation data, WriteSimulationData, 378

ExpWave, 439examples for, 440

Extended sparse tableau analysis (ESTA), 76ExtendedTableau, option value for Formulation, 76, 234

Features, detailed description of new features, 26overview of new features, 25

Fill-in pattern, 43FillColors, option for DXFGraphics, 421FindModel, 213

examples for, 213FindModelParameters, 214FindRoot, option value for NonlinearMethod, 297Fixator, 456Flat netlist, 53Formulation, option for CircuitEquations, 74, 234Four-terminal elements, 35FourierPlot, 341

examples for, 341Frequency, 186Frequency-domain analysis, 142FrequencyScaling, option for BodePlot, 332

option for NicholPlot, 86, 343option for NyquistPlot, 85, 347

FrequencyVariable, option for ACAnalysis, 283option for ACEquations, 249option for ApproximateDeterminant, 322option for CircuitEquations, 79, 234option for LREigenpair, 314option for NoiseAnalysis, 287

FullModels, option value for ModelLibrary, 427

GeneralizedEigensystem, 305examples for, 305option value for GEPSolver, 322

GeneralizedEigenvalues, 306examples for, 306

GEPSolver, option for ApproximateDeterminant, 322GEPSolverOptions, option for

ApproximateDeterminant, 322GetDAEOptions, 265

examples for, 265

Page 498: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

496 GetDesignPoint — KeepLocalModels Index

GetDesignPoint, 268examples for, 269

GetElements, 258examples for, 259

GetEquations, 260examples for, 260

GetMatrix, 261examples for, 262

GetParameters, 264examples for, 264

GetRHS, 263examples for, 263

GetVariables, 262examples for, 262

Global, parameter specification, 196parameter value for Scope, 62, 91, 193

Global subcircuit database, 62examining content, GlobalSubcircuits, 62

Global subcircuits, 61GlobalModelParameters, 215

examples for, 215GlobalParameters, 189GlobalSubcircuits, 62, 214

examples for, 215Graphics, Bode plot, 81, 330

Nichol plot, 85, 342Nyquist plot, 83, 346root locus plot, 86, 352transient waveform plot, 89, 106, 357

GraphicsSpacing, option for BodePlot, 332Ground node, 34, 50, 181

missing, CircuitEquations, 235

Hierarchical circuit, keep local model data,KeepLocalModels, 224

stop expansion, HoldModels, 223History list, recording, 413

visualization of, ShowCancellations, 417HoldModels, 223

option for ExpandSubcircuits, 223Home page, 6

IgnoreMissingGround, option for CircuitEquations,235

Impedance, input, 151output, 151

Impedance, 448option value for Pattern, 183option value for Type, 43

Impedance elements, 43Importing, netlists, ReadNetlist, 365

schematics, DXFGraphics, 419simulation data, ReadSimulationData, 376

Independent sources, examples for value specification,186

value specification, 185

IndependentVariable, option for CircuitEquations,235

Inductor, 449Inductors, initial conditions for, 44Info, 435

examples for, 435Init files, 432

list of loaded init files, 435Initial conditions, for capacitors and inductors, 44

transient analysis, 120InitialCondition, option for netlist entries, 44, 183InitialConditions, example application, 121, 122

option for CircuitEquations, 236option for NDAESolve, 294option for WriteModel, 382parameter for Model, 203

InitialGuess, option for CircuitEquations, 229option for DefaultDTSimulation, 403option for LREigenpair, 315option for NDAESolve, 118, 295option for WriteModel, 382parameter for Model, 202

Initialization procedure, 432InitialLeftEigenvector, option value for

ProjectionVectors, 316, 325InitialRightEigenvector, option value for

ProjectionVectors, 316, 325InitialSolution, option for ApproximateDeterminant,

323option for NDAESolve, 118, 295

InitialTime, option for CircuitEquations, 236option for DCEquations, 251

Input impedance, 151InputNoise, return value of NoiseAnalysis, 285InstanceNameSeparator, global Analog Insydes option,

426option for CircuitEquations, 71, 228option for ExpandSubcircuits, 222option for ReadNetlist, 366option for ShortenSymbols, 277

Integrator, 458Interfaces, 365InterpolateResult, option for ACAnalysis, 283InterpolationOrder, option for ACAnalysis, 283

option for NDAESolve, 295option for NoiseAnalysis, 287option for ReadSimulationData, 376option for WriteSimulationData, 380

Jacobian matrix, 157JFET, 485

large-signal model, 486small-signal model, 490

Junction field-effect transistor (JFET), 485

KeepLocalModels, 224

Page 499: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

Index KeepLocalModels — Model 497

option for ExpandSubcircuits, 224KeepPrefix, option for ReadNetlist, 367KeepSymbolic, option for ApplyDesignPoint, 270

Laplace frequency, 79Laplace-domain, AC equation setup, 230Large-signal analysis, 290

introduction, 104Large-signal model, BJT, 464

Diode, 460JFET, 486MOSFET, 474

LayerColor, option for DXFGraphics, 421LeastMeanInfluence, option value for SortingMethod,

394LeftEigenvector, option value for ProjectionVectors,

316, 325Level, option for CancelTerms, 412Levels, for nonlinear approximations, ShowLevel, 417LevelSeparator, option for ReadNetlist, 367Library, list contents, ListLibrary, 211

searching models, FindModel, 213LibraryPath, global Analog Insydes option, 426

option for CircuitEquations, 229option for ExpandSubcircuits, 222option for FindModel, 213option for FindModelParameters, 214option for ListLibrary, 212option for LoadModel, 216option for LoadModelParameters, 218option for ReadNetlist, 367

License, 434examples for, 434

Linear, option value for FrequencyScaling, 85, 332,343, 348

option value for MagnitudeDisplay, 82, 333option value for Sampling, 380

Linearization, of nonlinear DAEObjects, 248LinearRegionLimit, option for RootLocusPlot, 353LinearRegionSize, option for RootLocusPlot, 353LinearRegionStyle, option for RootLocusPlot, 353LineDashingScale, option for DXFGraphics, 421ListLibrary, 211

examples for, 212Loading Analog Insydes, 11Loading procedure, 432LoadModel, 216

examples for, 217LoadModelParameters, 217LoadMSBG, 424LoadQZ, 424Local, parameter value for Scope, 62, 193Local subcircuits, 61, 63LogError, option value for ErrorFunction, 322LPNP, 464LREigenpair, 312

examples for, 316option value for GEPSolver, 322options description for, 314

MagnitudeDisplay, option for BodePlot, 82, 332MAST, modeling language supported by WriteModel,

383Matching, of devices, 149

precision, 150MatchSymbols, 149, 274

example application, 149examples for, 275options description for, 274

Mathlink applications, MSBG.exe, 424QZ.exe, 424

Matrix formulation, CircuitEquations, 234MatrixEquation, option for CircuitEquations, 78, 229MaxDelta, option for NDAESolve, 118, 296MaxDivergentSteps, option for

ApproximateDeterminant, 323MaxError, 135

AC mode option value for NonlinearSetup, 404DT mode option value for NonlinearSetup, 402named parameter for error specifications in design

points, 391MaxIterations, 119

option for ApproximateDeterminant, 323option for DefaultDTSimulation, 403option for LREigenpair, 315option for NDAESolve, 119, 296

MaxResidual, option for ApproximateDeterminant, 323option for LREigenpair, 315

MaxShift, option for ApproximateDeterminant, 324MaxSteps, 119

option for NDAESolve, 119, 296MaxStepSize, option for NDAESolve, 119, 296MinMAC, option for ApproximateDeterminant, 324MinStepSize, option for NDAESolve, 119, 296Mismatch of devices, 149MNA (modified nodal analysis), 74Model, behavioral models, 90

definition of, 190exchanging device models, 187expanding, 221exporting, WriteModel, 381global model library, 62loading from library, LoadModel, 216model library, 460parameter cards, 189referencing, 51, 187variables of behavioral models, 93

Model, 47, 188, 190argument description, 191defining behavioral models, 90examples for model implementation, 204option for netlist entries, 45

Page 500: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

498 Model library — Options Index

Model library, 460defining global model library, 62library management, 211

ModelLibrary, examples for, 427global Analog Insydes option, 427option for CircuitEquations, 230option for ExpandSubcircuits, 222option for FindModel, 213option for FindModelParameters, 214option for ListLibrary, 212option for LoadModel, 216option for LoadModelParameters, 218

ModelParameters, 189ModeValues, option for DCEquations, 251Modified nodal analysis (MNA), 74ModifiedNodal, option value for Formulation, 74, 234MOS field-effect transistor, 474MOSFET, 474

advanced modeling, 157large-signal model, 474modeling examples, 143small-signal model, 142, 479

MSBG.exe, 424

Name, parameter for Model, 48, 191Name/selector specification, 49Naming conventions, 70NDAESolve, 105, 115, 290

examples for, 299implemented algorithms, 115options description for, 118, 293

Netlist, format of, 33, 178importing, ReadNetlist, 365

Netlist, 178, 185examples for, 178

Netlist entries, examples for, 181extended format, 41format, 34, 180format for subcircuit references, 51, 60option examples for, 184options, 182

Netlist object, 178information on, Statistics, 277manipulating, 255showing contents, DisplayForm, 34

New features in Analog Insydes Version 2, 25Newsletter, 6Newton-Raphson algorithm, 116NewtonIteration, example application, 111

option value for NonlinearMethod, 297Nichol diagram, 85, 342NicholPlot, 85, 342

examples for, 344options description for, 343

NMOS, 474small-signal model, 142

Node identifier, 34Node voltages, naming scheme for, 70Nodes, 34, 181, 194NodeVoltagePrefix, option for CircuitEquations, 70,

236Noise analysis, 285NoiseAnalysis, 285

examples for, 288options description for, 287

Nonlinear approximation, CancelTerms, 165, 410example application for, 166setting up, NonlinearSetup, 401status of, NonlinearSettings, 415term levels, ShowLevel, 417

Nonlinear equation solving, NDAESolve, 115number of integration steps, MaxSteps, 119number of Newton iterations, MaxIterations, 119

Nonlinear equations, compressing,CompressNonlinearEquations, 165, 407

setting up, 94solving, 95

NonlinearMethod, option for NDAESolve, 119, 296NonlinearSettings, 415

examples for, 416NonlinearSetup, 401

AC mode specifications for, 404DT mode specifications for, 402example application, 172examples for, 405

Norator, 455Normalize, option for GeneralizedEigensystem, 305Notebook, option value for Protocol, 428NPN, 464Nullator, 455Numerical solving, ACAnalysis, 282

NDAESolve, 290NoiseAnalysis, 285

NumericalAccuracy, option forApproximateMatrixEquation, 393

Nyquist diagram, 83, 346NyquistPlot, 83, 346

examples for, 348options description for, 347

Online help system, 23OP analysis, 290OPAmp, 454OpenCircuit, 449Operating point, 118Operating-point analysis, 290OperatingPointPostfix, option for ACEquations, 249Option inheritance, 430

examples for, 430Optional, model port specification, 194Options, global Analog Insydes options, 425

of netlist entries, 41

Page 501: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

Index Options — Referencing 499

retrieving DAEObject options, GetDAEOptions, 265setting DAEObject options, SetDAEOptions, 266setting default options on startup, 433

Options[AnalogInsydes], 425examples for, 426

OTAmp, 454Output impedance, 151

example application, 152OutputNoise, return value of NoiseAnalysis, 285OutputVariables, option for NDAESolve, 297

Palette, 23Parameter sweep, 280

examples for, 281Parameters, declaration for subcircuits, 57

implicit translation, 65inspecting parameter database,

GlobalModelParameters, 215loading from library, LoadModelParameters, 217of subcircuits, 56removing, RemoveModelParameters, 219

Parameters, parameter for Model, 57, 60, 195Parametric, option for TransientPlot, 124, 359Parametric analysis, 290

example circuit, 113Pattern, option for netlist entries, 43, 183PhaseDisplay, option for BodePlot, 82, 333

option for NicholPlot, 86, 343PivotThreshold, option for

ApproximateMatrixEquation, 393PlotPoints, option for BodePlot, 332

option for FourierPlot, 341option for RootLocusPlot, 353option for WriteSimulationData, 380

PlotRange, option for BodePlot, 82, 333option for RootLocusPlot, 354option for TransientPlot, 359

Plots, Bode plot, 81, 330Nichol plot, 85, 342Nyquist plot, 83, 346root locus plot, 86, 352transient waveform plot, 89, 106, 357

PlotStyle, option for RootLocusPlot, 354PlusMark, marker style for options PoleStyle and

ZeroStyle, 87, 354PMOS, 474

small-signal model, 142PNP, 464PointMark, marker style for options PoleStyle and

ZeroStyle, 87, 354PointsPerDecade, option for ACAnalysis, 284

option for NoiseAnalysis, 287Pole/zero analysis, 304PolesAndZerosByQZ, 307

examples for, 307PolesByQZ, 308

examples for, 309PoleStyle, option for RootLocusPlot, 87Ports, of behavioral models, 92

optional port nodes, 194port currents, 92port voltages, 92

Ports, parameter for Model, 48, 194Prefix, customizing prefix settings, 70

for branch voltages and currents, 70for controlling voltages and currents, 70for node voltages, 70specification, CircuitEquations, 231, 236

Prescaling, option for ApproximateDeterminant, 324option for LREigenpair, 315

PrimaryDesignPoint, option value for SortingMethod,394

ProjectionVectors, option forApproximateDeterminant, 325

option for LREigenpair, 315Protocol, examples for, 429

global Analog Insydes option, 428PSpice, option value for Simulator, 429PulseWave, 441

examples for, 441PWLWave, 442

examples for, 443

QuasiSingularity, option forApproximateMatrixEquation, 394

QZ.exe, 424

Radians, option value for PhaseDisplay, 333, 343RandomFunction, option for NDAESolve, 297Range, AC mode option value for NonlinearSetup, 404

DT mode option value for NonlinearSetup, 402Ranking, least mean influence, 141

of terms, 140Ranking, option for CancelTerms, 413ReadNetlist, 365

example application, 145examples for, 368options description for, 366supported features for AnalogInsydes, 369supported features for Eldo, 371supported features for PSpice, 369supported features for Saber, 374

ReadSimulationData, 376examples for, 378options description for, 376

RecomputationThreshold, option forApproximateMatrixEquation, 394

RecordCancellations, option for CancelTerms, 413Reference designator, 34, 71, 180Reference directions, for currents and voltages, 35, 155

for port branches, 92Referencing, behavioral models, 94

Page 502: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

500 Referencing — SortingMethod Index

subcircuits, 51ReleaseInfo, 433

examples for, 433ReleaseNumber, 434

examples for, 434RemoveModelParameters, 219

examples for, 219RemoveSubcircuit, 63, 218

examples for, 219RemoveSubcircuits, 63, 218RenameNodes, 259

examples for, 259Resistor, 447ReturnDerivatives, option for NDAESolve, 297ReturnSymbols, option for SimplifySamplePoints, 415RightEigenvector, option value for

ProjectionVectors, 316, 325Root locus diagram, 86, 352

animated, 89of transfer functions without parameters, 88

RootLocusByQZ, 310examples for, 311

RootLocusPlot, 86, 352examples for, 355options description for, 353

Saber, option value for Simulator, 429SAG (simplification after generation), 132, 385

ApproximateTransferFunction, 387combination with SBG, 138

Sampling, option for WriteSimulationData, 380SBG (simplification before generation), 132, 134, 385

ApproximateMatrixEquation, 391combination with SAG, 138

Schematic pictures, 419Scope, of subcircuit definitions, 61Scope, option for LoadModel, 216

option for LoadModelParameters, 218parameter for Model, 62, 63, 193

SDG (simplification during generation), 132SearchDirections, option for SimplifySamplePoints,

415Searching, model parameters, FindModelParameters, 214

models, FindModel, 213Selector, parameter for Model, 48, 192SetDAEOptions, 266

examples for, 267SFFMWave, 443

examples for, 444ShortCircuit, 450ShortenSymbols, 276

options for, 276ShowCancellations, 417ShowColors, option for DXFGraphics, 421ShowLegend, option for BodePlot, 332

option for NicholPlot, 343

option for NyquistPlot, 347option for RootLocusPlot, 353option for TransientPlot, 359

ShowLevel, 417ShowSamplePoints, option for TransientPlot, 125, 359ShowUnitCircle, option for NyquistPlot, 348SignalSource, 457Simplification, design point specification, 135

methods, 132of expressions, 132of linear circuits, 127, 385of linear equations, ApproximateMatrixEquation,

134of nonlinear circuits, 164, 401of nonlinear equations, CancelTerms, 165, 410

Simplification after generation (SAG), 132, 385combination with SBG, 138

Simplification before generation (SBG), 132, 134, 385combination with SAG, 138

Simplification during generation (SDG), 132SimplifiedModels, option value for ModelLibrary, 427SimplifySamplePoints, 414Simulation data, exporting, WriteSimulationData, 378

importing, ReadSimulationData, 376SimulationFunction, AC mode option value for

NonlinearSetup, 404DT mode option value for NonlinearSetup, 402

Simulator, global Analog Insydes option, 429option for NDAESolve, 297option for ReadNetlist, 367option for ReadSimulationData, 377option for WriteModel, 383option for WriteSimulationData, 380

SimulatorExecutable, option for NDAESolve, 298SingleDiagram, option for TransientPlot, 125, 359SingularityTest, option for ApproximateDeterminant,

326SingularityTestByLU, option value for

SingularityTest, 326SingularityTestByQR, option value for

SingularityTest, 326SinWave, 444

examples for, 445Small-signal analysis, 282Small-signal model, BJT, 472

Diode, 463JFET, 490MOSFET, 142, 479

Solve, 72, 253examples for, 253

Solving, ACAnalysis, 282NDAESolve, 290NoiseAnalysis, 285Solve, 253

SortingMethod, option forApproximateMatrixEquation, 140, 394

Page 503: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

Index Sources — Type tag 501

Sources, stimuli for two-port calculations, 155Sparse tableau analysis (STA), 75

extended sparse tableau analysis (ESTA), 76SparseTableau, option value for Formulation, 75, 234SquareMark, marker style for options PoleStyle and

ZeroStyle, 87, 354STA (sparse tableau analysis), 75Stability analysis, 83Starting Analog Insydes, 432StartingStepSize, option for NDAESolve, 120, 298Statistics, 277

examples for, 278StatusLine, option value for Protocol, 428StepSizeFactor, option for NDAESolve, 120, 298Stimulus sources, 155StripIndependentBlocks, option for

ApproximateMatrixEquation, 395option for CompressMatrixEquation, 399option for CompressNonlinearEquations, 408

Subcircuit, definition of, 190expanding, 53, 221generic selectors, 52global and local definitions, 61global database for, 62inspecting subcircuit database, GlobalSubcircuits,

214local overrides, 63parameters, 56, 57passing parameter values to, 60redefining global subcircuits, 63referencing, 51removing, RemoveSubcircuits, 63, 218translation of parameters, 65

Subcircuit, 47, 188, 210option for netlist entries, 45

SweepParameters, Analog Insydes data format, 280option for TransientPlot, 360

SweepPath, option for ACAnalysis, 284option for NoiseAnalysis, 287

Symbolic, option for CircuitEquations, 237option for ExpandSubcircuits, 222option for netlist entries, 41, 183option for source value specification, 185option value for ElementValues, 79, 234parameter for Model, 198

Symbolic approximation, complexity problem, 127design point specification, 135introduction, 127methods, 132of expressions, 132of linear circuits, 127, 385of linear equations, ApproximateMatrixEquation,

134of nonlinear circuits, 401of nonlinear equations, CancelTerms, 410

Symbolic expressions, approximation of, 129

Symbolic solving, Solve, 253

TestFrequency, option for ApproximateDeterminant,326

TextSizing, option for DXFGraphics, 421TextStyle, option for DXFGraphics, 421ThicknessFunction, option for DXFGraphics, 422Time, 186Time variable, 105Time-domain analysis, 104TimeConstraint, option for Statistics, 278TimeVariable, option for CircuitEquations, 238Tolerance, option for ApproximateDeterminant, 327

option for LREigenpair, 316option for MatchSymbols, 275

TraceNames, option for BodePlot, 333option for NicholPlot, 344option for NyquistPlot, 348

Transfer function, approximation,ApproximateTransferFunction, 132

complexity, ComplexityEstimate, 129example application, 162plotting gain vs. phase, NicholPlot, 85, 342plotting magnitude and phase, BodePlot, 81, 330plotting real vs. imaginary part, NyquistPlot, 83,

346TransferFunction, 459Transient, mode option for source value specification,

185option value for AnalysisMode, 230, 293

Transient analysis, 290example circuit, 106, 108initial conditions, 120introduction, 104procedure, 115

Transient waveforms, 89, 357TransientPlot, 106, 357

examples for, 360options description for, 124, 358

Transistor models, 142advanced modeling, 157

Translation, of subcircuit parameters, 65Translation, parameter for Model, 65, 197TransmissionLine, 458Trapezoidal rule, 115Two-port parameters, 154Two-port representation, admittance form, 154

cascade form, 154hybrid form, 154impedance form, 154

Two-terminal elements, 35Type, option for netlist entries, 42, 184Type tag, 34

for controlled sources, 38overriding default type, 42

Page 504: Dipl.-Ing. Thomas Halfmann Dr.-Ing. Eckhard Hennig Dr.-Ing ... · PDF fileanalog electronic circuits. ... If you have questions concerning Analog Insydes, ... The most important Analog

502 UnitCircleStyle — ZeroStyle Index

UnitCircleStyle, option for NyquistPlot, 348Units, 36UnloadMSBG, 424UnloadQZ, 424UnwrapPhase, option for BodePlot, 334UnwrapTolerance, option for BodePlot, 334UpdateDesignPoint, 272

examples for, 273options description for, 272

UseExternals, global Analog Insydes option, 429option for ApproximateMatrixEquation, 395

Value, option for CircuitEquations, 238option for ExpandSubcircuits, 222option for netlist entries, 41, 181option for source value specification, 185option value for ElementValues, 79, 234

Value field, 41Value specification, for different analysis modes,

Netlist, 185Variables, independent, CircuitEquations, 235

of behavioral model equations, 93Variables, parameter for Model, 93, 199VCCSource, 453VCVSource, 453Version, 434

examples for, 435Voltage, naming scheme for branch voltages, 70

naming scheme for controlling voltages, 70naming scheme for node voltages, 70reference direction, 155

Voltage, 92Voltage gain, 146Voltage meter, 450VoltageSource, 451

Web page, 6WorkingPrecision, option for NDAESolve, 291WriteModel, 381

examples for, 383options description for, 382

WriteSimulationData, 378examples for, 380options description for, 379

Y-parameters, 155

Zero node, 34, 50Zero-state response, 41ZerosByQZ, 309

examples for, 310ZeroStyle, option for RootLocusPlot, 87, 354