Open access peer-reviewed chapter

Electrical Circuits as Dynamical Systems

Written By

Alexandru G. Gheorghe and Mihai E. Marin

Submitted: 06 June 2022 Reviewed: 09 June 2022 Published: 24 July 2022

DOI: 10.5772/intechopen.105780

From the Edited Volume

Qualitative and Computational Aspects of Dynamical Systems

Edited by Kamal Shah, Bruno Carpentieri and Arshad Ali

Chapter metrics overview

128 Chapter Downloads

View Full Metrics

Abstract

An electrical circuit containing at least one dynamic circuit element (inductor or capacitor) is an example of a dynamic system. The behavior of inductors and capacitors is described using differential equations in terms of voltages and currents. The resulting set of differential equations can be rewritten as state equations in normal form. The eigenvalues of the state matrix can be used to verify the stability of the circuit. The most fitted numerical methods to integrate electrical circuit differential equations are the Euler Method (Forward and Backward), the Trapezoidal Rule, and the Gear Method of second to sixth degree, for circuits having stiff equations. These methods are implemented, with adjustable time-step integration, in the majority of circuit simulation software, such as SPICE. The analytical solution can also be computed, for small-size circuits, applying the Laplace Transform. It is interesting to compare the graphical presentation of numerically and analytically obtained solutions. While the numerical methods can be used for both linear and nonlinear circuits, the Laplace Transform is mostly used for linear circuits. A method of using it for nonlinear circuits is also presented.

Keywords

  • electrical circuits
  • state equations
  • Laplace Transform
  • numerical methods
  • linear and nonlinear circuits

1. Introduction

The existence and uniqueness of a dynamic circuit solution are strongly tied to the existence of the state equation in normal form. If the equation ẋ=fxt exists, then it can be proved, as it can be found in the mathematic literature, that if f is Lipschitzian (for any x1 and x2 and any t, fx1tfx2tkx1x2 where k>0 and is the Euclidian norm) and if the function f0t is uniformly continuous and bounded, then the state equation has an unique solution for any initial state x1=xt. The existence of the normal form of the state equation is related to the existence and uniqueness of the resistive multiport solution for any values of the source parameters (which replace the dynamic elements) connected to the ports, and the existence of nonzero dynamic capacitances and inductances for any values of the control parameters of these elements.

It can be seen as in the case of linear circuits fxt is Lipschitzian: fx1tfx2t=Ax1x2 because there is always a constant k such that Ax1x2kx1x2 [1, 2, 3].

In the case of nonlinear circuits without excess state quantities (the circuit does not contain any loop consisting only of independent or controlled voltage sources and/or capacitors and does not contain any cut-set consisting only of independent or controlled current sources and/or inductors), if the characteristics of the dynamic elements are strictly increasing and derivable, then they have a nonzero dynamic parameter at any point of operation. If the resistors’ characteristics are strictly increasing and the resistive multiport does not have loops formed only from voltage sources and cut-sets formed only from current sources, then this resistive multiport has a unique solution. So, there are state equations in the normal form ẋ=fxt. For the dynamic circuit to have a unique solution for any initial state xt0, it is enough that f is Lipschitzian [1, 2, 3]. When we have excess state quantities, the problem is treated similarly.

Advertisement

2. State equations for dynamic circuits

The simplest dynamic circuit elements are the linear capacitor and the linear inductor. The operating equation of the linear capacitor is ict=Cdvctdt where vct is the voltage at the capacitor terminals, ict is the current through the capacitor, and C is a constant called the capacitor capacity. The operating equation of the linear inductor is vLt=LdiLtdt where vL is the voltage at the inductor terminals, iLt is the current through the inductor, and L is a constant called the inductance of the inductor. The ideal dynamic elements are, unlike resistors, lossless elements, i.e., they do not dissipate energy but accumulate it. The energy accumulated at a given moment by such an element can be subsequently transferred to the circuit in which the respective element is connected.

A circuit that contains at least one dynamic element is called a dynamic circuit. The behavior of dynamic circuits, consisting of independent sources, inductors, capacitors, and resistors, is described by a system of differential equations.

2.1 First-order dynamic circuits

A first-order linear circuit contains only one dynamic element (an inductor or a capacitor), other linear circuit elements (resistors, linear controlled sources), and independent sources. The resistive two poles have an equivalent voltage generator (Thevenin) in Figure 1 [4] and/or an equivalent current generator (Norton) in Figure 2 [5] at the input of the dynamic element. With this consideration in mind, it is sufficient to consider only the next two first-order linear circuits.

