BEHAVIORAL MODELING AND TRANSIENT ANALYSIS WITH ANALOG INSYDES

Similar documents
APPLICATION TO TRANSIENT ANALYSIS OF ELECTRICAL CIRCUITS

Symbolic Model Reduction for Linear and Nonlinear DAEs

Basic RL and RC Circuits R-L TRANSIENTS: STORAGE CYCLE. Engineering Collage Electrical Engineering Dep. Dr. Ibrahim Aljubouri

Problem info Geometry model Labelled Objects Results Nonlinear dependencies

Lesson 14: Van der Pol Circuit and ode23s

Quiescent Steady State (DC) Analysis The Newton-Raphson Method

Chapter 2. Engr228 Circuit Analysis. Dr Curtis Nelson

Chapter 10 Sinusoidal Steady State Analysis Chapter Objectives:

Electric Circuits I FINAL EXAMINATION

f = 1 T 6 a.c. (Alternating Current) Circuits Most signals of interest in electronics are periodic : they repeat regularly as a function of time.

Parallel VLSI CAD Algorithms. Lecture 1 Introduction Zhuo Feng

The Harmonic Balance Method

Sinusoidal Steady-State Analysis

9. Introduction and Chapter Objectives

Advanced Computational Methods for VLSI Systems. Lecture 4 RF Circuit Simulation Methods. Zhuo Feng

ENGR 2405 Chapter 8. Second Order Circuits

Electrical Circuits I

Basic. Theory. ircuit. Charles A. Desoer. Ernest S. Kuh. and. McGraw-Hill Book Company

Simple Chaotic Oscillator: From Mathematical Model to Practical Experiment

Implementing Memristor Based Chaotic Circuits

NONLINEAR DC ANALYSIS

Electric Circuits I. Nodal Analysis. Dr. Firas Obeidat

Jacobi-Davidson methods and preconditioning with applications in pole-zero analysis

To find the step response of an RC circuit

Notes for course EE1.1 Circuit Analysis TOPIC 10 2-PORT CIRCUITS

Electric Circuits I Final Examination

Lecture #3. Review: Power

1. Review of Circuit Theory Concepts

Basics of Network Theory (Part-I)

Chapter 33. Alternating Current Circuits

UNIT 4 DC EQUIVALENT CIRCUIT AND NETWORK THEOREMS

SPICE Like Sparse Transient Analysis

CHAPTER 4. Circuit Theorems

Network Graphs and Tellegen s Theorem

Chapter 3 : Linear Differential Eqn. Chapter 3 : Linear Differential Eqn.

Practical 1 RC Circuits

ES205 Analysis and Design of Engineering Systems: Lab 1: An Introductory Tutorial: Getting Started with SIMULINK

Switching Flow Graph Model

2.004 Dynamics and Control II Spring 2008

Proposed SPICE model for core loss

REACTANCE. By: Enzo Paterno Date: 03/2013

Numerical Algorithms for ODEs/DAEs (Transient Analysis)

A simple electronic circuit to demonstrate bifurcation and chaos

Electrical Circuits I

Experimental verification of the Chua s circuit designed with UGCs

EXPERIMENT 5A RC Circuits

Appendix A Installing QUCS

RLC Series Circuit. We can define effective resistances for capacitors and inductors: 1 = Capacitive reactance:

Circuits Advanced Topics by Dr. Colton (Fall 2016)

Electric Circuit Theory

Electrical Engineering Fundamentals for Non-Electrical Engineers

Fall 2011 ME 2305 Network Analysis. Sinusoidal Steady State Analysis of RLC Circuits

MODELLING OF RECIPROCAL TRANSDUCER SYSTEM ACCOUNTING FOR NONLINEAR CONSTITUTIVE RELATIONS

LECTURE 8 RC AND RL FIRST-ORDER CIRCUITS (PART 1)

AC Circuits Homework Set

Outline. Week 5: Circuits. Course Notes: 3.5. Goals: Use linear algebra to determine voltage drops and branch currents.

Kirchhoff's Laws and Circuit Analysis (EC 2)

