• No results found

Numerical algorithms for the transient analysis of HF non-linear circuits 6.2.2 Elements of numerical methods for solving IVP

The numerical step-by-step methods for the solution o f (6.4) are algorithms

which produce a table o f approximate values to y ( t ) at certain equally spaced points

called grid, nodal, netor mesh points along the tcoordinate. Each grid point is given by

the relationship:

tn+, = t +h, n = 0 , l , 2 , . . . , N - 1

"+/ " , (6.10)

t0= a, tN = b

where his called the step sizeand [a, b] is the intervalon which the required solution is

sought. Sometimes it is useful to write (6.10) in following form:

tn = t0 +nh, n = l , . . . , N . (6.11)

W hen using numerical methods to find the solution o f an IVP, what is involved is

a calculation o f an approximation y„to a solution y ( t ) for t = tn. These approximate

values o f y ( t ) usually contain errors, namely round-off error and/or truncation error.

The round-off errors are caused by the finite computer representation o f a number. The truncation error is caused by the numerical m ethod itself (e.g. taking a finite number of terms in the Taylor series expansion) and has nothing to do with the computer properties.

D E F IN IT IO N 6.1. (Round-off error)

The round-off error is the quantity R that must be added to a finite representation o f a

computed num ber in order to make it equal to the representation o f number that the numerical algorithm would give if the computer had infinite precision, i.e.

y(machine representation) + R = y(representation)

D E F IN IT IO N 6.2. (Truncation error)

The truncation error is the quantity T that m ust be added to the representation o f the

computed quantity in order to make the result exactly equal to the quantity that is sought,

y(representation) + T = y(exact)

Two issues that are very important in relation to the numerical solution o f IVPs

are stability and convergence.

CHAPTER 6 Numerical algorithms for the transient analysis of HF non-linear circuits

D E F IN IT IO N 6.3. (Convergence)

The concept o f convergence refers to the fact that any desired degree o f accuracy can be achieved for any problem satisfying the Lipschitz condition (6.9) by picking a suitably small step size h.

D E F IN IT IO N 6.4. (Stability)

If there exists an ho for each differential equation such that a change in the initial value by a fixed amount produces a bounded change in the numerical solution for all

0 < h < h 0, then the method is deemed stable.

These definitions [J84] are very loosely given - the intention here is to present concepts.

6.2.3. Numerical methods for solving IVP

The numerical methods for finding the solution to the initial value problem are usually classified into two types [J84]:

i. Singlestep Methods - These methods enable an approximation to the true

solution y ( t ) at t„+i to be found, \iy„, y n 'an d h are known.

ii. Multistep Methods - These methods use recurrence relations, which express the

value o f y ( t ) at tn+i in terms o f the values o f y ( t ) and derivative values y ' ( t ) at

tn and at previous nodal points.

In addition, there is a whole range o f existing numerical methods that cannot be classified as either o f the above: Taylor series methods, Hybrid methods, Cyclic composite methods, Rosenbrock methods, etc. A good introduction to these methods can be found in [BOO].

6.2.3.1. Singlestep M ethods

The Taylor Series Expansion about the point t or tn gives the basis for most one- step numerical integration formulas:

where/? = tn+l- t n. Since y ' = f ( t , y ) , y " = / ' ( t , y) , . . . , the equation (6.12) becomes: (6.12)

y (t + h) = y (t) + h f( t ,y ) + tj j f( t , y ) + j j f ' ( t , y) + ... (6.13)

CHAPTER 6 Numerical algorithms for the transient analysis of HF non-linear circuits

Letting t —> tn and considering that, (6.13) can be written in discrete notation as:

yn+i = yn+hf(tn>y„)+^jjf(tn>yn) +jjf'O n>yn) +-

(6-i4)

where y t = y ( t ) , 1=0,1,... Therefore, a general singlestep method can be written in the form:

y n+i = y n +h<i>(tn>yn>h),n = 0 , l , . . . , N - l , (6.15) where <f> is function o f the arguments t, y, h and, in addition, depends on the right-hand side o f (6.4). The function <f>(t,y,h) is called an increment function. I f y„+i can be obtained simply by evaluating the right-hand side o f (6.4), then the singlestep method is termed explicit otherwise it is termed implicit. The most common singlestep methods are the E uler’s method and the Runge-Kutta family o f methods.

Truncation o f the series expansion in (6.14) introduces a truncation error. The exact value y(t) will satisfy:

y (tn+]) = y (tn) + h<l>(tn,y n,h) + Tn, n = 0 ,1 ,...,N - 1 , (6.16)

where Tn is the truncation error. The largest integer p such that h 1 Tn = 0 ( h p) is

called the order o f the singlestep method.

Forw ard an d Backw ard E u ler M ethod

The simplest singlestep method is the Forward Euler (FE) method. It truncates the Taylor series after the 1st order term, giving

y n+i = y n + hf(tn,y „ ). (6.17) The E uler’s m ethod is a 1st order explicit method whose truncation error per step is o f

the order 0(h2).

The implicit version o f Eulers’ method is known as the Backward Euler (BE)

method. It is derived in the same manner as the FE method, except that everything is

centred around tn+i rather than tn, yielding following implicit formula:

yn+, =y„+ ¥(t„+i - yn+i)

(6-18)

Geometrically, instead o f using the tangent at (tn, y n), as in Forward Euler method, the Backward Euler m ethod uses the tangent at the future point (tn+i, y„+i), thus enhancing the stability o f method which proves to be very useful when dealing with so called s tiff problems characteristic o f electronic circuit models. But, o f course, there is a price to be paid for enhanced stability: while the FE method is explicit, the BE method is implicit. It means that the unknown variable y n+j at each step appears on both sides o f equation

(6.18) which is generally a non-linear expression. Consequently, a non-linear system o f algebraic equations has to be (approximately) solved at each step, which can be computationally prohibitive for large systems.

Trapezoidal Method

The derivation o f the Euler methods is based on a Taylor expansion centred at t„ for the Forward Euler, and at tn+j for the Backward Euler. The next logical step is to attempt to form an expansion in the middle o f the interval \tn, t„+i], i.e. around

t (6.19)

"+3 2

A fter some mathematical calculations, the following formula is obtained:

y(t,M ) - y ( t . ) _ ; +y l ( ) } _!L y> ”(t ) + o ( h ‘ ) . (6.2 0)

h 2 12

Disregarding the parts with higher derivatives gives the following formula for the

trapezoidal (TR) method:

yn+i = yn +^(f(t„+i>yn+,)+f(h - yn))

(

6

.

21

)

This method is more accurate (second-order accurate) than E uler’s and it is implicit (like Backward Euler).

Runge-Kutta Methods

One important group o f singlestep methods are the Runge-Kutta (RK) methods. These methods refer to a whole range o f methods that use a truncated Taylor series expansion without requiring the calculation o f the higher derivatives. Consider the M ean-Value Theorem which states that any solution o f (6.4) satisfies:

y i u ) = y( 0 + h y \ O = y( 0 + h f ( i n, y (0 ) , (6.22)

where = t„+0nh, O<0„<1. Setting 0n =1/2 and using o f Euler’s method with spacing

h/2, yields:

yVn+^yn+^fitniyJ-

(6.23)

Thus, the following approximation is obtained:

y

n+1

=y„+hf(t„ +^,y„+^f(t„>yn))

(6.24)

Alternatively, and again using E uler’s method, it is possible to write following:

CHAPTER 6________________ Numerical algorithms for the transient analysis of HF non-linear circuits