Equations of Figure 1’s circuitsEquations of Figure 2’s circuits
Ric+vc=etvLR+iL=ist
ic=CdvcdtvL=LdiLdt
RCdvcdt+vc=etLRdiLdt+iL=ist
ducdt+vcRC=etRCdiLdt+RLiL=RList
If we note:
vc=xiL=x
dvcdt=ẋdiLdt=ẋ
RC=τLR=τ
et=stist=st
then
ẋ+xτ=stτẋ+xτ=stτ

Figure 1.

A Thevenin first-order circuit.

Figure 2.

A Norton first-order circuit.

So, a first-order linear circuit satisfies the equation:

ẋ+xτ=stτE1

where x is the state variable of the circuit, τ is the time constant of the circuit, and st is the parameter of the equivalent independent source.

2.2 Dynamic circuits of second order or greater

The aim is to write the state equations of state in normal form ẋ=fxt. Bringing the equations to this form has two advantages, the qualitative properties of the circuit can be studied more easily, and certain numerical methods for circuit analysis can be applied, formulated to solve a system of differential equations written in this form.

There are two cases. In the first case, the circuit does not contain any loop consisting only of independent or controlled voltage sources and/or capacitors and does not contain any cut-set consisting only of independent or controlled current sources and/or inductors. In this case, the state variables are independent of each other, and we say that the circuit has no excess state quantities. In the second case, the circuit does not satisfy the above restrictions, the state variables are not independent of each other, and we say that the circuit has excess state quantities.

2.2.1 Circuits without excess state quantities

Any linear dynamic circuit without excess state quantities can be considered as a linear resistive multiport (containing linear resistors and independent sources) with dynamic elements connected at the ports. The dynamic circuit of order n>2 that contains p capacitors and np inductors can be represented as follows, in Figure 3.

Figure 3.

A p capacitors and np inductors dynamic circuit.

Capacitors are replaced with independent voltage sources and inductors with independent current sources, as in Figure 4. If the following notations are made:

Figure 4.

Capacitors/inductors replaced with independent voltage/current sources.

x=v1vpip+1int—vector of state variables,

y=i1,,ip,vp+1,,vnt—the vector of the output quantities and

u=e1,,eα,iα+1,,iμt—the vector of the input quantities (independent sources), according to the superposition theorem [6], the circuit equations become y=k0x+k1u, where k0 and k1 are matrices with constant elements.

Using the notation: Δ=diagC1,,Cp,Lp+1,Ln we obtain ẋ=Δ1y and y=Δẋ and the state equations are ẋ=Δ1k0x+k1u or:

ẋ=Ax+BuE2

where A is called the circuit state matrix.

As an example, for the circuit without excess state quantities in the Figure 5 [3, 7], the following state equations are obtained.

Figure 5.

Circuit without excess state quantities.

2.2.2 Circuits with excess state quantities

In this case, there is at least one loop consisting only of capacitors and voltage sources or a cut-set consisting only of inductors and current sources. This means that there will be at least one capacitor that cannot be placed in the tree or an inductor that cannot be placed in the co-tree. The normal tree therefore contains all voltage sources and as many capacitors as possible whose voltages are independent state quantities. The other capacitors will be contained in the normal co-tree, and their voltages are excess state quantities. The normal co-tree contains all current sources and as many inductors as possible whose currents are independent state quantities. The other inductors are contained in the normal tree and their currents are excess state quantities. We consider the circuit as a resistive multiport with dynamic elements connected to the ports. According to the substitution theorem, the capacitors and inductors in the tree are replaced with voltage sources and the capacitors and inductors in the co-tree with current sources. The result is the circuit in Figure 6, in which for simplicity, only one source was represented for each category of element (tree capacitors, tree inductors, co-tree inductors, co-tree capacitors). The second size index represents tree (t) or co-tree (c).

Using the notation:x=vCt,iLct,x=vCc,iLtt,y=iCt,uLct,y=iCc,vLtt.

Figure 6.

The capacitors and inductors in the tree replaced with voltage sources, and the capacitors and inductors in the co-tree with current sources.

The resistive circuit being linear, according to the superposition theorem we obtain:

y=k0x+k1μS+k2yE3

where k0, k1, and k2 are matrices with constant parameters. The operating equations of the dynamic elements can be written:

y=ΔẋwhereΔ=diagCt,Lc,
y=ΔẋwhereΔ=diagCc,Lt.

The excess state quantities can be expressed, with the help of the Kirchhoff's laws, depending on the independent state quantities and the parameters of some independent sources: x=k3x+k4μS and we obtain:

y=Δk3ẋΔk4μ̇SE4

But:

ẋ=Δ1y=Δ1k0x+k1μSk2Δk3ẋ+Δk4μ̇SE5