A New Circuit for Generating Chaos and Complexity: Analysis of the Beats Phenomenon

Lab 1 Getting Started with EDA Tools

Series and Parallel ac Circuits

ECE 497 JS Lecture - 11 Modeling Devices for SI

QUESTION BANK SUBJECT: NETWORK ANALYSIS (10ES34)

Chapter 10: Sinusoids and Phasors

8. Introduction and Chapter Objectives

A New Dynamic Phenomenon in Nonlinear Circuits: State-Space Analysis of Chaotic Beats

MAS601 Design, Modeling & Simulation. Day 2

Mathematical Modelling Using SimScape (Electrical Systems)

Module 2. DC Circuit. Version 2 EE IIT, Kharagpur

A Domain Decomposition Approach for Calculating the Graph Corresponding to a Fibrous Geometry

The RLC circuits have a wide range of applications, including oscillators and frequency filters

Experiment 9 Equivalent Circuits

Model Order Reduction using SPICE Simulation Traces. Technical Report

I. Numerical Computing

Numerical Simulation of Dynamic Systems XXVI

CHAPTER 5 STEADY-STATE ANALYSIS OF THREE-PHASE SELF-EXCITED INDUCTION GENERATORS

First-order transient

8 sin 3 V. For the circuit given, determine the voltage v for all time t. Assume that no energy is stored in the circuit before t = 0.

Dynamic Modeling. For the mechanical translational system shown in Figure 1, determine a set of first order

Modeling of Dynamic Systems: Notes on Bond Graphs Version 1.0 Copyright Diane L. Peters, Ph.D., P.E.

Review for Exam 2 Ben Wang and Mark Styczynski

Writing Circuit Equations

Chapter 1, Section 1.2, Example 9 (page 13) and Exercise 29 (page 15). Use the Uniqueness Tool. Select the option ẋ = x

NONLINEAR AND ADAPTIVE (INTELLIGENT) SYSTEMS MODELING, DESIGN, & CONTROL A Building Block Approach

Chapter 7 Direct-Current Circuits

REUNotes08-CircuitBasics May 28, 2008

ECE 220 Laboratory 4 Volt Meter, Comparators, and Timer

ECE 546 Lecture 16 MNA and SPICE

3 The non-linear elements

RC & RL Transient Response

Chapter 10 AC Analysis Using Phasors

Some of the different forms of a signal, obtained by transformations, are shown in the figure. jwt e z. jwt z e

EE 40: Introduction to Microelectronic Circuits Spring 2008: Midterm 2

Achieving Accurate Results With a Circuit Simulator. Ken Kundert and Ian Clifford Cadence Design Systems Analog Division San Jose, Calif 95134

What happens when things change. Transient current and voltage relationships in a simple resistive circuit.

Laboratory I: Impedance

Experiment Guide for RC Circuits

Handout 11: AC circuit. AC generator

Two-Port Networks Admittance Parameters CHAPTER16 THE LEARNING GOALS FOR THIS CHAPTER ARE THAT STUDENTS SHOULD BE ABLE TO:

Sophomore Physics Laboratory (PH005/105)

UNIT I Introduction to DC and AC circuits

Transcription:

BEHAVIORAL MODELING AND TRANSIENT ANALYSIS WITH ANALOG INSYDES Thomas Halfmann, Eckhard Hennig, Manfred Thole ITWM Institut für Techno- und Wirtschaftsmathematik, Kaiserslautern, Germany {halfmann, hennig, thole}@itwm.uni-kl.de ABSTRACT This paper presents some new extensions of our Mathematica toolbox Analog Insydes for modeling and analysis of nonlinear circuits. Circuits are described by means of hierarchical netlists containing top-level netlists, subcircuits, and symbolic device model descriptions from which circuit equations can be set up in sparse tableau or modified nodal formulation. Some examples of Analog Insydes nonlinear behavioral modeling capabilities are demonstrated. Transient circuit analysis is performed by application of a dedicated numerical DAE (Differential and Algebraic Equation) solver. The implementation of the solver is highlighted because most computer algebra systems provide solvers for systems of differential equations only. 1. THE NETLIST FORMAT This section gives a brief introduction to the netlist format of Analog Insydes [1. Analog Insydes provides mechanisms for describing circuits hierarchically in terms of netlists and subcircuits. The hierachically structured circuit description comprises a top-level netlist with subcircuit or model references, and a set of subcircuit or model definitions. A netlist consists of a sequence of netlist entries which either can be a reference to a primitive circuit element or to a subcircuit. Netlist entries must be lists of three components as there are {reference designator, {connectivity}, value field} where the reference designator identifies a particular circuit element, the connectivity list specifies the nodes of the circuit to which the terminals of the element are connected, and the value field specifies the numerical quantity or symbolic expression of a circuit element. 2. BEHAVIORAL MODELS Models which are based on sets of mathematical equations describing the behavior of a circuit element or an analog building block are frequently called (analog) behavioral models, or ABMs. A behavioral model is similar to a subcircuit object in that it constitutes a box which is connected to a circuit through electrical ports. The difference is that the interior of a behavioral model box is implemented in terms of algebraic or differential equations rather than a netlist. 2.1. ABM IMPLEMENTATION Analog Insydes behavioral modeling capabilities allow for modeling arbitrary nonlinear and dynamic element characteristics. The full syntax for an ABM definition is shown below. Name -> subcircuit class name, Selector -> selector, Scope -> scope, Ports -> {portnodes}, Parameters -> {parameters}, Translation -> {parameter translation rules}, Variables -> {variables}, Definition -> {equations} The Model function takes eight arguments which must all be written in Mathematica's option syntax keyword -> value. The Name argument identifies an entire group, or class, of different subcircuit implementations of a non-primitive object. The Selector argument then selects one particular member from this class. The Scope

argument specifies whether the model definition is limited to the circuit in which the definition is made or whether it is stored in the global subcircuit database and made accessible to other circuits. The Ports argument defines the port nodes of a subcircuit structure which serve as external connection points. The Parameters argument specifies which symbols in a subcircuit definition denote formal model parameters that can be accessed from a netlist on a higher hierarchy level. The Translation argument defines functional relations between formal subcircuit parameters and internal element values. For behavioral model definitions, the right-hand side of the Definition argument must be a list of symbolic device equations. The Variables argument serves to specify the symbols which are unknowns of the model equations. Behavioral models defined with the Model command can be referenced from a netlist on a higher hierarchy level by a netlist entry whose value field contains the options Model and Selector {instance name, {connectivity}, Model -> classname, Selector -> selector} To reference a subcircuit object the subcircuit classname and the selector must be the same identifiers as those given as arguments to the Name and Selector parameters in the corresponding Model statement. NL 1 2 C1 Figure 1: Chua s circuit R 2.2. ABM CAPABILITIES In this section we demonstrate the large variety of device modeling capabilities of Analog Insydes using Chua s circuit (see Figure 1), a well-known example for a simple nonlinear autonomous oscillator circuit which exhibits chaotic behavior. The circuit consists of a resistor R, two capacitors C1 and C2, an inductor L, and an active nonlinear conductance NL. The values of the circuit elements are assumed to be R = 1.43 Ω, C1 = 111 mf, C2 = 1 F, and L = 143 mh [2. The active nonlinear conductance NL has an ArcTan-shaped voltage-current relation as illustrated in Figure 2. To observe chaotic oscillations it is not necessary to use an exact ArcTan shape. Many other functions which resemble such a voltage-current relation qualitatively can be C2 L used as well. Within Mathematica the voltage-current relation can be described in various ways: ArcTan function (see Figure 2) NLCurrent == -ArcTan[NLVoltage piecewise linear (PWL) function using Mathematica s data type InterpolatingFunction (see Figure 3) NLCurrent == Interpolation[ {{-6., 2.8}, {-5., 2.8}, {-1., 0.8}, {1, -0.8}, {5, -2.8}, {6, -2.8}}, InterpolationOrder -> 1 [NLVoltage piecewise linear function, implemented procedurally using Mathematica s control structure Which (see Figure 3) NLCurrent == Which[ NLVoltage -5., 2.8, NLVoltage -1., -0.5*NLVoltage+0.3, NLVoltage 1., -0.8*NLVoltage, NLVoltage 5., -0.5*NLVoltage-0.3, 0 == 0, -2.8 polynomial approximation (see Figure 4) NLCurrent == -0.81*NLVoltage+0.01*NLVoltage^3 The next step is now the implementation of the different voltage-current relations of the nonlinear conductance as a library of analog behavioral models within Analog Insydes. Therefore, we define the model class ChuaNL containing four different models which are then stored in the global subcircuit/model database by applying the function ExpandSubcircuits. In[1:= NLModels = Circuit[ (* ArcTan Model *) Name -> ChuaNL, Selector -> ArcTan, Scope -> Global, Ports -> {A, B}, Variables -> {Current[A, B, Voltage[A, B}, Definition -> {Current[A, B == -ArcTan[Voltage[A, B},

Current 1.5 1 0.5-6 -4-2 2 4 6 Voltage -0.5-1 -1.5 Figure 2: ArcTan function Current 2 1-6 -4-2 2 4 6 Voltage -1-2 Figure 3: Piecewise linear function Current 2 1-6 -4-2 2 4 6 Voltage -1-2 Figure 4: Polynomial approximation

(* PWL Interpolation Model *) Name -> ChuaNL, Selector -> PWLInterpolation, Scope -> Global, Ports -> {A, B}, Variables -> {Current[A, B, Voltage[A, B}, Definition -> {Current[A, B == Interpolation[ {{-6.,2.8},{-5.,2.8},{-1.,0.8}, {1,-0.8}, {5,-2.8}, {6,-2.8}}, InterpolationOrder -> 1 [Voltage[A, B}, (* PWL Which Model *) Name -> ChuaNL, Selector -> PWLWhich, Scope -> Global, Ports -> {A, B}, Variables -> {Current[A, B, Voltage[A, B, VAB}, Definition -> {VAB == Voltage[A, B, Current[A, B == Which[ VAB -5.,2.8, VAB -1.,-0.5*VAB+0.3, VAB 1.,-0.8*VAB, VAB 5.,-0.5*VAB-0.3, 0 == 0,-2.8 }, (* Polynomial Model *) Name -> ChuaNL, Selector -> Polynomial, Scope -> Global, Ports -> {A, B}, Variables -> {Current[A, B, Voltage[A, B}, Definition -> {Current[A, B == -0.81*Voltage[A, B+ 0.01*Voltage[A, B^3} // ExpandSubcircuits; 3. TRANSIENT CIRCUIT ANALYSIS This section summarizes the steps which are necessary to perform a transient analysis of a dynamic circuit within Analog Insydes. Following, the transient analysis procedure is demonstrated on Chua s circuit. 3.1. WRITE CIRCUIT NETLIST First, we start with writing a netlist description of the circuit to be simulated, specifying numerical values for all circuit elements. In[2:= ChuasCircuit= Circuit[ Netlist[ {C2,{2, 0}, 1.}, {L, {0, 2}, 0.143}, {C1,{1, 0}, 0.111}, {R, {2, 1}, 1.43}, {NL,{1 -> A, 0 -> B}, Model -> ChuaNL, Selector -> NLMODEL } ; Note that we referenced the nonlinear conductance NL by the subcircuit class name ChuaNL and the selector variable NLMODEL. This allows for choosing the nonlinear model at run time without editing the circuit netlist. 3.2. SET UP CIRCUIT EQUATIONS Next, we let Analog Insydes set up a system of time-domain modified nodal equations from the netlist description of Chua s circuit. Therefore, we apply the function CircuitEquations with the option setting TimeDomain -> True in order to express all voltages and currents as functions of time and to include time derivatives introduced by dynamic components. Here, we use the ArcTan model for the nonlinear conductance. To try out other models the right-hand side of the rule NLMODEL ->... has to be replaced by the corresponding model selector names. The list returned by CircuitEquations contains two components, the list of scalar time-domain equations and the list of unknown node voltages and impedance branch currents. In the example, the set of modified nodal equations is a typical DAE system. It comprises implicit differential equations as well as both linear and nonlinear constraints.

In[3:= ChuaMNA = CircuitEquations[ ChuasCircuit /. NLMODEL -> ArcTan, TimeDomain -> True Out[3= {{ I$AB$NL[t + 0.7*(V$1[t-V$2[t)+ 0.111*V$1 [t == 0, -I$L[t + 0.7*(-V$1[t + V$2[t) + V$2 [t == 0, V$2[t + 0.143*I$L [t == 0, I$AB$NL[t == -ArcTan[V$1[t}, {V$1[t, V$2[t, I$L[t, I$AB$NL[t}} Out[4= {{ V$1 -> InterpolatingFunction [{{0.,120.}},"<>", V$2 -> InterpolatingFunction [{{0.,120.}},"<>", I$L -> InterpolatingFunction [{{0.,120.}},"<>", I$AB$NL -> InterpolatingFunction [{{0.,120.}},"<>" }} The solver returns the solutions for the node voltages and currents in terms of Mathematica s Interpolating- Function objects. This allows for accessing the numerical values of all circuit variables at any point of time in the simulation interval. 3.3. NUMERICAL CIRCUIT SIMULATION When analyzing circuits we are usually interested in finding the response of the circuit to a given input signal as a function of time. This analysis mode is commonly referred to as transient analysis. Computing a transient response requires the numerical solution of an implicit DAE system, starting from an initial solution for the voltages and currents known as the DC (Direct Current) operating point. Analog Insydes provides a dedicated function, called NDAESolve, for solving DAE systems numerically, as most computer algebra systems can handle only systems of differential equations. The implementation of Analog Insydes DAE solver will be highlighted in Section 4. To simulate the transient behavior of Chua s circuit in the time interval t {0s...120s}, we first define initial conditions for the node voltages at node 1 and node 2 (i.e. the capacitor voltages) and the inductor current and then call NDAESolve with its option InitialSolution. 3.4. VISUALIZE SIMULATION RESULTS The last step of the transient circuit analysis is the graphical display of the simulated results. Analog Insydes provides the function TransientPlot for plotting transient waveforms. Looking at our example, the well-known double scroll attractor associated with Chua s circuit appears when any two of the computed capacitor voltages or inductor currents are used as x and y coordinates in a parametric plot. Here, we plot the node voltage V$1[t versus the inductor current I$L[t in the time interval t {0s...120s}. In[5:= TransientPlot[ ChuaTransient, {V$1[t, I$L[t}, {t, 0., 120.}, Parametric -> True I$L[t In[4:= IC = {V$1 -> 0.15264, V$2 -> -0.02281, I$L -> 0.38127}; ChuaTransient = NDAESolve[ChuaMNA, {t, 0., 120.}, InitialSolution -> IC 2 1-1.5-1 -0.5 0.5 1 1.5 V$1[t -1-2 Out[5= - Graphics -

4. NUMERICAL DAE SOLVER This section describes the strategy NDAESolve employs to integrate a system of differential and algebraic equations. The main idea behind the algorithm is to transform the problem of solving a nonlinear system of differential equations into a sequence of linear and purely algebraic problems which can be solved straightforward. The transformation is carried out in two stages. In the first step, the differential equations are discretized by replacing all time derivatives with a finite difference approximation. The differential equations are thus evaluated and solved at discrete time steps t k only. The finite difference approximation scheme used by NDAESolve is an implicit integration method known as the trapezoidal rule. x(t) x(t ) k+ 1 x(t k ) x (t k) t k x (t k+ 1) t k+1 x(t) Figure 5: Illustration of trapezoidal rule t 4.1. MATHEMATICAL BACKGROUND Let x denote the vector of voltages and currents, x its derivative with respect to time t, and s the vector of input signals. With these definitions, a system of nonlinear dynamic circuit equations can be written in the general implicit form fxt ( ()x, ()s t, () t ) = 0. (1) Discretization yields the following system of equations in the unknowns x(t k+1 ) and x (t k+1 ), fxt ( ( k + 1 ), x ( t k + 1 ), x( t k ), x ( t k ), s( t k )) = 0, (2) where the derivatives x (t k+1 ) are given by the trapezoidal rule x ( t k + 1 ) 2 = -- [ x( t, (3) h k + 1 ) x( t k ) x ( t k ) and where h denotes the integration step size h = t k 1 + t k. (4) Figure 5 shows a graphical illustration of the trapezoidal rule. This concludes the first step. Given x(t k ) the above nonlinear algebraic system of equations can be solved for the voltages and currents x(t k+1 ) at the next time step by the Newton-Raphson iteration scheme, which is the multidimensional equivalent of Newton s method for the single-variable case. = () tk + 1 ( ) ( ) t k + 1 [ Jx ( ) x j + 1 ( ) = j x x In the above equation, J(x) denotes the Jacobian of f and x ( j + 1) = x ( j + 1) x () j the difference of two successive iterates. To compute x(t k+1 ), the Newton-Raphson scheme is repetitively evaluated and solved for x ( j + 1 ) until x ( j + 1) 0. The final value of x(t k+1 ) follows from summing up all x () j, where N denotes the total number of iterations ( ) t k 1 (5) x( t k + 1 ) = x 0 ( + ) + x j ( + ). (6) j = 1 This concludes the second step. As soon as x(t k+1 ) is known, x(t k+2 ) can be determined from x(t k+1 ) by repeating the entire process for the next time step, etc., until the end of the simulation time interval has been reached. 4.2. PROGRAM FLOW () t k + 1 f( x j ( )) () t k 1 Figure 6 shows a flow graph of the algorithm implemented in NDAESolve. The individual steps have already been explained in the preceding section, with the exception of step size control. Circuit equations are usually stiff, which means that their solutions involve both very rapid and very slow transients. To avoid loss of accuracy and convergence problems during rapid transients as well as excessive computation time requirements for slow transients the step size is chosen adaptively at each time step according to the curvature of the waveform. Whenever a waveform changes quickly the step size is cut back whereas it is increased during periods of latency. For the algorithm this means that in case of convergence problems or N

input of circuit netlist set up time-domain circuit equations compute initial transient solution = DC operating point substitute time derivatives at time step t using trapezoidal method solve nonlinear system of equations at time step t using Newton s method iteration i++ time step t+= h no convergence AND i<imax Y N i== imax N Y step size control h /=StepSizeFactor or h *= StepSizeFactor store solution at time step t t<tmax N Y interpolation of data output of solutions as interpolated functions Figure 6: Program flow of DAE solver

numerical overflow the integration step size is decreased by dividing the current step size with the value given by the option StepSizeFactor. On the other hand, the integration step size is increased by multiplying the current step size by StepSizeFactor, if the solution at a time step hardly varies from the solution at the previous time step. The tolerance sensitivity can be controlled via the option MaxDelta specifying the maximum allowed difference between solutions at successive time steps. 5. CONCLUSIONS This paper presented the implementation of analog behavioral models within the Mathematica toolbox Analog Insydes and showed the various modeling capabilities. Furthermore, the implementation of a numerical DAE solver, which is necessary to perform transient circuit analysis, was introduced as most computer algebra systems cannot handle DAE systems. The solver can also be applied to mixed domain simulation purposes because it is not reliant on information about circuit elements at the level of equations, in contrast to PSPICE for example. Additionally, the modular structure of the algorithm allows for implementing alternative integration methods which then can be selected optionally. Future enhancements of the DAE solver include an improved step size control in order to reduce computation time by a better prediction of waveforms for periods of latency. ACKNOWLEDGEMENTS This work has been carried out within the MEDEA project A409 "Systematic Analog Design Environment" (SADE). REFERENCES [1 E. Hennig, T. Halfmann, Analog Insydes Tutorial, ITWM, Kaiserslautern, 1998 [2 H. Khakzar, A. Mayer, R. Oetinger, G. Kampe, R. Friedrich, Entwurf und Simulation von Halbleiterschaltungen mit PSPICE, 3. Auflage, Expert Verlag, 1997