so, the last relationship can be written as:

ẋ=Ax+BμS+Bμ̇SE6

where A is the state matrix of the circuit.

As an example, for the circuit with excess state quantities (capacitor loop and inductor cut-set circuit) and without sources for simplicity, in Figure 7 [8, 9], the state equations are obtained:

Figure 7.

Circuit with excess state quantities.

2.3 Dynamic circuits with resistive nonlinearities

The methods presented above for writing state equations can also be used and in the case of dynamic circuits with resistive nonlinearities, with only a few changes. A first approach is to approximate the nonlinear characteristic of the resistor with piece-wise linear characteristic. The state equations for the nonlinear circuit can be written separately for each linear portion of the piece-wise linear characteristic. For example, for the rectifier with a diode and the RC load in Figure 8, we have two states. One in which the diode conducts and is equivalent to a very low value resistor, ideal 0Ω as in Figure 9 (state 1) and the other in which the diode does not conduct and is equivalent to a very high value resistor, ideal Ω as in Figure 10 (state 2).

Figure 8.

A diode rectifier with RC load.

Figure 9.

Diode conducts (state 1).

Figure 10.

Diode does not conduct (state 2).

From the equations obtained separately for the two states, the following state equation can be written:

dvctdt=1DRE·C1R·C·vct1DRE·C·etE7

Where et=5sin2πft+t0V and f=10kHz.

When D=0 the equation for state 1 is obtained, and when D=1 the equation for state 2 is obtained. D acts as a closed-open switch over a well-defined time interval depending on the state of the diode. If the rectifier diode conducts, D acts as an open switch, and if the diode does not conduct, D acts as a closed switch [10].

Another approach to writing the state equations for dynamic circuits with resistive nonlinearities is to replace in the state equations the nonlinear resistance with the function that describes the nonlinearity (Figure 11). In the example of a rectifier with a diode and RC load, the diode can be modeled as a nonlinear piece-wise linear function: RD=0.1Ω if the voltage at its terminals is positive v>0, and RD=10MΩ if the voltage at its terminals is negative v<0, Figure 12.

Figure 11.

A rectifier with RC load; diode replaced with a nonlinear resistance.

Figure 12.

The nonlinear resistance function.

The following state equation is obtained:

dvctdt=RD+RE+RRD+RE·R·C·vct+1RD+RE·C·etE8

As the handling of functions is more difficult than that of symbols, the second approach is suitable for small circuits and the first for larger circuits.

Advertisement

3. Qualitative behavior of dynamic circuits

3.1 First-order dynamic circuits

In the previous chapter, it has been shown that a linear circuit of the first order satisfies the equation:

ẋ+xτ=stτE9

where x is the state variable of the circuit, τ is the time constant of the circuit, and st is the parameter of the equivalent independent source.

The solution of a first-order linear circuit with independent direct current sources consists of two terms: the solution of the homogeneous equation xv and a particular solution xp:

x=xv+xpE10

The homogeneous equation is ẋν+xντ=0. This can be solved using the separation of variables method:

ẋν=xντ
dxvdt=xντ
dxvxν=dtτ
x0xvdxvxν=t0tdtτ
lnxvlnx0=tt0τ
lnxv=C1tt0τ
xv=eC1ett0τ=C2ett0τ

The particular solution is a constant, in the form of free term xp=C3,so:

xt=C2ett0τ+C3

The constant C3 is calculated by replacing t=t:

xt=C2e+C3=0+C3soC3=xt

The solution is determined only if the initial condition is known xt0. Replacing t=t0 we obtain:

xt0=C2e0+xt=C2+xtsoC2=xt0xtand results:
xt=xt0xt·ett0τ+xtE11

We distinguish two cases in which the behavior of the solution is different: τ>0 and τ<0. If τ<0, when t, xt decreases exponentially over time and the solution tends to equilibrium (Figure 13). If τ<0, when t, xt increases exponentially over time and the solution tends to an infinite value (Figure 14).

Figure 13.

The solution decreases exponentially.

Figure 14.

The solution increases exponentially.

3.2 Dynamic circuits of second order or greater

The qualitative behavior of the circuit is determined by the eigenvalues of the state matrix A. These can be calculated as roots of the equation:

detAλI=0E12

where I is the unit matrix of the same order as the state matrix A.

First case: The state matrix A has real and distinct eigenvalues. There are three possibilities:

  1. the state matrix A has negative eigenvalues. In this case the solution moves towards the steady state when t (Figure 15a).

  2. the state matrix A has null eigenvalues. In this case the solution is a constant, the steady state, when t as well as when t (Figure 15b).

  3. the state matrix A has positive eigenvalues. In this case the solution moves towards the steady state when t (Figure 15c).

Figure 15.

Circuit response for real and distinct eigenvalues (a) stable response; (b) constant response; and (c) unstable response.

Second case: The state matrix A has complex conjugated eigenvalues. In this case, there are also three possibilities:

  1. state matrix A has eigenvalues with a negative real part. In this case, the solution contains damped harmonic components that move toward the steady state when t (Figure 16a).

  2. The state matrix A has eigenvalues with null real part. In this case, the solution contains undamped harmonic components when t as well as when t (Figure 16b).

  3. The state matrix A has eigenvalues with a positive real. In this case, the solution contains damped harmonic components that go toward the steady state when t (Figure 16c).

Figure 16.

Circuit response for complex conjugated eigenvalues (a) stable response; (b) constant response; and (c) unstable response.

It can be observed that circuits that have the state matrix A with negative real or complex conjugated eigenvalues with the negative real part are stable. If at least one real eigenvalue is positive or a pair of complex conjugated eigenvalues has a positive real part, they are unstable.

For example, for the circuit in paragraph 2.2.1 (Figure 5), by replacing the numerical values for the circuit elements in the state matrix, the following eigenvalues are obtained:

detAλI=det1λ01050λ1010410741074106λ=0

So:

λ34106λ241017λ41017=0λ1=1λ2=2106+6.3246108iλ3=21066.3246108i

It is observed that all eigenvalues have a negative real part, so the circuit is stable.

Advertisement

4. Analytical solving of dynamic circuits equations

With the help of the Laplace transform, it is possible to construct a system of algebraic equations in the complex variable s domain, which corresponds to a system of linear differential equations in the time domain. The use of algebraic equations instead of differential equations shows evident benefits in the study of electrical circuits.

Although section 2 shows how to write state equations in normal form ẋ=fxt, this method is cumbersome for a human operator even for circuits with a small number of dynamic elements. For this reason, in the analysis of electrical circuits, it is preferred to apply the Laplace transform first to the equations that describe the operation of the circuit elements and then to write the circuit equations.

4.1 Circuit analysis with Laplace transform

The study of the time-varying regime can be performed if the initial conditions (ik0 inductor currents and vk0 capacitor voltages) at t=0 are known. It is considered that the independent sources are connected in the circuit at t=0. In this case, all voltages and all currents are original functions. For example, a direct current source (voltage or current) having E=ct or IS=ct, being connected at t=0 has et=Eut or iSt=ISut. Thus, the quantities et and iSt become original functions due to the presence of the factor ut. For such a circuit there are Laplace images of voltages and currents: Iks=Likt and Vks=Lvkt. Laplace image computation is called operational computation. Applying the linearity property of the Laplace transform, Kirchhoff's Laws Nikt=0 and Bvkt=0 can be written in the complex variable s domain: NIks=0 and BVks=0.

According to the linearity and derivation properties of the original function of the Laplace transform, the differential equations that express the connections between vkt and ikt for the circuit elements, correspond to algebraic equations that express the connections between Vks=Lvkt and Iks=Likt [11].

4.2 Equivalent operational circuits

A circuit in which currents and voltages are Laplace images is called the equivalent operational circuit. Below are the most common circuit elements and their Laplace images [11].

  1. The ideal direct current voltage (or current) source

  2. The ideal alternating current voltage (or current) source

  3. The resistor

    The ideal resistor has the operation equation vt=R·it and if Vs=Lvt, Is=Lit then Vs=R·Is. The factor multiplied with Is to get Vs is called the operational impedance Zs=VsIs. For the ideal resistor ZRs=R. The circuit corresponding to this relationship is shown below:

  4. The inductor

    For the ideal inductor, according to the derivation property of the original function, the equation vt=L·ditdt transforms to:

    Vs=L·s·Isi0=s·L·IsL·i0E13

    where i0 is the initial condition at the time t=0 for the current through the inductor. The equivalent operational circuit is:

  5. The capacitor

    Similar to the inductor, according to the derivation property of the original function, for the ideal capacitor, the relationship it=C·dvtdt transforms to:

    Is=C·s·Vsv0=Vs1s·CC·v0E14

    where v0 is the initial condition at the t=0 for the voltage drop on the capacitor. The equivalent operational circuit is:

4.3 Response computation of linear dynamic circuits

All theorems and analysis methods valid for direct or alternating current circuits are valid for the equivalent operational circuits: equivalent generator theorems, superposition theorem, the two-port representation theorems, Kirchhoff’s laws analysis, nodal analysis, mesh analysis, etc.

The Laplace transform analysis algorithm of a linear circuit in time-varying regime consists of:

  1. determine the initial conditions for the inductors and capacitors in the circuit, iL0 and vC0;

  2. build the circuit with operational sources and operational impedances using the operational equivalent circuits;

  3. write the equations and solve for the unknowns VKs and IKs;

  4. determine the analytical solution, the original functions vkt and ikt as the inverse Laplace transform (using Heaviside's theorems).

If the circuit has more than four dynamic elements, determining the circuit response using analytical methods requires substantial effort for a human operator. In this case, a software product such as Mathematica [12] or Maple [13] capable of performing symbolic computations can be used.

To illustrate the above algorithm, consider the following example, the circuit in Figure 17 [14]. The current through the inductor iLt and the voltage at the terminals of the capacitor vCt in the transient mode that occurs after the switch K is closed at the time t=0 in the circuit in the figure below are required. We know R=1Ω, C=1/3F, L=3/2H, E=6V, iL0=3A and vC0=3V.

Figure 17.

Dynamic linear circuit in transient mode.

Using the equivalent operational circuits (Figure 18), we obtain:

Figure 18.

The equivalent operational circuit.

To make it easier to calculate the transient solution, we breakdown the expression into simple fractions:

ILs=6s+4s+1+1s+2andVCs=6s+6s+1+3s+2

So:

iLt=L1ILs=64·et+e2·tA

and

vCt=L1VCs=66·et+3·e2·tV

4.4 Response computation of the dynamic circuits with resistive nonlinearities

Solving systems of differential equations by a human operator is difficult even in the case of linear circuits and even more so in the case of nonlinear ones. To solve them, it is preferred to use programs capable of performing symbolic computations, such as Mathematica, Maple, etc. To solve the circuit state equation obtained by the second approach in paragraph 2.2:

dvctdt=RD+RE+RRD+RE·R·C·vct+1RD+RE·C·etE15

where: RD=0.1Ωforv>010MΩforv<0, et=5sin2πft+t0V and f=10kHz, it is possible to proceed in this way. The above equation is solved separately for each linear region of the nonlinear characteristic for RD. When RD value changes, the initial condition vct0=vc0 is considered as the value of the voltage vct obtained at the end of the previous interval. These calculations were made in the Maple program for two periods of the source et, with the following solution obtained by concatenating the results (Figure 19):

Figure 19.

The analytical solution (Maple) and the numerical solution (SPICE).

As a verification of this method, we can compare the results with those obtained by using the SPICE program [15], in the same time frame. It is observed that the analytical solution obtained with Maple is almost identical to numerical solution obtained with SPICE.

4.5 Transfer functions

Consider a circuit with constant parameters and a unique solution. We assume that we have only one independent source and initial conditions equal to zero. The transfer function from gate i to gate j is defined as the ratio between the output quantity on side j and the input quantity of side i (Figure 20). The output quantity can be a voltage or a current, and the input quantity can be the electromotive voltage of an independent voltage source or the current of an independent current source.

Figure 20.

Circuit with one input (i) and one output (j).

Generally, a circuit function also called a transfer function is:

Hs=PsQsE16

The roots of Qs are called the poles ofHs, and the roots of Ps are called the zeros ofHs. The dynamic behavior of the network depends upon the location of the poles and zeros on the network function curve [16]. In general, one can graphically deduce the magnitude and phase curve of any network function from the location of its poles and zeros. The poles of Hs are the circuit natural frequencies. Not all natural frequencies are the poles of any function of that circuit because certain common expressions that appear in both Qs and Ps can disappear by simplification.

The poles of the transfer function determine the stability of the circuit, similarly to the eigenvalues of the state matrix presented in paragraph 3. If all the poles have a negative real part, the circuit is stable. If at least one pole has a positive real part, the circuit is unstable.

HSPICE uses the Muller method to calculate the roots of polynomials Ps and Qs. This method approximates the polynomial with a quadratic equation that fits through three points in the vicinity of a root. Successive iterations toward a particular root are obtained by finding the nearest root of a quadratic equation whose curve passes through the last three points [16]. Pole/zero analysis results are based on the circuit's DC operating point, so the operating point solution must be accurate [16].

For the circuit in paragraph 2.2.1, Figure 5, the poles in Table 1 are obtained using the HSPICE program.

PolesRealImaginary
19.99991010
22106+6.3246108
321066.3246108

Table 1.

The poles obtained with HSPICE for the circuit in Figure 5.

It is observed that they are identical with the eigenvalues of the state matrix, calculated in paragraph 3.2.

Advertisement

5. Numerical approach of solving dynamic circuits equations

We aim to solve a system of state equations written in normal form ẋ=fxt. Even for linear circuits whose equations have an analytical solution, the use of numerical methods is preferred because even for a second-order circuit, the analytical calculations are quite complicated to be performed efficiently by a human operator.

Automatic solving of analytical solutions requires considerable computational effort, as computers are designed to operate with numbers rather than symbols. For this purpose, specialized software such as Mathematica or Maple that performs analytical calculations can be used.

5.1 Numerical integration methods used in circuit simulation

Any numerical method starts from the initial condition xt0 and determines successively:

xt0+h,xt0+2h,,E17

where h is the time step.

The simplest numerical integration methods used in circuit simulation programs are [17]:

5.1.1 The forward Euler method (FE)

Expanding xtk+1 in Taylor series in the vicinity of the point tk we obtain:

xtk+1=xtk+dxdttk·tk+1tk1!+d2xdt2tk·tk+1tk22!+E18

Using the notation xtk=xk, neglecting the higher-order terms, and taking into account the fact that dxdt=ẋ=fxt, we obtain:

xk+1=xk+h·ẋkorxk+1=xk+h·fxkE19

where h=tk+1tk (time step).

The graphical interpretation of this method of numerical integration is presented below in Figure 21.

Figure 21.

The forward Euler method (FE) graphical interpretation.

5.1.2 The backward Euler method (BE)

Similarly, expanding xtk in Taylor series in the vicinity of the point tk+1 results:

xtk=xtk+1+dxdttk+1·tktk+11!+d2xdt2tk+1·tktk+122!+E20

With the above notations we obtain:

xk+1=xk+h·ẋk+1orxk+1=xk+h·fxk+1E21

In Figure 22 is presented the graphical interpretation of this numerical integration method.

Figure 22.

The backward Euler method (BE) graphical interpretation.

5.1.3 The trapezoidal rule (TR)

From the graphic interpretation of the two numerical integration methods presented above, it is observed that for the same function, a method approximates the integral with a value smaller and the other with a bigger value. This drawback can be overcome by using the trapezoidal rule.

Adding and dividing by two the two formulas obtained for xk+1, the one obtained with the forward Euler method and the one obtained with the backward Euler method, the formula for the trapezoidal rule is obtained:

xk+1=xk+h·ẋkxk+1=xk+h·ẋk+12·xk+1=2·xk+h·ẋk+ẋk+1EQ5

or

xk+1=xk+h2·ẋk+ẋk+1E22

The graphical interpretation of the trapezoidal rule is presented below, in Figure 23.

Figure 23.

The trapezoidal rule (TR) graphical interpretation.

It is easy to see that the forward Euler method, in which xtk+1 is determined from xtk, is an explicit method, while the backward Euler method and the trapezoidal rule are implicit methods.

The solutions obtained by numerical integration being approximate, the errors introduced at each step are calculated (local error and global error of the method). Local error at the time t=tn+1 is εn=xexacttn+1xapproxtn+1 where xexacttn+1 was calculated starting from the xtn approximate calculation. The total error at t=tn+1 is εn=xexacttn+1xapproxtn+1, where xexacttn+1 was calculated from the initial x0.

The numerical integration method for which the total error decreases as time passes is a stable method. A method that does not have this property is numerically unstable, even if the local error is small and decreases over time.

In a stable method, the size of the time step is limited only by the imposed local error, which depends on the studied problem. Working with very low values of h leads to a large number of time steps required to determine the solution that take up an unjustifiably high computation time.

5.1.4 The gear methods (G)

For circuits with eigenvalues that differ by a few orders of magnitude ("stiff") the numerical methods presented above do not give correct results. In this case, special gear methods are used. The relationships that define the second to sixth-order gear methods are:

Second-order gear: xk+1=34xk13xk1+h23·ẋk+1

Third-order gear: xk+1=1811xk911xk1+211·xk2+h611·ẋk+1

Fourth-order gear 4: xk+1=4825xk3625xk1+1625·xk2325·xk3+h1225·ẋk+1

Fifth-order gear 5: xk+1=300137xk300137xk1+200137·xk275137·xk3+12137·xk4+h60137·ẋk+1

Sixth-order gear 6: xk+1=360147xk450147xk1+400147·xk2225147·xk3+72147·xk410147·xk5+h60137·ẋk+1

In the case of an explicit method, after choosing the time step, we start from the initial condition xt0 and successively compute xt0+h,xt0+2h, covering the entire time interval of interest. In the case of an implicit method, several iterations are made at each step. At the first iteration, an explicit method is used, and a predictor is obtained xk+10=xk+h·fxk. The value obtained for the predictor is entered on the right-hand side of the equation of the backward method obtaining a new value for xk+11 (in the left hand side), which at the next iteration is introduced again on the right-hand side and xk+12 is obtained and so on until xk+1N1xk+1N<ε imposed. Values xk+11,xk+12 are called correctors.

In current SPICE circuit simulation programs, the forward Euler, backward Euler, trapezoidal rule, and gear method of the second order are used. In circuit design, a small simulation time is very important and integration methods of degree greater than 2 are not used because it involves many more computations and the improvement of the solution is not considerable visible.

5.2 Resistive (companion) models for dynamic circuit elements

The numerical methods described in the previous paragraph require writing the state equations in normal form ẋ=fxt. Writing the circuit equations in this form requires the elimination of some variables and the expanding of others starting from the circuit equations. This process involves the numerical solution of some systems of linear or nonlinear algebraic equations, operation that may be affected by significantly errors and involves a certain calculation effort. This process of integrating circuit equations is simplified by replacing the dynamic elements with so-called resistive (or companion) models. By doing so, the circuit response is determined by solving a linear or nonlinear resistive circuit at each time step.

Companion models for a linear capacitor or an inductor derive from the numerical integration method used in the previous paragraph.

Starting from the relations given by the most used numerical integration method and taking into account that the state variable for the capacitor is the voltage (i=C·dvdt or i=C·v̇ so v̇=1C·i), we obtain the models in Table 2 for the capacitor.

BEik+1=Ch·vk+1Ch·vkR=hCIS=Ch·vk
TRik+1=2Ch·vk+12Ch·vk+ikR=h2·CIS=2Ch·vk+ik
2nd Gik+1=3C2h·vk+19C8h·vkC2h·vk1R=2h3CIS=9C8h·vkC2h·vk1

Table 2.

The BE, TR and second G companion models for the capacitor.

These equations are describing the following equivalent circuit, the capacitor companion model.

In a similar manner but considering that the state variable for the inductor is the current (v=L·didt or v=L·i̇ so i̇=1L·v), we obtain the models in Table 3 for the inductor.

BEik+1=hL·vk+1+ikR=LhIS=ik
TRik+1=h2L·vk+1+h2L·vk+ikR=2LhIS=h2L·vk+ik
2nd Gik+1=2h3L·vk+1+34·ik13·ik1R=3L2hIS=34·ik13·ik1

Table 3.

The BE, TR, and second G companion models for the inductor.

These equations are describing the following equivalent circuit, the inductor companion model.

For example, using the companion models starting from the trapezoidal rule, the dynamic circuit in paragraph 2.2.1, Figure 5, becomes a resistive circuit but with different values at each time step for the resistors and sources in the dynamic element models (Figure 24).

Figure 24.

Dynamic elements replaced with companion models for circuit in Figure 5.

The advantage of this approach is that solving a resistive circuit is much easier than a dynamic circuit, for example, using the modified nodal analysis (MNA) method [18]:

1R1+1RL11RL101RL11RL1+1RC11RC101RC11R+1RC1+1RCV2V3V4=V1R1IL1IL1+IC1V1R+ICIC1

This method, using a variable integration time step, is implemented in all SPICE circuit simulators.

Similar to linear dynamic element models, companion models can be built for nonlinear dynamic elements. Next, we will determine the parameters for these models for the nonlinear capacitor and the nonlinear inductor for the trapezoidal rule. Models corresponding to other numerical integration methods can be determined in a similar way.

For a nonlinear capacitor where the electric charge is a polynomial dependence of the voltage, of the form, q=Cv+c1v2+c2v3 the i=dqdt=q̇ the companion model can be obtained from the following.

In this case, the state variable for the capacitor is the electric charge:

qk+1=qk+h2·q̇k+q̇k+1=qk+h2·ik+ik+1
ik+1=2h·qk+12h·qkik
ik+1=2hCvk+1+c1vk+12+c2vk+132hCvk+c1vk2+c2vk3+ikE23

This equation describes the following equivalent circuit, the nonlinear capacitor companion model.

For a nonlinear inductor where the magnetic flux is a polynomial dependency of the current, of the form φ=Li+c1i2+c2i3 and v=dt=φ̇, the companion model can be obtained from the following.

In this case, the inductor state variable is the magnetic flux:

φk+1=φk+h2·φ̇k+φ̇k+1=φk+h2·vk+vk+1
vk+1=2h·φk+12h·φkvk
vk+1=2hLik+1+c1ik+12+c2ik+132h·Lik+c1ik2+c2ik3+vkE24

This equation describes the following equivalent circuit, the nonlinear inductor companion model.

The resistive circuit that is solved at each time step is nonlinear in this case, even if the resistors in the circuit are linear. This circuit is solved by an iterative method, usually the Newton method.

Advertisement

6. Conclusions

All companion models contain a linear resistor with the resistance depending on the parameter of the dynamic element (L or C) and the time step h, and an independent source whose parameter depends on the value of the state variable at the previous time.

Companion models of linear dynamic elements can also be built with voltage sources (the actual current source can be transformed into a voltage source). Current sources were preferred because they are suitable for the modified nodal analysis (MNA) method.

For a given time step h, starting from the given initial state of the dynamic elements, the circuit response is calculated at t0+h using a first-order numerical integration method. In this way, the analysis of a linear dynamic circuit can be done by solving a linear resistive circuit at each time step. Starting from t0+2h, a second-order method can be used (such as the trapezoidal rule or the second-order Gear method). If the time step does not change, only the independent sources change in the resistive circuit, the values of the resistors remain the same. If the time step changes, the model resistance values must be recalculated.

The integration of the circuit equations is usually done with a variable time step h. As h decreases, the resistance in the capacitor companion model decreases and the resistance in the inductor companion model increases. In the case of an LC branch circuit, there are two resistors in parallel whose resistors are different by several orders of magnitude. Such a circuit cannot be solved correctly by using just simple precision. In some cases, even double-precision computations can lead to incorrect results.

References

  1. 1. Chua LO, Desoer CA, Kuh ES. Linear and Nonlinear Circuits. New York: McGrawHill; 1987
  2. 2. Chua LO, Green DN. A qualitative analysis of the behavior of dynamic nonlinear networks: Steady-state solutions of non-autonomous networks. IEEE Transactions on Circuits and Systems. 1976;23(9):531-550
  3. 3. Gheorghe AG, Constantinescu F. New Topics in Simulation and Modeling of RF Circuits. Denmark: River Publishers; 2017. ISBN: 9788793379466, e-ISBN: 9788793379459
  4. 4. Johnson DH. Origins of the equivalent circuit concept: The voltage-source equivalent. Proceedings of the IEEE. 2003;91(4):636-640
  5. 5. Johnson DH. Origins of the equivalent circuit concept: The current-source equivalent. Proceedings of the IEEE. 2003;91(5):817-821
  6. 6. Urbano M. Superposition theorem. In: Introductory Electrical Engineering with Math Explained in Accessible Language. US: John Wiley & Sons, Inc.; 2019. Print ISBN: 9781119580188, Online ISBN: 9781119580164. DOI: 10.1002/9781119580164
  7. 7. Gheorghe AG, Constantinescu F, Nitescu M. “A new algorithm for envelope following analysis”, Revue Roumaine des Sciences Techniques-Serie Electrotechnique et Energetique, Nr.2011;2:229-236.
  8. 8. Cristea PD, Tuduce R. State equations of circuits with excess elements - revisited. Science and Technology. 2011;56:219-228
  9. 9. Marin M-E, Staicu C-S, Gheorghe AG, Constantinescu F. Generation of state equations for circuits with excess elements. In: 2020 International Symposium on Fundamentals of Electrical Engineering (ISFEE). 2020. pp. 1-4
  10. 10. Benny Yeung. Chapter 7 Dynamic Modeling and Control of DC / DC Converters
  11. 11. Gardner MF, Barnes JL. Transients in Linear Systems studied by the Laplace Transform. New York: Wiley; 1942
  12. 12. Wolfram Research, Inc., Mathematica, Version 13.0.0, Champaign, IL. 2021
  13. 13. Maple User Manual. Maplesoft, a division of Waterloo Maple Inc., 1996–2021.
  14. 14. Gheorghe AG. Collection of Theory Problems Circuits. Politehnica Press Publishing; 2014
  15. 15. Nagel LW, Pederson DO. SPICE (Simulation Program with Integrated Circuit Emphasis). Berkeley: University of California; 1973
  16. 16. Star-Hspice Manual. Chapter 24: Performing Pole / Zero Analysis. Fremont, CA: Avant!, Release 1998.2.
  17. 17. Nagel LW. SPICE2: A Computer Program to Simulate Semiconductor Circuits. Berkeley: University of California; 1975
  18. 18. Chung-Wen H, Ruehli A, Brennan P. The modified nodal approach to network analysis. IEEE Transactions on Circuits and Systems. 1975;22(6):504-509. DOI: 10.1109/TCS.1975.1084079

Written By

Alexandru G. Gheorghe and Mihai E. Marin

Submitted: 06 June 2022 Reviewed: 09 June 2022 Published: 24 July 2022