7.1 Introduction

We have seen in Chapter 1 that Euler or rectangular integration is the simplest numerical integration algorithm. Because of its simplicity it requires fewer digital instructions to implement and therefore runs faster than any other integration method for a given step size. The big drawback to conventional Euler integration is its poor accuracy. This is because the global truncation errors vary only as the first power of the integration step size.

 

In this chapter we describe several versions of a modified Euler algorithm which in general requires no more mathematical operations than conventional Euler integration but which exhibits global truncation errors proportional to the square of the integration step size. To introduce the basic algorithm we consider the following two state equations for a velocity vector V and a displacement vector D:

(7.1)      C:\Users\portman\Documents\Chapter 7_files\image001.jpg

Here the acceleration vector A is a nonlinear function of D, V, and the input vector (t). To apply the modified Euler method we represent the velocity vector at half-integer frame times, and the displacement and acceleration vectors at integer frame times. Then the modified Euler difference equations become

 

(7.2)    C:\Users\portman\Documents\Chapter 7_files\image002.jpg

 

where

(7.3)      C:\Users\portman\Documents\Chapter 7_files\image003.jpg

 

Here h is the integration step size and C:\Users\portman\Documents\Chapter 7_files\image004.gif represents an estimate of V at the nth frame, since we are only computing V at half-integer frame times. Any of the extrapolation formulas considered in Chapter 4 can be used to compute C:\Users\portman\Documents\Chapter 7_files\image004.gif.  It is evident from Eq. (7.2) that modified Euler integration, as we define it here, is the same as conventional Euler integration, except that the state-variable derivative is defined halfway through the frame instead of at the beginning of the frame. In this regard modified Euler integration is the same algorithm used in the second pass of the real-time RK-2 method in Eqs. (1.27) and (1.28), and the second pass of the RTAM-2 method in Eqs. (1.29) and (1.30).

 

By taking the transform of either difference equation in (7.2) using a step size of h/2, we can derive the following formula for the integrator transform, C:\Users\portman\Documents\Chapter 7_files\image005.gif,  for modified Euler integration:

(7.4)      C:\Users\portman\Documents\Chapter 7_files\image006.jpg

 

The transfer function for sinusoidal inputs,  C:\Users\portman\Documents\Chapter 7_files\image007.gif , is given by

(7.5)      C:\Users\portman\Documents\Chapter 7_files\image008.jpg

 

7-1

 

Comparison of Eq. (7.5) with the standard form of the approximate integrator transfer function  C:\Users\portman\Documents\Chapter 7_files\image005.gif , as first introduced in Eq. (3.37) shows that the integrator error coefficient C:\Users\portman\Documents\Chapter 7_files\image009.gif . This makes the accuracy of modified Euler integration equal to or better than that of any other second-order method, as can be seen by referring to Table 3.1 in Section 3.12. Of course, to realize this accuracy the derivative input halfway through the integration frame must be accurate to order h3. This should be taken into account in the choice of estimation formula when the derivative halfway through the frame is not directly available.

7.2 Application to a Second-order Linear System

As a first example we consider the application of the modified Euler method to a second-order linear system described by the state equation

(7.6)      C:\Users\portman\Documents\Chapter 7_files\image010.jpg

Here X is the output, U(t) is the input,  C:\Users\portman\Documents\Chapter 7_files\image011.gif  is the undamped natural frequency, and  C:\Users\portman\Documents\Chapter 7_files\image012.gif  is the damping ratio. By analogy with Eqs. (7.2) and (7.3) the modified Euler difference equations for the kth integration frame take the following form:

(7.7)      C:\Users\portman\Documents\Chapter 7_files\image013.jpg

(7.8)      C:\Users\portman\Documents\Chapter 7_files\image014.jpg

Note that Eq. (7.7) must be executed first, since the result,  C:\Users\portman\Documents\Chapter 7_files\image015.gif  is used in Eq. (7.8). Note also that the estimate for Y at the integer frame k, namely  C:\Users\portman\Documents\Chapter 7_files\image016.gif , must be computed. Table 7.1 lists some candidate formulas for this estimate.

 

Table 7.1

Some Methods for estimating the state C:\Users\portman\Documents\Chapter 7_files\image017.gif in Modified Euler Integration

C:\Users\portman\Documents\Chapter 7_files\image018.jpg

The first formula in Table 7.1 simply replaces  C:\Users\portman\Documents\Chapter 7_files\image019.gif  with  C:\Users\portman\Documents\Chapter 7_files\image020.gif , the state value at the previous frame time, h(k -1/2). The modified Euler formula for integrating the term  C:\Users\portman\Documents\Chapter 7_files\image021.gif  in Eq. (7.6) is then equivalent to conventional Euler integration and is so indicated in the table. The global truncation error associated with this portion of the integration will be proportional to  C:\Users\portman\Documents\Chapter 7_files\image022.gif . In the frequency domain this corresponds to an integrator phase shift of  C:\Users\portman\Documents\Chapter 7_files\image023.gifas we have seen in Chapter 3. The remaining terms on the right side of Eq. (7.7) will of course be integrated with the full accuracy of the modified Euler method, i.e., integrator gain errors given approximately by  C:\Users\portman\Documents\Chapter 7_files\image024.gif . Later we will analyze the effect on the overall simulation accuracy of using Euler integration for the  C:\Users\portman\Documents\Chapter 7_files\image021.gif  term.

 

The second formula in Table 7.1 uses linear extrapolation based on  C:\Users\portman\Documents\Chapter 7_files\image025.gif  and  C:\Users\portman\Documents\Chapter 7_files\image026.gif  to compute the estimate  C:\Users\portman\Documents\Chapter 7_files\image019.gif .  It is easy to see that this is equivalent to using the AB-2 method to integrate the term  C:\Users\portman\Documents\Chapter 7_files\image021.gif  on the right side of Eq. (7.7). This leads to an integrator gain error of  C:\Users\portman\Documents\Chapter 7_files\image027.gif ,  again based on our results in Chapter 3. Although this error is proportional to h2, it is still 10 times larger than the gain error associated with the modified Euler method, which will therefore degrade somewhat the accuracy of the overall simulation.

 

The third formula in Table 7.1 uses the average of  C:\Users\portman\Documents\Chapter 7_files\image015.gif  and  C:\Users\portman\Documents\Chapter 7_files\image020.gif  to compute the estimate  C:\Users\portman\Documents\Chapter 7_files\image019.gif . This is equivalent to trapezoidal integration and leads to an approximate gain error of  C:\Users\portman\Documents\Chapter 7_files\image028.gif  in integrating the term  C:\Users\portman\Documents\Chapter 7_files\image021.gif on the right side of Eq. (7.7). In this case  C:\Users\portman\Documents\Chapter 7_files\image015.gif  appears on both sides of Eq. (7.7), which then becomes an implicit equation. However, in our example here the equation is linear and we can easily solve it to produce an explicit formula for  C:\Users\portman\Documents\Chapter 7_files\image015.gif . If the right side of Eq. (7.7) involves a nonlinear function of Y, it may still be possible to generate an approximate explicit formula for  C:\Users\portman\Documents\Chapter 7_files\image015.gif  through a linearization procedure, as we shall see in a later example in this chapter.

 

The final formula in Table 7.1 is based on a predictor integration method using  C:\Users\portman\Documents\Chapter 7_files\image029.gif  and  C:\Users\portman\Documents\Chapter 7_files\image030.gif . The error associated with the calculation of the estimate  C:\Users\portman\Documents\Chapter 7_files\image019.gif  is then the local truncation error associated with the integration formula. This error will be proportional to h3, which means that  C:\Users\portman\Documents\Chapter 7_files\image019.gif  will be equal to  C:\Users\portman\Documents\Chapter 7_files\image031.gif  to order h2.  In this case the asymptotic errors associated with the integration of the term  C:\Users\portman\Documents\Chapter 7_files\image021.gif  in Eq. (7.7) will be the same as those for ideal modified Euler integration, and the best overall simulation accuracy will in general be obtained.

 

In the sections that follow we will analyze the accuracy of the modified Euler simulation of the second-order system described by Eq. (7.6) by considering transfer function errors and characteristic root errors. This in turn will lead us to general results for the modified Euler method. We will also consider the stability region in the  C:\Users\portman\Documents\Chapter 7_files\image032.gif  plane when using the various formulas in Table 7.1 for estimating  C:\Users\portman\Documents\Chapter 7_files\image019.gif .

 

7.3 Accuracy Analysis Using Integrator Transfer Function Models

When any of the first three formulas in Table 7.1 are used to compute  C:\Users\portman\Documents\Chapter 7_files\image019.gif  in Eq. (7.7), the resulting simulation will involve two different integration methods, namely, modified Euler and a second method, as listed in the third column in the table. We have already seen in Eq. (3.37) of Chapter 3 that the transfer function of single-pass (or equivalent single-pass) integrators can be written approximately as

(7.9)      C:\Users\portman\Documents\Chapter 7_files\image033.jpg

 

Using Eq. (7.9) to model each integration in the numerical simulation, we can determine the approximate frequency-domain representation of the simulation itself, from which the transfer function errors can be determined. Letting  C:\Users\portman\Documents\Chapter 7_files\image034.gif  for modified Euler integration and  C:\Users\portman\Documents\Chapter 7_files\image035.gif  for the method used to integrate the term  C:\Users\portman\Documents\Chapter 7_files\image021.gif  we can rewrite Eq. (7.6) in the frequency domain as

(7.10)    C:\Users\portman\Documents\Chapter 7_files\image036.jpg

 

and

(7.11)    C:\Users\portman\Documents\Chapter 7_files\image037.jpg

 

Here the order of the modified Euler method is 2 and the order of the alternative method is k. By eliminating  C:\Users\portman\Documents\Chapter 7_files\image038.gif  from Eqs. (7.10) and (7.11), we can solve for the digital system transfer function,  C:\Users\portman\Documents\Chapter 7_files\image039.gif .  In this way we obtain

C:\Users\portman\Documents\Chapter 7_files\image040.jpg

(7.12)

 

For  C:\Users\portman\Documents\Chapter 7_files\image041.gif  Eq. (7.12) reduces to the formula for the ideal second-order system transfer function. Thus

(7.13)    C:\Users\portman\Documents\Chapter 7_files\image042.jpg

 

The transfer function H(s) of the continuous system is obtained by simply replacing  C:\Users\portman\Documents\Chapter 7_files\image043.gif  with s. The poles of H(s) are the characteristic roots  C:\Users\portman\Documents\Chapter 7_files\image044.gif  of the continuous system. For the ideal second-order linear system these are the roots of the characteristic equation  C:\Users\portman\Documents\Chapter 7_files\image045.gif  and are given by

(7.14)    C:\Users\portman\Documents\Chapter 7_files\image046.jpg

 

In the same way, to obtain the approximate formulas for the characteristic roots  C:\Users\portman\Documents\Chapter 7_files\image047.gif  of the digital system we replace  C:\Users\portman\Documents\Chapter 7_files\image043.gif  with  C:\Users\portman\Documents\Chapter 7_files\image047.gif  in Eq. (7.12) and set the denominator equal to zero. Thus the characteristic equation becomes

(7.15)    C:\Users\portman\Documents\Chapter 7_files\image048.jpg

 

Multiplying by  C:\Users\portman\Documents\Chapter 7_files\image049.gif  and neglecting terms in e2we can rewrite Eq. (7.15) as

(7.16)    C:\Users\portman\Documents\Chapter 7_files\image050.jpg

 

For the case where  C:\Users\portman\Documents\Chapter 7_files\image019.gif  in Eq. (7.7) is estimated by any of the bottom three methods in Table 7.1, the order of the effective method used to integrate the term  C:\Users\portman\Documents\Chapter 7_files\image021.gif  in Eq. (7.6) is given by k = 2. Under these conditions the digital system roots  C:\Users\portman\Documents\Chapter 7_files\image047.gif  will be equal to the continuous-system roots  C:\Users\portman\Documents\Chapter 7_files\image044.gif  to order h2. It follows that  C:\Users\portman\Documents\Chapter 7_files\image051.gif  or  C:\Users\portman\Documents\Chapter 7_files\image052.gif  to order h2.  Making this substitution for  C:\Users\portman\Documents\Chapter 7_files\image053.gif  in the integrator error terms in Eq. (7.16), we obtain the following equation, which is accurate to order h2:

(7.17)    C:\Users\portman\Documents\Chapter 7_files\image054.jpg

 

Multiplication by  C:\Users\portman\Documents\Chapter 7_files\image055.gif  results in the following equation for the characteristic roots, which again is accurate to order h2:             C:\Users\portman\Documents\Chapter 7_files\image056.jpg

(7.18)

 

From the definition of the undamped natural frequency  C:\Users\portman\Documents\Chapter 7_files\image057.gif  and damping ratio  C:\Users\portman\Documents\Chapter 7_files\image058.gif  of the digital system, the characteristic equation for the digital roots  C:\Users\portman\Documents\Chapter 7_files\image047.gif  is given by

(7.19)    C:\Users\portman\Documents\Chapter 7_files\image059.jpg

Comparison of Eqs. (7.18) and (7.19) shows that  C:\Users\portman\Documents\Chapter 7_files\image060.gif  from which we can solve for  C:\Users\portman\Documents\Chapter 7_files\image061.gif  the fractional error in undamped natural frequency. Thus to order h2

(7.20)    C:\Users\portman\Documents\Chapter 7_files\image062.jpg

 

Equating the middle terms on the left side of Eqs. (7.18) and (7.19) and using Eq. (7.20) for  C:\Users\portman\Documents\Chapter 7_files\image057.gif , we obtain the following formula for the damping ratio error  C:\Users\portman\Documents\Chapter 7_files\image063.gif  to order h2:

(7.21)    C:\Users\portman\Documents\Chapter 7_files\image064.jpg

The fractional error in damped frequency, C:\Users\portman\Documents\Chapter 7_files\image065.gif is given by

C:\Users\portman\Documents\Chapter 7_files\image066.jpg

(7.22)

 

As noted earlier, Eqs. (7.20), (7.21) and (7.22) represent approximate formulas for the undamped natural frequency, damping ratio, and damped frequency errors when simulating a second-order linear system with modified Euler integration (error coefficient  C:\Users\portman\Documents\Chapter 7_files\image067.gif ) , but with a different second-order integration method (error coefficient  C:\Users\portman\Documents\Chapter 7_files\image068.giffor the damping term. For the case where we use the conventional Euler method to integrate the  C:\Users\portman\Documents\Chapter 7_files\image069.gif  term in Eq. (7.6), i.e., the first method in Table 7.1,  C:\Users\portman\Documents\Chapter 7_files\image070.gif  and k = 1. To first order in Eq. (7.15) can then be written as

C:\Users\portman\Documents\Chapter 7_files\image071.jpg

(7.23)

 

Comparison with Eq. (7.19) yields the following approximate error formulas when conventional Euler integration  C:\Users\portman\Documents\Chapter 7_files\image072.gif  is used for the damping term:

(7.24)    C:\Users\portman\Documents\Chapter 7_files\image073.jpg

 

Here all three error formulas depend on the first power of the step size h. However, as the damping ratio  C:\Users\portman\Documents\Chapter 7_files\image012.gif  approaches zero, the first-order errors vanish and the errors become second-order in h. In fact, it can be shown that when  C:\Users\portman\Documents\Chapter 7_files\image074.gif , the modified Euler simulation of the second-order system represented by Eq. (7.6) exhibits exactly zero damping, regardless of the step size h. This suggests that the method may be particularly effective in simulating lightly-damped systems.

 

For each of the damping-term estimation formulas given in Table 7.1, Table 7.2 lists the asymptotic formulas for the characteristic-root frequency and damping errors. The formulas are based on Eqs. (7.20), (7.21), (7.22) and (7.24) with  C:\Users\portman\Documents\Chapter 7_files\image075.gif  for modified Euler integration and  C:\Users\portman\Documents\Chapter 7_files\image076.gif  5/12  and -1/12 for Euler, AB-2 and trapezoidal integration, respectively. As expected, the table shows that the damping ratio and frequency errors for finite  C:\Users\portman\Documents\Chapter 7_files\image012.gif  are the smallest when predictor integration is used to calculate  C:\Users\portman\Documents\Chapter 7_files\image019.gif  in Eq. (7.7). When  C:\Users\portman\Documents\Chapter 7_files\image074.gif , the damping ratio error vanishes, and the approximate fractional error in frequency becomes  C:\Users\portman\Documents\Chapter 7_files\image077.gif  for all four methods.

 

Table 7.2

Root Frequency and Damping Ratio Errors for Various Methods of Estimating  C:\Users\portman\Documents\Chapter 7_files\image017.gif  for the Damping Term in Modified Euler Integration

C:\Users\portman\Documents\Chapter 7_files\image078.jpg

 

We turn next to the consideration of the transfer function errors. For the lower three methods in Table 7.1 the order of the effective method used to integrate the damping term  C:\Users\portman\Documents\Chapter 7_files\image021.gif  is given by k = 2. In this case Eq. (7.12) for  C:\Users\portman\Documents\Chapter 7_files\image079.gif  can be written as

C:\Users\portman\Documents\Chapter 7_files\image080.jpg

where  C:\Users\portman\Documents\Chapter 7_files\image081.gif  is the continuous system transfer function given earlier in Eq. (7.13). It follows that the fractional error in transfer function is given approximately by

C:\Users\portman\Documents\Chapter 7_files\image082.jpg

(7.25)

 

After rationalization, we obtain the following formulas for the fractional gain error and the phase error from the real and imaginary parts, respectively, of H*/H – 1:

C:\Users\portman\Documents\Chapter 7_files\image083.jpg (7.26)

(7.27)    C:\Users\portman\Documents\Chapter 7_files\image084.jpg

 

For the case where Euler integration is, in effect, used for integrating the damping term (the first method shown in Table 7.1), C:\Users\portman\Documents\Chapter 7_files\image070.gif and k = 1 in Eq. (7.12). Also, to first order in the terms involving  C:\Users\portman\Documents\Chapter 7_files\image067.gif  vanish, and the following approximate formulas for the transfer function fractional gain error and the phase error are easily derived:

C:\Users\portman\Documents\Chapter 7_files\image085.jpg

(7.28)

 

For each of the damping-term estimation formulas given in Table 7.1, Table 7.3 lists the asymptotic formulas for the transfer function gain and phase errors. The formulas are based on Eqs. (7.26), (7.27) and (7.28) with  C:\Users\portman\Documents\Chapter 7_files\image075.gif  for modified Euler integration and  C:\Users\portman\Documents\Chapter 7_files\image068.gif  = 5/12, -1/12 and 1/24 for AB-2, trapezoidal and predictor integration, respectively. As in the case of the characteristic root errors of Table 7.2, Table 73 shows that the transfer function gain and phase errors for finite  C:\Users\portman\Documents\Chapter 7_files\image012.gif  are the smallest when predictor integration is used to calculate  C:\Users\portman\Documents\Chapter 7_files\image019.gif  in Eq. (7.7). Again, this is to be expected, since the integrator error coefficient for predictor integration is smaller than the error coefficient for either AB-2 or trapezoidal integration.

 

Table 7.3

Transfer Function Gain and Phase Errors for Various Methods of Estimating C:\Users\portman\Documents\Chapter 7_files\image019.giffor the Damping Term in Modified Euler Integration

C:\Users\portman\Documents\Chapter 7_files\image086.jpg

 

7.4 Time Domain Errors

In Chapter 3, Section 3.13, we found it useful to compare the performance of different integration methods in the time domain, in addition to considering characteristic root and transfer function errors. In this section we consider the response of the second-order linear system, as simulated with modified Euler integration, to the same acceleration-limited step input used in Section 3.13. As shown in Figure 3.14, this input avoids the discontinuity in displacement inherent in a true step input and yet can produce a response quite similar to the ideal step response. In this way we avoid the domination of errors caused by input discontinuities when using predictor integration algorithms. From Eq. (3.176) we recall that the acceleration-limited step input U(t) is given by

(7.29)    C:\Users\portman\Documents\Chapter 7_files\image087.jpg

 

When integrated twice with T set equal to  C:\Users\portman\Documents\Chapter 7_files\image088.gif , Eq. (3.29) yields the input U(t) shown in Figure 3.14. We consider the simulated response of the second-order system using the modified Euler difference equations (7.7) and (7.8) with the damping ratio  C:\Users\portman\Documents\Chapter 7_files\image089.gif , which is the same value used earlier in Figure 3.14. Here we will plot the respective solution errors when the velocity estimate  C:\Users\portman\Documents\Chapter 7_files\image019.gif ,  as needed in the modified Euler mechanization, is calculated using each of the bottom three formulas in Table 7.1.

 

For the case where  C:\Users\portman\Documents\Chapter 7_files\image019.gif  is computed as the average of  C:\Users\portman\Documents\Chapter 7_files\image015.gif  and  C:\Users\portman\Documents\Chapter 7_files\image020.gif , as shown in the third formula in Table 7.1, Eq. (7.7) becomes implicit in  C:\Users\portman\Documents\Chapter 7_files\image015.gif . Since the equation is linear, however, we can solve for  C:\Users\portman\Documents\Chapter 7_files\image015.gif , which results in the following difference equation:

(7.30)    C:\Users\portman\Documents\Chapter 7_files\image090.jpg

 

where

(7.31)    C:\Users\portman\Documents\Chapter 7_files\image091.jpg

 

For a dimensionless integration step size given by  C:\Users\portman\Documents\Chapter 7_files\image092.gif , Figure 7.1 shows the error in simulated response to the acceleration limited step input. In addition to the results when using each of the last three formulas in Table 7.1 for  C:\Users\portman\Documents\Chapter 7_files\image019.gif , Figure 7.1 also shows the results when conventional AB-2 integration is used. The superiority of all three versions of the modified Euler method is clearly evident. Not shown are the results when the estimate  C:\Users\portman\Documents\Chapter 7_files\image093.gif , which is equivalent to Euler integration of the damping term, as noted in the first entry in Table 7.1. In this case the errors are proportional to h rather than h2 for finite  C:\Users\portman\Documents\Chapter 7_files\image012.gif  which is the case here. As a result, the errors are even larger than those shown in Figure 7.1 for conventional AB-2 integration. Clearly the modified Euler method that employs second-order predictor integration to compute  C:\Users\portman\Documents\Chapter 7_files\image019.gif  exhibits the smallest error. This is to be expected based on our previous results in Tables 7.2 and 73.

 

7.5 Stability of Modified Euler Methods

We have seen that the stability of integration algorithms often represents as important a consideration as accuracy when simulating dynamic systems. To study the stability of the modified-Euler methods considered here, we start by determining the Z transform,  C:\Users\portman\Documents\Chapter 7_files\image094.gif  for each of the schemes listed in Table 7.1. For example, consider the case where the estimate  C:\Users\portman\Documents\Chapter 7_files\image095.gif , which is equivalent to Euler integration of the damping term. Then Eqs. (7.7) and (7.8) lead to the following Z transform:

 

(7.32)    C:\Users\portman\Documents\Chapter 7_files\image096.jpg

 

C:\Users\portman\Documents\Chapter 7_files\image097.jpg

Figure 7.1. Acceleration-limited unit-step response errors for different versions of modified-Euler integration compared with conventional AB-2 integration; C:\Users\portman\Documents\Chapter 7_files\image098.gif .

We recall that the stability boundary in the  C:\Users\portman\Documents\Chapter 7_files\image032.gif  plane is determined by setting the denominator of H*(z) equal to zero with  C:\Users\portman\Documents\Chapter 7_files\image099.gifi.e.,  C:\Users\portman\Documents\Chapter 7_files\image100.gif , which corresponds to neutral stability. When we let  C:\Users\portman\Documents\Chapter 7_files\image101.gif  both the real and imaginary parts of the denominator must vanish. Here the imaginary part is equal to  C:\Users\portman\Documents\Chapter 7_files\image102.gif , which in general will only vanish when  C:\Users\portman\Documents\Chapter 7_files\image103.gif . . We conclude that  C:\Users\portman\Documents\Chapter 7_files\image104.gif  or  C:\Users\portman\Documents\Chapter 7_files\image105.gif , which corresponds to z = 1 or -1,  respectively. For z = 1, the denominator of H*(z) becomes  C:\Users\portman\Documents\Chapter 7_files\image106.gif  and it follows that  C:\Users\portman\Documents\Chapter 7_files\image107.gif , a trivial solution. For z = -1, the denominator of H*(z) becomes  C:\Users\portman\Documents\Chapter 7_files\image108.gif  which, when set equal to zero, results in the following formula for  C:\Users\portman\Documents\Chapter 7_files\image109.gif:

(7.33)    C:\Users\portman\Documents\Chapter 7_files\image110.jpg

 

From Eq. (7.14) for  C:\Users\portman\Documents\Chapter 7_files\image044.gif  in terms of  C:\Users\portman\Documents\Chapter 7_files\image011.gif  and  C:\Users\portman\Documents\Chapter 7_files\image012.gif  we obtain the following formula for the stability boundary in the  C:\Users\portman\Documents\Chapter 7_files\image032.gif  plane when the modified Euler integration method is used with conventional Euler to integrate the damping term:

(7.34)    C:\Users\portman\Documents\Chapter 7_files\image111.jpg

 

A similar approach is used to obtain the stability boundary in the  C:\Users\portman\Documents\Chapter 7_files\image032.gif  plane for the other modified Euler schemes in Table 7.1. The resulting formulas are summarized in Table 7.4. In each case neutral stability occurs for z = -1, which corresponds to an undamped oscillation at one-half the integration frame rate 1/h.

 

Table 7.4

C:\Users\portman\Documents\Chapter 7_files\image112.gif Plane Stability Boundary Formulas for Various Methods of Estimating C:\Users\portman\Documents\Chapter 7_files\image113.giffor the Damping Term in Modified Euler Integration

C:\Users\portman\Documents\Chapter 7_files\image114.jpg

 

The actual stability boundaries are shown in Figure 7.2. In addition to the four modified Euler methods considered here, Figure 7.2 also shows for reference purposes the stability boundary for AB-2 integration, the most widely used of the real-time algorithms. As is customary, only the upper half of the stability regions is shown, since the boundaries are all symmetric with respect to the real axis. Clearly the scheme which bases the estimate for  C:\Users\portman\Documents\Chapter 7_files\image016.gif  on the average of  C:\Users\portman\Documents\Chapter 7_files\image115.gif  and  C:\Users\portman\Documents\Chapter 7_files\image116.gif , equivalent to trapezoidal integration of the damping term, has by far the largest stability region of all the modified Euler methods. On the other hand, the scheme which bases the estimate for  C:\Users\portman\Documents\Chapter 7_files\image019.gif  on second-order predictor integration exhibits the smallest of the modified Euler stability regions. The right hand boundary for all the modified Euler methods is the imaginary axis. As noted earlier, this means that the modified Euler algorithm exhibits exactly zero damping, regardless of integration step size, when used to simulate an undamped second-order system. It is also apparent that the modified Euler methods in general are more robust in stability than AB-2 integration when the system being simulated is lightly damped.

 

It should be noted that all of the modified Euler methods considered here are equally applicable to nonlinear systems with the exception of the scheme which effectively uses trapezoidal integration for the damping term. In the trapezoidal case, when the system being simulated is linear, we are able to solve the resulting implicit equation to produce an explicit formula. Eqs. (7.30) and (7.31) provide an example. Of course, this is not in general possible when the time derivative of the velocity Y is a nonlinear function of Y. Even in this case, however, it may be possible to obtain either an exact or at least an approximately exact explicit formula, as we shall see in the next section. In this way we can take advantage of the quite large stability region associated with modified Euler integration when using the trapezoidal method to integrate the Y – dependent terms.

C:\Users\portman\Documents\Chapter 7_files\image117.jpg

Figure 7.2. Stability boundaries for various versions of modified-Euler integration compared with conventional AB-2 integration.

 

7.6 Application to a Nonlinear System

We now consider the use of modified Euler integration to simulate a nonlinear system. For simplicity we choose the same second-order system described earlier in Section (7.6), but with a quadratic rather than linear damping term. The two state equations are given by

(7.35)    C:\Users\portman\Documents\Chapter 7_files\image118.jpg

 

The magnitude of the damping term is clearly proportional to  C:\Users\portman\Documents\Chapter 7_files\image119.gif , but the polarity is that of the velocity, Y. As a specific example we let the quadratic damping constant = 1. We also utilize the same acceleration-limited unit step input given in Eq. (7.29) with  C:\Users\portman\Documents\Chapter 7_files\image120.gif  and  C:\Users\portman\Documents\Chapter 7_files\image121.gifWith zero initial conditions the exact response is shown in Figure 7.3. Also shown in the figure is the response of the linear system with  C:\Users\portman\Documents\Chapter 7_files\image089.gif . The effect of the quadratic damping is to make the transient die out more slowly as the amplitude of the transient decays.

 

The solution errors in simulating the second-order system with quadratic damping using the various modified Euler schemes are shown in Figure 7.4. Also shown is the result when conventional AB-2 integration is used. The modified Euler methods are clearly superior. Again, the

C:\Users\portman\Documents\Chapter 7_files\image122.jpg

Figure 7.3. Acceleration-limited step response of second-order systems with linear and quadratic damping.

scheme in Table 7.1 which uses second-order predictor integration to calculate the estimate  C:\Users\portman\Documents\Chapter 7_files\image016.gifgives the best performance. In mechanizing the method in Table 7.1 which computes C:\Users\portman\Documents\Chapter 7_files\image016.gif based on the average of  C:\Users\portman\Documents\Chapter 7_files\image115.gif  and  C:\Users\portman\Documents\Chapter 7_files\image116.gif , we have approximated  C:\Users\portman\Documents\Chapter 7_files\image123.gif  with  C:\Users\portman\Documents\Chapter 7_files\image124.gif . Thus the difference equation for simulating (7.35) becomes

(7.36)    C:\Users\portman\Documents\Chapter 7_files\image125.jpg

 

and we can solve explicitly for  C:\Users\portman\Documents\Chapter 7_files\image126.gif  to obtain

(7.37)    C:\Users\portman\Documents\Chapter 7_files\image127.jpg

 

 

Eqs. (7.37) and (7.8) were used to obtain the simulation results labelled “Mod Euler, trapezoidal damping” in Figure 7.4.

 

In general, of course, the right-hand side of the state equation for  C:\Users\portman\Documents\Chapter 7_files\image128.gif  may not be as simple a nonlinear function of the velocity Y as the quadratic form in Eq. (7.35), where we were able to replace  C:\Users\portman\Documents\Chapter 7_files\image129.gif  with the approximation  C:\Users\portman\Documents\Chapter 7_files\image124.gif .   However, in the general case it is possible to represent the nonlinear functionF(Y) with the following first-order approximation:

 

C:\Users\portman\Documents\Chapter 7_files\image130.jpg

Figure 7.4. Acceleration-limited step-response errors in simulating a second-order system with quadratic damping using modified-Euler integration.

(7.38)    C:\Users\portman\Documents\Chapter 7_files\image131.jpg

 

Since the right side of Eq. (7.38) is a linear function of  C:\Users\portman\Documents\Chapter 7_files\image115.gif , the modified Euler difference equation  C:\Users\portman\Documents\Chapter 7_files\image132.gif  can now be solved explicitly for  C:\Users\portman\Documents\Chapter 7_files\image115.gif . In fact, when equation (7.38) is applied to the quadratic damping function,  C:\Users\portman\Documents\Chapter 7_files\image133.gif , it results directly in the approximation  C:\Users\portman\Documents\Chapter 7_files\image134.gif , as used above in Eq. (7.36).  Thus Eq. (7.38) provides a general approach to using the equivalent of trapezoidal integration for Y-dependent nonlinear functions in the state equation for Y.  In this way we can take advantage of the improved stability of this version of modified Euler integration, as exhibited in Figure 7.2. However, if stability is not a problem, the approach which calculates the approximation  C:\Users\portman\Documents\Chapter 7_files\image016.gif  using predictor integration can always be used and in general produces the most accurate result, as we have seen in our examples here .

 

7.7 Modified Euler Integration with Root Matching

In this section we determine the improvements in modified Euler simulation of second-order linear systems that can be made using characteristic-root matching. Consider first the case in Table 7.1 where we let  C:\Users\portman\Documents\Chapter 7_files\image135.gif , equivalent to Euler integration of the damping term in Eq. 7.6.

 

The Z transform, H*(z), of the resulting digital system when the remaining integrations use modified Euler integration, has already been presented in Eq. (7.32). The roots z1 and z2 of the denominator of H*(z) are given by the formula

(7.39)    C:\Users\portman\Documents\Chapter 7_files\image136.jpg

 

We have seen in Eq. (2.14) that the corresponding characteristic roots,  C:\Users\portman\Documents\Chapter 7_files\image137.gif , of the digital system are related to the z-transform poles, z1.2 , by the formulas

(7.40)    C:\Users\portman\Documents\Chapter 7_files\image138.jpg

 

The damping ratio  C:\Users\portman\Documents\Chapter 7_files\image058.gif  and the undamped natural frequency  C:\Users\portman\Documents\Chapter 7_files\image139.gif  of the digital system are related to the digital system characteristic roots,  C:\Users\portman\Documents\Chapter 7_files\image140.gif , by the following formulas:

(7.41)    C:\Users\portman\Documents\Chapter 7_files\image141.jpg

 

 

From Eqs. (7.39), (7.40) and (7.41) we can determine the exact formulas for  C:\Users\portman\Documents\Chapter 7_files\image142.gif  and  C:\Users\portman\Documents\Chapter 7_files\image058.gif  for the modified Euler simulation in terms of  C:\Users\portman\Documents\Chapter 7_files\image011.gif  and  C:\Users\portman\Documents\Chapter 7_files\image012.gif  for the original continuous system. From Eq. (7.39) for  C:\Users\portman\Documents\Chapter 7_files\image074.gif  we find that  C:\Users\portman\Documents\Chapter 7_files\image143.gif .  Thus  C:\Users\portman\Documents\Chapter 7_files\image144.gif  and the digital simulation will have zero damping for any step-size within the range  C:\Users\portman\Documents\Chapter 7_files\image145.gif .  For the case of finite damping the exact formulas reduce to the asymptotic formulas in Eq. (7.24) when  C:\Users\portman\Documents\Chapter 7_files\image146.gif .

 

From Eqs. (7.39), (7.40) and (7.41) we can also solve for  C:\Users\portman\Documents\Chapter 7_files\image011.gif  and  C:\Users\portman\Documents\Chapter 7_files\image012.gif  in terms of  C:\Users\portman\Documents\Chapter 7_files\image142.gif  and  C:\Users\portman\Documents\Chapter 7_files\image058.gif . The resulting formulas allow us to calculate  C:\Users\portman\Documents\Chapter 7_files\image011.gif  and  C:\Users\portman\Documents\Chapter 7_files\image012.gif  for the original continuous system, given  C:\Users\portman\Documents\Chapter 7_files\image142.gif  and  C:\Users\portman\Documents\Chapter 7_files\image058.gif  for the digital system. If in these formulas we replace  C:\Users\portman\Documents\Chapter 7_files\image011.gif  and  C:\Users\portman\Documents\Chapter 7_files\image012.gif  with  C:\Users\portman\Documents\Chapter 7_files\image147.gif  and  C:\Users\portman\Documents\Chapter 7_files\image148.gif , respectively, and then replace  C:\Users\portman\Documents\Chapter 7_files\image142.gif  and  C:\Users\portman\Documents\Chapter 7_files\image058.gif  with  C:\Users\portman\Documents\Chapter 7_files\image011.gif  and  C:\Users\portman\Documents\Chapter 7_files\image012.gif , respectively, we obtain the following formulas:

(7.42)    C:\Users\portman\Documents\Chapter 7_files\image149.jpg

(7.43)    C:\Users\portman\Documents\Chapter 7_files\image150.jpg

 

These formulas permit us to calculate the parameters  C:\Users\portman\Documents\Chapter 7_files\image147.gif  and  C:\Users\portman\Documents\Chapter 7_files\image148.gif  which, when used in the modified Euler difference equations, will make the digital simulation match exactly the specified undamped natural frequency  C:\Users\portman\Documents\Chapter 7_files\image011.gif  and damping ratio  C:\Users\portman\Documents\Chapter 7_files\image012.gif . The new difference equations can be rewritten as

(7.44)    C:\Users\portman\Documents\Chapter 7_files\image151.jpg

 

(7.45)    C:\Users\portman\Documents\Chapter 7_files\image152.jpg

 

 

(7.46)    C:\Users\portman\Documents\Chapter 7_files\image153.jpg

 

The digital simulation using Eqs. (7.44), (7.45) and (7.46) will yield a solution for which  C:\Users\portman\Documents\Chapter 7_files\image154.gif  and  C:\Users\portman\Documents\Chapter 7_files\image155.gif . Thus the characteristic roots of the digital simulation will match exactly the characteristic roots of the continuous system being simulated.

 

Next, we determine the transfer function errors when the above root-matching procedure is used. From Eqs. (7.42) and (7.43) we can derive the following approximate equations for  C:\Users\portman\Documents\Chapter 7_files\image147.gif  and  C:\Users\portman\Documents\Chapter 7_files\image148.gif .

(7.47)    C:\Users\portman\Documents\Chapter 7_files\image156.jpg

(7.48)    C:\Users\portman\Documents\Chapter 7_files\image157.jpg

 

We now substitute  C:\Users\portman\Documents\Chapter 7_files\image147.gif  and  C:\Users\portman\Documents\Chapter 7_files\image148.gif , as given above, along with the power series representation of  C:\Users\portman\Documents\Chapter 7_files\image158.gifinto Eq. (7.32) to obtain the following asymptotic formulas for the transfer function gain and phase errors:

(7.49)  C:\Users\portman\Documents\Chapter 7_files\image159.jpg

Note that both errors depend on h2 instead of h, as in the corresponding formulas in Eq. (7.28) when root matching is not employed.

 

The same root matching technique can be applied to the modified Euler method which computes  C:\Users\portman\Documents\Chapter 7_files\image016.gif  as the average of  C:\Users\portman\Documents\Chapter 7_files\image115.gif  and  C:\Users\portman\Documents\Chapter 7_files\image116.gif , as shown in the third formula in Table 7.1. From the transform of the digital system represented by Eqs. (7.30), (7.31) and (7.8) we can determine the exact formulas for  C:\Users\portman\Documents\Chapter 7_files\image142.gif  and  C:\Users\portman\Documents\Chapter 7_files\image058.gif . Again, these formulas permit us to calculate  C:\Users\portman\Documents\Chapter 7_files\image011.gif  and  C:\Users\portman\Documents\Chapter 7_files\image012.gif  for the original continuous system, given  C:\Users\portman\Documents\Chapter 7_files\image142.gif  and  C:\Users\portman\Documents\Chapter 7_files\image058.gif  for the digital system. Following the same procedure used above when Euler rather than trapezoidal integration is used for the damping term, we replace  C:\Users\portman\Documents\Chapter 7_files\image011.gif  and  C:\Users\portman\Documents\Chapter 7_files\image012.gif  with  C:\Users\portman\Documents\Chapter 7_files\image147.gif  and  C:\Users\portman\Documents\Chapter 7_files\image148.gif , respectively, followed by the replacement of  C:\Users\portman\Documents\Chapter 7_files\image142.gif  and  C:\Users\portman\Documents\Chapter 7_files\image058.gif  with  C:\Users\portman\Documents\Chapter 7_files\image011.gif  and  C:\Users\portman\Documents\Chapter 7_files\image012.gif , respectively. This leads directly to the same difference equation given above in Eq. (7.44), with the coefficients for D and again given by Eqs. (7.45) and (7.46). Thus it makes no difference whether  C:\Users\portman\Documents\Chapter 7_files\image016.gif  is approximated with  C:\Users\portman\Documents\Chapter 7_files\image116.gif  or the average of  C:\Users\portman\Documents\Chapter 7_files\image115.gif  and  C:\Users\portman\Documents\Chapter 7_files\image116.gif ; the modified Euler difference equations are identical when root matching is used. It follows that the transfer function  C:\Users\portman\Documents\Chapter 7_files\image160.gif  is the same and the approximation formulas given in Eq. (7.49) also apply.

 

Note in Eq. (7.49) that the fractional error in gain,  C:\Users\portman\Documents\Chapter 7_files\image161.gifis completely independent of the damping ratio  C:\Users\portman\Documents\Chapter 7_files\image012.gif , and the phase error C:\Users\portman\Documents\Chapter 7_files\image162.gif approaches zero as  C:\Users\portman\Documents\Chapter 7_files\image012.gif  approaches zero. Thus the modified-Euler method with matched roots will be especially effective in simulating lightly-damped second-order systems, such as in the representation of structural modes. This is illustrated in the example shown in Figure 7.5, where gain and phase versus frequency for a second-order system with  C:\Users\portman\Documents\Chapter 7_files\image163.gif  are shown. Because of the sharp resonant peak in gain and the extremely rapid change in phase as  C:\Users\portman\Documents\Chapter 7_files\image164.gif  passes through  C:\Users\portman\Documents\Chapter 7_files\image011.gif , it is very critical that both the natural frequency and damping ratio of the digital simulation match that of the continuous system. The table at the bottom of the figure lists the transfer function errors for input frequencies in the vicinity of  C:\Users\portman\Documents\Chapter 7_files\image011.gif  for the specific case of  C:\Users\portman\Documents\Chapter 7_files\image165.gif , which corresponds to only 2 integration steps per radian or 12.57 steps per cycle. Shown in the table are the gain and phase errors based on both an exact calculation using the system Z transform and also the approximate formulas of Eq. (7.49). Note how closely the approximate calculations agree with the exact, even for the example here for which  C:\Users\portman\Documents\Chapter 7_files\image166.gif .

C:\Users\portman\Documents\Chapter 7_files\image167.jpg

Figure 7.5. Frequency response of lightly-damped second-order system using modified-Euler integration with root matching, C:\Users\portman\Documents\Chapter 7_files\image168.gif.

 

When the transfer function errors in Table 7.3 for the case where trapezoidal integration is used for the damping term are compared with the gain and phase errors in Eq. (7.48), it is evident that the errors are much smaller in the latter case when the damping ratio is small and the input frequency  C:\Users\portman\Documents\Chapter 7_files\image169.gif  is approximately equal to  C:\Users\portman\Documents\Chapter 7_files\image170.gif .  This occurs because, under these conditions, the denominators in the gain and phase error formulas in Table 73 become small. On the other hand, for  C:\Users\portman\Documents\Chapter 7_files\image171.gif  the errors represented in Table 7.3 are much smaller than those in Eq. (7.48). In this case the modified Euler algorithm which uses root matching is less favorable. For  C:\Users\portman\Documents\Chapter 7_files\image172.gif  both methods yield the same gain and phase errors. Thus the choice of one of the modified Euler methods in Table 7.3 without root matching or, alternatively, a method utilizing the root matching introduced in this section, depends on the input frequency regime over which accurate simulation is most important.

 

It is possible to extend the root-matching technique described in this section to the other two schemes in Table 7.1, namely the use of either linear extrapolation or second-order predictor integration to calculate the estimate  C:\Users\portman\Documents\Chapter 7_files\image173.gif , as needed for the damping term in the modified Euler formula of Eq. (7.7). In each case formulas can be derived for  C:\Users\portman\Documents\Chapter 7_files\image147.gif  and  C:\Users\portman\Documents\Chapter 7_files\image174.gif  in terms of  C:\Users\portman\Documents\Chapter 7_files\image170.gif  and  C:\Users\portman\Documents\Chapter 7_files\image175.gif .  Then when  C:\Users\portman\Documents\Chapter 7_files\image170.gif  and  C:\Users\portman\Documents\Chapter 7_files\image175.gif  are replaced, respectively, by  C:\Users\portman\Documents\Chapter 7_files\image147.gif  and  C:\Users\portman\Documents\Chapter 7_files\image174.gif  in the modified Euler difference equations, the characteristic roots of the resulting simulation will agree exactly with the roots of the continuous system being simulated.

 

It is useful to examine the time-domain performance of the modified Euler method with root matching when it is used to simulate the second-order system with the acceleration-limited step input which we considered earlier in Section 7.4. Figure 7.6 shows the resulting errors compared with the solution errors obtained for the two most accurate schemes when root matching is not used, namely, trapezoidal-integration damping and predictor-integration damping. Whereas the modified Euler method which uses predictor integration to compute  C:\Users\portman\Documents\Chapter 7_files\image173.gif  exhibits a slightly smaller startup transient, the error for the root matching method damps more rapidly. This is undoubtedly due to the fact that there is no error caused by a frequency difference between the ideal and numerical transient in the case of root matching, since by definition the transient frequencies are the same. It should be remembered, however, that the modified Euler method which uses root matching can only be applied to the simulation of linear systems, whereas the modified Euler method which uses predictor integration to compute  C:\Users\portman\Documents\Chapter 7_files\image173.gif  is applicable to nonlinear systems as well. In this case the only disadvantage of using predictor integration to compute  C:\Users\portman\Documents\Chapter 7_files\image173.gif  is a reduced stability region (see Figure 7.2).

 

7.8 Application of the Modified Euler Method to a Linear Controller

We next consider the application of the various modified Euler methods to the same linear controller used in Chapter 6, namely a proportional plus rate controller with a double lag. Thus we let the controller transfer function be given by

(7.50)    C:\Users\portman\Documents\Chapter 7_files\image176.jpg

 

where  C:\Users\portman\Documents\Chapter 7_files\image177.gif  is the rate constant and both time lags are equal to  C:\Users\portman\Documents\Chapter 7_files\image178.gif . Letting  C:\Users\portman\Documents\Chapter 7_files\image179.gif , we can write the state equations as follows:

C:\Users\portman\Documents\Chapter 7_files\image180.jpg

 Figure 7.6. Step response errors for modified-Euler integration with and without root matching;  C:\Users\portman\Documents\Chapter 7_files\image181.gif

(7.51)    C:\Users\portman\Documents\Chapter 7_files\image182.jpg

(7.52)    C:\Users\portman\Documents\Chapter 7_files\image183.jpg

 

Eq. (7.51) represents a second-order system with an undamped natural frequency of  C:\Users\portman\Documents\Chapter 7_files\image170.gif  and a damping ratio  C:\Users\portman\Documents\Chapter 7_files\image184.gif . It can be simulated with any of the modified Euler methods considered thus far in this chapter. For example, if we employ modified Euler integration with root matching, the difference equations take the form

(7.53)    C:\Users\portman\Documents\Chapter 7_files\image185.jpg

 

The constants D and E are given by Eqs. (7.45) and (7.46) with  C:\Users\portman\Documents\Chapter 7_files\image184.gif . In this case they can be rewritten as

(7.54)    C:\Users\portman\Documents\Chapter 7_files\image186.jpg

 

To implement the output equation (7.52) we must add  C:\Users\portman\Documents\Chapter 7_files\image177.gif  times the output derivative X2 to the output X1 of the second-order system. In the modified Euler method this presents a problem, since X1 is computed at integer frame times, kh, and X2 is computed at half-integer frame times, (k-1/2)h. One method for accomplishing this is to compute the output X at half-integer frame times, with  C:\Users\portman\Documents\Chapter 7_files\image187.gif  given by the average of  C:\Users\portman\Documents\Chapter 7_files\image188.gif  and  C:\Users\portman\Documents\Chapter 7_files\image189.gif . Thus the equation for the output becomes

(7.56)    C:\Users\portman\Documents\Chapter 7_files\image190.jpg

 

The accuracy of the approximation  C:\Users\portman\Documents\Chapter 7_files\image191.gif  can be obtained in the frequency domain by taking the Z transform of the formula using a step size of h/2 and setting  C:\Users\portman\Documents\Chapter 7_files\image192.gif .  In this way we obtain

(7.56)    C:\Users\portman\Documents\Chapter 7_files\image193.jpg

 

Clearly the averaging process results in a gain error of  C:\Users\portman\Documents\Chapter 7_files\image194.gif  and no phase error. When this gain error is added to the gain error of  C:\Users\portman\Documents\Chapter 7_files\image195.gif  obtained earlier in Eq. (7.49), the total fractional gain error in the transfer function relating the output  C:\Users\portman\Documents\Chapter 7_files\image187.gif  to the input  C:\Users\portman\Documents\Chapter 7_files\image196.gif  when using modified Euler with root matching is given approximately by  C:\Users\portman\Documents\Chapter 7_files\image197.gif . The approximate phase error remains equal to the value given in Eq. (7.49), namely  C:\Users\portman\Documents\Chapter 7_files\image198.gif  for  C:\Users\portman\Documents\Chapter 7_files\image184.gif .

 

In Eq. (7.52) we must also be concerned with the error in the transfer function relating the output velocity  C:\Users\portman\Documents\Chapter 7_files\image199.gif  to the input  C:\Users\portman\Documents\Chapter 7_files\image196.gif . We have already determined the formula for the transfer function of the modified Euler algorithm used to integrate X2 to obtain Xl. Thus from Eq. (7.5)

(7.57)    C:\Users\portman\Documents\Chapter 7_files\image200.jpg

 

Then we can write the following formula for the transfer function  C:\Users\portman\Documents\Chapter 7_files\image201.gif  relating the output X2 to the

input f:

(7.58)    C:\Users\portman\Documents\Chapter 7_files\image202.jpg

From Eq. (7.58) it is clear that the fractional gain error of  C:\Users\portman\Documents\Chapter 7_files\image201.gif  is equal to the fractional gain error of the transfer function X1*/F*, i.e.,  C:\Users\portman\Documents\Chapter 7_files\image195.gif  in Eq. (7.49), plus the gain error  C:\Users\portman\Documents\Chapter 7_files\image203.gif  evident in Eq. (7.58) for the transfer function X2*/X1*. It follows that the total fractional gain error in the transfer function H2relating the velocity output X2 to the input f is given approximately by  C:\Users\portman\Documents\Chapter 7_files\image204.gif . From Eq. (7.49) the approximate phase error is still given by  C:\Users\portman\Documents\Chapter 7_files\image205.gif .

 

If we designate H1 as the transfer function relating X1 to f, we can then write the following formula for H*, the transfer function of the digital simulation of the controller:

C:\Users\portman\Documents\Chapter 7_files\image206.jpg

 

It then follows that the transfer function gain and phase errors in simulating the controller are given, respectively, by

(7.59)    C:\Users\portman\Documents\Chapter 7_files\image207.jpg

(7.60)    C:\Users\portman\Documents\Chapter 7_files\image208.jpg

 

We have seen above for the modified Euler method with root matching that  C:\Users\portman\Documents\Chapter 7_files\image209.gif   C:\Users\portman\Documents\Chapter 7_files\image210.gif .  Eqs. (7.59) and (7.60) can of course be used for other methods of simulating the controller, where the fractional gain errors  C:\Users\portman\Documents\Chapter 7_files\image211.gif  and  C:\Users\portman\Documents\Chapter 7_files\image212.gif , and the phase errors  C:\Users\portman\Documents\Chapter 7_files\image213.gif  and  C:\Users\portman\Documents\Chapter 7_files\image214.gif  represent the respective gain and phase errors associated with the transfer functions relating X1 and X2 to the controller input f when using these other methods.

 

We now consider the time-domain errors when the various modified Euler schemes are used to simulate the linear controller. As a specific example we let  C:\Users\portman\Documents\Chapter 7_files\image215.gif , which is the same case studied in Chapter 6.  We let the input be the acceleration-limited step defined in Eq. (3.176) and utilized earlier in Section 6.10. Figure 7.7 shows the controller response when the time constant of the acceleration-limited step is set equal to  C:\Users\portman\Documents\Chapter 7_files\image216.gif . Comparison with Figure 6.3 for the controller response to an ideal unit-step input confirms that the acceleration-limited step response is almost identical. As before, the rationale behind using the acceleration-limited step input is to avoid discontinuities in input displacement or velocity. Figure 7.8 shows the output error using the various modified Euler methods with an integration step size  C:\Users\portman\Documents\Chapter 7_files\image217.gif . Here it would appear that the root matching technique enjoys no particular advantage over the use of predictor integration for  C:\Users\portman\Documents\Chapter 7_files\image173.gif  in the damping term. This is

 

C:\Users\portman\Documents\Chapter 7_files\image218.jpg

Figure 7.7. Controller response to an acceleration-limited step input.

 

probably because the transient is well damped  C:\Users\portman\Documents\Chapter 7_files\image219.gif  and a small mismatch in transient frequency has little effect on the error.

 

C:\Users\portman\Documents\Chapter 7_files\image220.jpg

Figure 7.8. Errors in controller step response when simulated with various modified-Euler methods; step size C:\Users\portman\Documents\Chapter 7_files\image221.gif .

 

It should be noted that Eq. (7.46) was used for the constant E in the modified Euler difference equation (7.44) for root matching when simulating an underdamped second-order system  C:\Users\portman\Documents\Chapter 7_files\image222.gif . Eq. (7.54) was used for the critically-damped case, where Eq. (7.54) follows directly from Eq. (7.46) when  C:\Users\portman\Documents\Chapter 7_files\image184.gif .  For the overdamped case  C:\Users\portman\Documents\Chapter 7_files\image223.gif  we can still use Eq. (7.46) if we note that  C:\Users\portman\Documents\Chapter 7_files\image224.gif . Thus for  C:\Users\portman\Documents\Chapter 7_files\image225.gif  Eq. (7.46) becomes

(7.61)    C:\Users\portman\Documents\Chapter 7_files\image226.jpg

 

In either Eq. (7.44) or Eq. (7.53) the constant D given by Eq. (7.45) applies for all  C:\Users\portman\Documents\Chapter 7_files\image175.gif .

 

7.9 Comparison of Modified Euler and State-transition Methods

It is instructive to compare the results we have obtained above using modified Euler simulation of the controller with the results obtained when the state-transition method introduced in Chapter 6 is used. This comparison is especially appropriate when modified Euler with root-matching is used, since both methods then match the characteristic roots of the linear system being simulated. In Chapter 6 we observed that the only error exhibited by the state transition method is that associated with the formula used to approximate the input f(t) in the definite-integral portion of the state-transition difference equation. In Table 6.1 we summarized the transfer function gain and phase errors for a number of candidate methods for this approximation. One method not considered in Chapter 6 involves letting the input approximation  C:\Users\portman\Documents\Chapter 7_files\image227.gif , i.e., the input represented halfway through the frame. This is a particularly good choice in comparing results with the modified Euler scheme, because both methods then compute the controller output data point one-half frame time after the input data point.

 

When the state-transition method is used to simulate the controller equations (7.51) and (7.52) with  C:\Users\portman\Documents\Chapter 7_files\image228.gif , the following difference equations result:

(7.62)    C:\Users\portman\Documents\Chapter 7_files\image229.jpg

(7.63)    C:\Users\portman\Documents\Chapter 7_files\image230.jpg

 

Here the coefficients w11w12w21 and w22 are given by Eq. (6.73). The formulas for b1 and b2 are

(7.64)    C:\Users\portman\Documents\Chapter 7_files\image231.jpg

 

where U(t) and  C:\Users\portman\Documents\Chapter 7_files\image232.gif  are given in Eqs. (6.74) and (6.75) and represent, respectively, the unit step response and unit impulse response of the second-order system.

 

For an integration step size h = 0.02Ce, Figure 7.9 shows the output errors when the controller

 

C:\Users\portman\Documents\Chapter 7_files\image233.jpg

Figure 7.9. Errors in controller step response when simulated using the state-transition method and various modified-Euler methods.

 

is simulated by the above state-transition method, as well as the three different modified-Euler methods. All the methods appear to give comparable results, although the state-transition method exhibits the largest startup transient error. Subsequently, however, the state-transition error damps more quickly to zero. The modified-Euler method which uses predictor integration for the integer-frame estimate of X2 seems to give the best overall results and it is equally applicable to nonlinears systems. As noted in Figure 7.2, it does have a more restricted stability region in the  C:\Users\portman\Documents\Chapter 7_files\image234.gif  plane.

 

In addition to comparing the time-domain performance of the state-transition method with the various modified-Euler schemes, it is useful to compare the frequency-domain performance. For the state-transition method considered here, where we represent f (t) in the definite integral by  C:\Users\portman\Documents\Chapter 7_files\image235.gif , it is simpler to determine first the transfer function when simulating the first-order system with characteristic root  C:\Users\portman\Documents\Chapter 7_files\image236.gif , i.e., the system given by Eq. (6.4) with  C:\Users\portman\Documents\Chapter 7_files\image237.gif . From Eq. (6.14) with  C:\Users\portman\Documents\Chapter 7_files\image238.gif , replaced by  C:\Users\portman\Documents\Chapter 7_files\image235.gif , we have the following difference equation:

(7.65)    C:\Users\portman\Documents\Chapter 7_files\image239.jpg

 

Taking the Z transform with a step size of h/2 and setting  C:\Users\portman\Documents\Chapter 7_files\image192.gif , we obtain the transfer function for sinusoidal inputs, from which the following approximate formulas for the fractional gain error and phase error can be derived:

(7.66)    C:\Users\portman\Documents\Chapter 7_files\image240.jpg

 

Comparison with the transfer function errors in Table 6.1 shows that the above gain error is smaller than the gain error for any of the second-order methods in the table. However, there is a finite phase error in Eq. (7.66), as opposed to zero phase error to order h2 for the second-order methods in Table 6.1. Furhermore, the phase error in Eq. (7.66) depends on the eigenvalue  C:\Users\portman\Documents\Chapter 7_files\image236.gif ., which means that the approximate transfer function error when using the state-transition method with  C:\Users\portman\Documents\Chapter 7_files\image227.gif  does depend on the system being simulated and not simply  C:\Users\portman\Documents\Chapter 7_files\image241.gif .

 

The above results for simulating a first -order system can be extended to a second-order system with characteristic roots  C:\Users\portman\Documents\Chapter 7_files\image242.gif  and  C:\Users\portman\Documents\Chapter 7_files\image243.gif  and transfer function H(s) by noting that

(7.67)

C:\Users\portman\Documents\Chapter 7_files\image244.jpg

 

In terms of the fractional gain error  C:\Users\portman\Documents\Chapter 7_files\image245.gif  and the phase error  C:\Users\portman\Documents\Chapter 7_files\image246.gif  associated with the digital transfer function H* in simulating a continuous system with transfer function  C:\Users\portman\Documents\Chapter 7_files\image247.gif , we recall that  C:\Users\portman\Documents\Chapter 7_files\image248.gif . From Eqs. (7.66) and (7.67) it follows that

C:\Users\portman\Documents\Chapter 7_files\image249.jpg

or

C:\Users\portman\Documents\Chapter 7_files\image250.jpg

Thus the transfer function fractional gain error and phase error, respectively, when the state transition

method based on  C:\Users\portman\Documents\Chapter 7_files\image227.gif  is used to simulate a second-order linear system, are given by

(7.68)    C:\Users\portman\Documents\Chapter 7_files\image251.jpg

Unlike the first-order system simulation, which in Eq. (7.66) exhibits a,phase error as well as a gain error of order h2, here the second-order system simulation based on  C:\Users\portman\Documents\Chapter 7_files\image227.gif  in the state-transition formulation only exhibits a gain error, an error which is independent of the system parameters and depends only on  C:\Users\portman\Documents\Chapter 7_files\image241.gif

 

The results in Eq. (7.66) for the gain and phase errors in state-transition simulation of a first order system can also be extended to a second-order system when the output is considered to be the time-derivative state, X2. Thus we note that

(7.69)    C:\Users\portman\Documents\Chapter 7_files\image252.jpg

 

Again using the formulas in Eq. (7.66) for the fractional gain and phase errors in simulating the first-order systems in Eq. (7.69), we can derive, the equations for the approximate gain and phase errors when the state-transition method with  C:\Users\portman\Documents\Chapter 7_files\image227.gif  is used to simulate the second-order system represented by Eq. (7.69). In this way we obtain

(7.70)    C:\Users\portman\Documents\Chapter 7_files\image253.jpg

 

From Eq. (7.14) we note that  C:\Users\portman\Documents\Chapter 7_files\image254.gif  and  C:\Users\portman\Documents\Chapter 7_files\image255.gif . With these substitutions we can rewrite Eq. (7.70) as

(7.71)    C:\Users\portman\Documents\Chapter 7_files\image256.jpg

 

Substituting  C:\Users\portman\Documents\Chapter 7_files\image211.gif  and  C:\Users\portman\Documents\Chapter 7_files\image213.gif  from Eq. (7.68) and  C:\Users\portman\Documents\Chapter 7_files\image212.gif  and  C:\Users\portman\Documents\Chapter 7_files\image214.gif  from Eq. (7.71) into Eq. (7.59) and (7.60), we can write the formulas for the approximate gain and phase errors when the state-transition method with  C:\Users\portman\Documents\Chapter 7_files\image257.gif  is used to simulate the second-order controller.

 

The gain and phase errors in Eq. (7.71) for the state-transition method with  C:\Users\portman\Documents\Chapter 7_files\image227.gif  when simulating the second-order system of Eq. (7.69) should be compared with the errors when modified Euler simulation with root matching is used. Adding the gain error of  C:\Users\portman\Documents\Chapter 7_files\image203.gif  in Eq. (7.58) to the gain and phase errors in Eq. (7.49), we obtain

(7.72)    C:\Users\portman\Documents\Chapter 7_files\image258.jpg

 

Comparison of the results in Eq. (7.71) for the state-transition method based on  C:\Users\portman\Documents\Chapter 7_files\image227.gif  with the above results in Eq. (7.72) for the modified-Euler method with root matching shows that the phase error in the output derivative X2 in the case of the state-transition method is half as large. On the other hand, for very low input frequencies, i.e.,  C:\Users\portman\Documents\Chapter 7_files\image171.gif , comparison of Eq. (7.71) with Eq. (7.72) shows that the magnitude of the gain error  C:\Users\portman\Documents\Chapter 7_files\image212.gif  for the state-transition method is much larger than the magnitude of   C:\Users\portman\Documents\Chapter 7_files\image212.gif for the modified-Euler method, namely  C:\Users\portman\Documents\Chapter 7_files\image259.gif  times larger. For very high input frequencies, i.e.,  C:\Users\portman\Documents\Chapter 7_files\image171.gif , comparison of Eq. (7.71) with (7.72) shows that the gain errors in the output derivative X2 are equal for the two methods. When the output of the second-order system is the displacement state X1 rather than the velocity state X2, we have seen that the state-transition gain error in Eq. (7.68) is half the magnitude of the modified Euler gain error in Eq. (7.49). Also, the state-transition phase error in Eq. (7.68) is zero to order h2, compared with the finite modified-Euler phase error of order h2 in Eq. (7.49). However, the output displacement when using the modified-Euler method is  C:\Users\portman\Documents\Chapter 7_files\image260.gif  for an input  C:\Users\portman\Documents\Chapter 7_files\image261.gif , as is apparent in Eq. (7.53). For the state-transition method Eq. (7.62) shows that the output is  C:\Users\portman\Documents\Chapter 7_files\image189.gif  for an input  C:\Users\portman\Documents\Chapter 7_files\image261.gif . Thus the modified-Euler output displacement leads the state-transition output by half a time step for the same input data sequence in simulating a second-order system. This can represent a significant advantage in many applications. We conclude that relative to each other, the modified -Euler method with root-matching and the state-transition method have both advantages and disadvantages, with the optimal choice dependent upon the particular requirements in any given simulation application.

 

7.10 Simulation of a Fourth-order Bandpass Filter

The modified Euler method with root matching becomes especially effective in simulating high-order linear systems, such as those used to represent linear filters.* We next consider a fourth-order linear system consisting of two velocity-output second-order systems in series, as shown in Figure 7.10. When the second-order systems are lightly-damped, each with a slightly different undamped natural frequency and damping ratio, the fourth-order system can be used to synthesize a narrow-bandpass filter. Thus we let the filter transfer function be given by

(7.73)    C:\Users\portman\Documents\Chapter 7_files\image262.jpg

 

where

(7.74)    C:\Users\portman\Documents\Chapter 7_files\image263.jpg

 

We simulate each of the second-order systems with the root-matching version of modified Euler integration that uses Eqs. (7.44), (7.45) and (7.46). With  C:\Users\portman\Documents\Chapter 7_files\image264.gif  as the input to the first subsystem, we recall from the previous section that the output after completion of the integration step is equal to  C:\Users\portman\Documents\Chapter 7_files\image265.gif , with the transfer function gain and phase errors given by Eq. (7.72). If  C:\Users\portman\Documents\Chapter 7_files\image265.gif  is then used as the input to the second subsystem, the output will be  C:\Users\portman\Documents\Chapter 7_files\image266.gif , as indicated in Figure 7.10. The approximate overall transfer function gain and phase errors to order h2 will then be the sum of the individual subsystem gain and phase errors of Eq. (7.72). Thus

* See, for example, Howe, R.M., “Simulation of Linear Systems Using Modified Euler Integration Methods,” Transactions of the Society for Computer Simulation, Vol. 5, No. 2, 1985, pp 125-152.

C:\Users\portman\Documents\Chapter 7_files\image267.jpg

Figure 7.10. Fourth-order bandpass filter synthesized with two modified-Euler subsystems.

(7.75)    C:\Users\portman\Documents\Chapter 7_files\image268.jpg

(7.76)    C:\Users\portman\Documents\Chapter 7_files\image269.jpg

 

The extension to any linear system that can be represented by second-order subsystems in series is obvious. To order h2 the asymptotic formulas for transfer function gain and phase errors are given simply by the sum of the gain and phase errors for each of the individual subsystems. If the second-order subsystems have velocity instead of displacement as outputs, then each output represents a half-integer sample with respect to the input, as shown in Figure 7.10. Under these conditions an odd number of second-order subsystems will lead to a half-integer output sample. If an integer output sample is required, it can be computed as the average of the two half-integer samples bracketing the integer sample point.

 

7.11 Modified Euler Simulation of a 14th-order Bandpass Filter

In this section we consider a 14th-order bandpass filter. The filter is synthesized with 3 pairs of second-order filters plus a single second-order filter, all connected in series as shown in Figure 7.11. Each pair of second-order filters represents a fourth-order filter with the transfer function defined as in Eqs. (7.73) and (7.74). Each individual second-order subsystem is simulated using the modified Euler algorithm with root matching, as given earlier in Eqs. (7.44), (7.45) and (7.46). Within each pair of second-order systems the updated velocity of the first subsystem, designated  C:\Users\portman\Documents\Chapter 7_files\image265.gif  in Figure 7.10, is used to provide the input to the second sub-system. For the subsystem  C:\Users\portman\Documents\Chapter 7_files\image270.gif  in Figure 7.11 the output  C:\Users\portman\Documents\Chapter 7_files\image271.gif  rather than the updated output  C:\Users\portman\Documents\Chapter 7_files\image266.gif  is used as the input for the second subsystem,  C:\Users\portman\Documents\Chapter 7_files\image272.gif . The output  C:\Users\portman\Documents\Chapter 7_files\image273.gif  instead of the updated output  C:\Users\portman\Documents\Chapter 7_files\image274.gif  of this second subsystem is in turn used as the input to the third subsystem,  C:\Users\portman\Documents\Chapter 7_files\image275.gif . Here the updated output  C:\Users\portman\Documents\Chapter 7_files\image276.gif  drives the final second order subsystem  C:\Users\portman\Documents\Chapter 7_files\image277.gif  , which then produces the updated

C:\Users\portman\Documents\Chapter 7_files\image278.jpg

 

Figure 7.11. Synthesis of 14th-order bandpass filter as 7 second-order filters in series.

output  C:\Users\portman\Documents\Chapter 7_files\image279.gif . To provide the overall filter output estimate  C:\Users\portman\Documents\Chapter 7_files\image280.gif  at the integer frame time  C:\Users\portman\Documents\Chapter 7_files\image281.gif  we simply average  C:\Users\portman\Documents\Chapter 7_files\image279.gif  and  C:\Users\portman\Documents\Chapter 7_files\image282.gif  (from the previous frame). Thus

 

(7.77)    C:\Users\portman\Documents\Chapter 7_files\image283.jpg

 

We have already seen from Eq. (7.56) that the transfer function represented by the averager of Eq. (7.77) exhibits zero phase error and has a gain error given approximately by  C:\Users\portman\Documents\Chapter 7_files\image284.gif .

 

We are now in a position to estimate the overall transfer function gain and phase errors in simulating the 14th-order filter. Eqs. (7.75) and (7.76) give the gain and phase errors for each of the three pairs of second-order systems. Eq. (7.72) gives the gain and phase error for the single second-order system. Finally, Eq. (7.56) gives the gain error in the calculation of  C:\Users\portman\Documents\Chapter 7_files\image280.gif  at the integer frame time  C:\Users\portman\Documents\Chapter 7_files\image281.gif  from  C:\Users\portman\Documents\Chapter 7_files\image279.gif  and  C:\Users\portman\Documents\Chapter 7_files\image282.gif .  As noted earlier, to order  C:\Users\portman\Documents\Chapter 7_files\image285.gif  the overall gain and phase errors are the sum, respectively, of the individual gain and phase errors. In this way we obtain the following asymptotic formulas for the overall gain and phase errors for our modified Euler simulation of the 14th-order bandpass filter.

(7.78)    C:\Users\portman\Documents\Chapter 7_files\image286.jpg

 

As a specific example we consider the 14th-order Chebychev bandpass filter with the undamped natural frequencies and damping ratios given in Table 7.5 for the individual second-order systems. The frequencies have been normalized so that the center frequency of the overall filter is unity. Figure (7.12) shows the frequency response of the filter.

 

Table 7.5

Undamped Natural Frequencies and Damping Ratios for Second-order Subsystems in a 14th-order Chebychev Bandpass Filter

C:\Users\portman\Documents\Chapter 7_files\image287.jpg

From Eq. (7.78) it is apparent that the gain error in simulating the filter is independent of the filter parameters and depends only on  C:\Users\portman\Documents\Chapter 7_files\image288.gif , i.e., the input frequency times the step size. If we substitute the damping ratio values of Table 7.5 into Eq. (7.79), the resulting phase shift error becomes

C:\Users\portman\Documents\Chapter 7_files\image289.jpg

Figure 7.12. Frequency response of 14th-order Chebychev bandpass filter.

 

C:\Users\portman\Documents\Chapter 7_files\image290.jpg

Figure 7.13. Gain and phase errors for modified-Euler simulation of 14th-order Chebychev bandpass filter. Integration step size h = 0.5.

 

C:\Users\portman\Documents\Chapter 7_files\image291.gif .  For input frequencies  C:\Users\portman\Documents\Chapter 7_files\image292.gif  this corresponds to a phase error of approximately  C:\Users\portman\Documents\Chapter 7_files\image293.gif radians. The gain error from Eq. (7.79) for  C:\Users\portman\Documents\Chapter 7_files\image292.gif  is approximately  C:\Users\portman\Documents\Chapter 7_files\image294.gif . As a specific example, consider a step-size  C:\Users\portman\Documents\Chapter 7_files\image295.gif , which corresponds to 2 integration steps per radian or 12.57 steps per cycle of the center bandpass frequency of the filter. For this relative-ly large integration step the plots in Figure 7.13 show that the average gain error is about 0.4 db and the average phase error is about – 0.7 degrees over the bandpass of the filter.

 

The actual difference equations which are solved each integration step are summarized below, where half-integer indices are used when the state variables are interpreted as representing half-integer samples.

C:\Users\portman\Documents\Chapter 7_files\image296.jpg

(7.79)

 

where

C:\Users\portman\Documents\Chapter 7_files\image297.jpg

(7.80)

 

If, in addition to using the updated value,  C:\Users\portman\Documents\Chapter 7_files\image276.gif , to drive the seventh equation in (7.80), we also use the updated values  C:\Users\portman\Documents\Chapter 7_files\image266.gif  and  C:\Users\portman\Documents\Chapter 7_files\image274.gif  to drive the third and fifth equations, respectively, then the final output from Eq. (7.80) will be  C:\Users\portman\Documents\Chapter 7_files\image298.gif . This represents an additional lead time of 2h in the computed filter output at the end of the kth integration frame. This lead could be potentially useful for the compensation of interface delays in a real-time simulation. Our algorithm in this case is taking advantage of the basic lags associated with the bandpass filter to produce a lead time in the computed filter response.

 

7.12 Compensation of Second-order Errors in Modified Euler Integration

Eqs. (7.49), (7.72) and (7.78) all show that modified Euler integration, when used with root matching, produces transfer-function gain errors proportional to  C:\Users\portman\Documents\Chapter 7_files\image299.gif  and phase errors proportional to  C:\Users\portman\Documents\Chapter 7_files\image169.gif . These errors can be cancelled by adding appropriate terms to the output of the digital simulation. For example, consider an output term  C:\Users\portman\Documents\Chapter 7_files\image300.gif  given by the equation

(7.81)    C:\Users\portman\Documents\Chapter 7_files\image301.jpg

 

where the velocity state variable Y is related to the displacement state variable X by Eq. (7.8). Thus

(7.82)    C:\Users\portman\Documents\Chapter 7_files\image302.jpg

 

Then Eq. (7.81) can be rewritten in terms of  C:\Users\portman\Documents\Chapter 7_files\image303.gif  with the following formula:

(7.83)    C:\Users\portman\Documents\Chapter 7_files\image304.jpg

 

Here we recognize that  C:\Users\portman\Documents\Chapter 7_files\image300.gif  is proportional to the central difference approximation for the second time derivative of X. Taking the Z transform of Eq. (7.83) and solving for the transfer function which relates  C:\Users\portman\Documents\Chapter 7_files\image305.gif  to X*, we obtain

(7.84)    C:\Users\portman\Documents\Chapter 7_files\image306.jpg

 

Here  C:\Users\portman\Documents\Chapter 7_files\image307.gif  represents a transfer function proportional to  C:\Users\portman\Documents\Chapter 7_files\image308.gif  for  C:\Users\portman\Documents\Chapter 7_files\image309.gif . This is not surprising, since  C:\Users\portman\Documents\Chapter 7_files\image310.gif  is proportional to the second time derivative of X which, for sinusoidal inputs, is in turn proportional to  C:\Users\portman\Documents\Chapter 7_files\image311.gif .

 

We next consider an output term  C:\Users\portman\Documents\Chapter 7_files\image312.gif  given by the equation

(7.85)    C:\Users\portman\Documents\Chapter 7_files\image313.jpg

 

Taking the Z transform and solving for the transfer function that relates  C:\Users\portman\Documents\Chapter 7_files\image314.gif  to  C:\Users\portman\Documents\Chapter 7_files\image315.gif , we obtain

(7.86)    C:\Users\portman\Documents\Chapter 7_files\image316.jpg

 

Here  C:\Users\portman\Documents\Chapter 7_files\image317.gif  represents a transfer function proportional to  C:\Users\portman\Documents\Chapter 7_files\image318.gif  for  C:\Users\portman\Documents\Chapter 7_files\image309.gif . Again this is to be expected, since  C:\Users\portman\Documents\Chapter 7_files\image319.gif  in Eq. (7.85) is proportional to Y, the time derivative of X, which in turn is proportional to C:\Users\portman\Documents\Chapter 7_files\image320.gif .

 

To illustrate the use of  C:\Users\portman\Documents\Chapter 7_files\image310.gif  and  C:\Users\portman\Documents\Chapter 7_files\image319.gif , as defined above, to cancel the modified-Euler transfer function errors of order h2, we consider the case of modified Euler integration with root matching applied to a second-order linear system. From Eq. (7.49) the asymptotic formula for the transfer function ratio is given by

(7.87)    C:\Users\portman\Documents\Chapter 7_files\image321.jpg

 

We now define a new output variable  C:\Users\portman\Documents\Chapter 7_files\image322.gif  given by

(7.88)    C:\Users\portman\Documents\Chapter 7_files\image323.jpg

 

Taking the Z transform of Eq. (7.88) and solving for C:\Users\portman\Documents\Chapter 7_files\image324.gif , we obtain from Eqs. (7.84) and (7.86) the following asymptotic formula:

 

C:\Users\portman\Documents\Chapter 7_files\image325.jpg

(7.89)

 

The transfer function ratio  C:\Users\portman\Documents\Chapter 7_files\image326.gif  for the new output  C:\Users\portman\Documents\Chapter 7_files\image322.gif  is given by the product of Eqs. (7.87) and (7.89). Thus

(7.90)    C:\Users\portman\Documents\Chapter 7_files\image327.jpg

 

Here the transfer function gain and phase errors of order  C:\Users\portman\Documents\Chapter 7_files\image328.gif  result from the terms of order  C:\Users\portman\Documents\Chapter 7_files\image328.gif  which were neglected in Eqs. (7.49) for  C:\Users\portman\Documents\Chapter 7_files\image245.gif  and  C:\Users\portman\Documents\Chapter 7_files\image246.gif  as well as the terms of order  C:\Users\portman\Documents\Chapter 7_files\image328.gif  when Eqs. (7.84) and (7.86) are substituted into Eq. (7.89). When the terms of order  C:\Users\portman\Documents\Chapter 7_files\image328.gif  are taken into account, we obtain the following formulas for the gain and phase errors in the transfer function  C:\Users\portman\Documents\Chapter 7_files\image329.gif  for the second-order system simulated using modified-Euler integration with quadratic compensation:

(7.91)    C:\Users\portman\Documents\Chapter 7_files\image330.jpg

(7.92)    C:\Users\portman\Documents\Chapter 7_files\image331.jpg

 

For  C:\Users\portman\Documents\Chapter 7_files\image332.gif  Figure 7.14 shows plots of the exact gain and phase error versus frequency for  C:\Users\portman\Documents\Chapter 7_files\image333.gif  and 1.0. The results, even for  C:\Users\portman\Documents\Chapter 7_files\image334.gif , agree quite closely with the approximate errors given above in Eqs. (7.91) and (7.92). Note that for  C:\Users\portman\Documents\Chapter 7_files\image334.gif  the gain and phase errors are less than those given by Eq. (7.49) for  C:\Users\portman\Documents\Chapter 7_files\image333.gif  when modified Euler integration with root matching but without quadratic compensation is used. Note also that both the gain and phase errors in Figure 7.14 are reduced by a factor of 16 when the step size is halved to  C:\Users\portman\Documents\Chapter 7_files\image333.gif . This demonstrates that the quadratic compensation does indeed change the modified Euler method to a fourth-order algorithm.

 

It should be noted that the use of Eq. (7.81) or (7.83) for  C:\Users\portman\Documents\Chapter 7_files\image300.gif  and (7.85) for  C:\Users\portman\Documents\Chapter 7_files\image312.gif  requires values  C:\Users\portman\Documents\Chapter 7_files\image335.gif  or  C:\Users\portman\Documents\Chapter 7_files\image282.gif  at the end of the kth integration frame in order to compute  C:\Users\portman\Documents\Chapter 7_files\image336.gif  at the beginning of the kth frame using Eq. (7.88). This means that the compensated output  C:\Users\portman\Documents\Chapter 7_files\image336.gif  will be delayed with respect to real time by one integration step in the simulation of a second-order system. As we shall see in the next paragraph, the quadratic compensation scheme described here can be used to provide real-time outputs in simulating linear systems of order four or higher. Calculation of the compensated output  C:\Users\portman\Documents\Chapter 7_files\image322.gif  using Eqs. (7.81), (7.85) and (7.88) only requires two more multiplications and four more additions each integration frame, since the coefficients of  C:\Users\portman\Documents\Chapter 7_files\image300.gif  and  C:\Users\portman\Documents\Chapter 7_files\image312.gif  in Eq. (7.88) are fixed constants that can be precomputed.

 

We consider next the use of quadratic compensation in the modified Euler simulation of the 14th-order bandpass filter described in Section 7.11. The gain and phase errors of order  C:\Users\portman\Documents\Chapter 7_files\image285.gif  for the transfer function are given in Eq. (7.78). Here we will use the state variable Y6 in Figure 7.11 to provide the compensation. Thus we define  C:\Users\portman\Documents\Chapter 7_files\image337.gif  and  C:\Users\portman\Documents\Chapter 7_files\image338.gif  with the following formulas:

(7.93)    C:\Users\portman\Documents\Chapter 7_files\image339.jpg

 

With the procedures used earlier in deriving Eqs. (7.84) and (7.86) the following formulas are obtained

C:\Users\portman\Documents\Chapter 7_files\image340.jpg

Figure 7.14. Gain and phase errors in simulating a second-order system using modified-Euler integration with quadratic compensation; C:\Users\portman\Documents\Chapter 7_files\image341.gif .

 

for the incremental transfer functions  C:\Users\portman\Documents\Chapter 7_files\image342.gif  and  C:\Users\portman\Documents\Chapter 7_files\image343.gif :

 

(7.94)    C:\Users\portman\Documents\Chapter 7_files\image344.jpg

(7.95)    C:\Users\portman\Documents\Chapter 7_files\image345.jpg

 

Comparison with Eq. (7.78) shows that the overall transfer function gain and phase errors of order h2 in the simulation of the bandpass filter can be cancelled by letting  C:\Users\portman\Documents\Chapter 7_files\image346.gif  be the input to the last second-order subsystem in Figure 4, where  C:\Users\portman\Documents\Chapter 7_files\image346.gif  is given by

(7.96)    C:\Users\portman\Documents\Chapter 7_files\image347.jpg

 

Thus  C:\Users\portman\Documents\Chapter 7_files\image276.gif  in the next to last equation in (7.80) is replaced by  C:\Users\portman\Documents\Chapter 7_files\image346.gif . From Eqs. (7.94) and (7.97) we see that the calculation of  C:\Users\portman\Documents\Chapter 7_files\image346.gif  utilizes  C:\Users\portman\Documents\Chapter 7_files\image348.gif  and  C:\Users\portman\Documents\Chapter 7_files\image349.gif . To obtain  C:\Users\portman\Documents\Chapter 7_files\image350.gif  in the kth integration frame will require another one-frame advance in Eq. (7.79). This can be achieved by letting  C:\Users\portman\Documents\Chapter 7_files\image274.gif  rather than  C:\Users\portman\Documents\Chapter 7_files\image273.gif  be the input to the fifth equation in (7.79). The modified-Euler simulation with quadratic compensation will now exhibit transfer-function gain and phase errors proportional to h4.  For the specific bandpass filter considered earlier, Figure 7.15 shows a plot of the errors for h = 0.5. Comparison with Figure 7.13 shows that we have reduced the gain and phase errors by factors of approximately 25 and 50, respectively. Because of the dependence on h4 this means the errors will increase by a factor of 16 if we double the step size to h = 1. Even then the errors will be significantly less than those obtained earlier for h = 0.5 when quadratic compensation was not used.

C:\Users\portman\Documents\Chapter 7_files\image351.jpg

Figure 7.15. Gain and phase errors for simulation of 14th-order bandpass filter using modified-Euler integration with quadratic compensation. Step – size = 0.5.

 

The quadratic compensation of Eqs. (7.93) and (7.96) adds only 3 multiplications and 5 additions to the overall computation, which now takes a total of 29 multiplications and 29 additions per integration step. This is far less than the required number of multiplications and additions for any other fourth-order method when applied to this 14th-order filter problem.

 

7.13 The Use of Input Averaging with Modified Euler Integration

In Chapter 5, Section 5.11, we introduced the concept of multi-rate sampling and averaging of a continuous input to a real-time simulation. It was pointed out that this procedure can be used to reduce the “aliasing” effect, i.e., the conversion of input frequencies above one-half the frame rate to frequencies below one-half the frame rate. As the number of samples N per frame approaches infinity, we observed in Eq. (5.83) that the averager transfer function,  C:\Users\portman\Documents\Chapter 7_files\image352.gif , is given by

(7.97)    C:\Users\portman\Documents\Chapter 7_files\image353.jpg

 

It was also noted in Section 5.11 that the average of N input samples of f(t) over the kth frame, i.e., from  C:\Users\portman\Documents\Chapter 7_files\image354.gif  to  C:\Users\portman\Documents\Chapter 7_files\image355.gif  can be considered equivalent to a sample-data point at the midpoint of the frame, denoted by  C:\Users\portman\Documents\Chapter 7_files\image356.gif . For the state equation  C:\Users\portman\Documents\Chapter 7_files\image357.gif  this data point can then be used as the input to the modified Euler integration algorithm

(7.98)    C:\Users\portman\Documents\Chapter 7_files\image358.jpg

 

If the modified-Euler integrator transfer function  C:\Users\portman\Documents\Chapter 7_files\image359.gif  derived earlier in Eq. (7.5) is multiplied by  C:\Users\portman\Documents\Chapter 7_files\image352.gif  in Eq. (7.98), the resulting product,  C:\Users\portman\Documents\Chapter 7_files\image360.gif  is exactly  C:\Users\portman\Documents\Chapter 7_files\image361.gif , the ideal integrator transfer function. This is not surprising, since the average of f(t) is obtained by integrating f(t) over the kth frame and dividing the result by h. When the average is then multiplied by h, as in Eq. (7.99), the result is indeed the exact integral of f(t) over the kth frame.

 

It is useful to examine the accuracy improvement which results when input averaging is utilized in an actual simulation. For example, consider again the second order system given by Eq. (7.6) when subjected to the acceleration-limited step input U(t) of Eq. (7.29). When input averaging is applied to U(t), the resulting errors in simulated output using various modified Euler methods are shown in Figure 7.16. Comparison with the previous results without input averaging, as shown earlier in Figure 7.6, demonstrates that the use of input averaging has indeed reduced the output error. Of course, it has not eliminated the error, since the ideal integrator behavior associated with input averaging applies only to the input term U(t) on the right side of the equation for  C:\Users\portman\Documents\Chapter 7_files\image362.gif  in (7.6). As noted above, however, the input averaging will reduce significantly the errors caused by sampling any frequencies above one-half the frame rate 1/h which may be present in U(t).

 

The accuracy improvement obtained using input averaging becomes much greater in the case of inputs with discontinuities. To illustrate this, we consider a simulation of the unit step response of a Butterworth low-pass filter.*  The transfer function gain of a Butterworth filter of order

* Oppenheim, A.V., and R.V. Schafer, Digital Signal Processing, Prentiss-Hall, Englewood Cliffs, New Jersey, 1975.

7-35

 

C:\Users\portman\Documents\Chapter 7_files\image363.jpg

Figure 7.16. Acceleration-limited step response errors for modified-Euler methods when using input averaging; C:\Users\portman\Documents\Chapter 7_files\image364.gif .

 

n with a cutoff frequency of  C:\Users\portman\Documents\Chapter 7_files\image365.gif  is given by the formula

C:\Users\portman\Documents\Chapter 7_files\image366.jpg

 

(7.99)

 

The gain characteristic exhibited by Eq. (7.99) represents the sharpest cutoff achievable by a low-pass filter of order n without any rise in filter gain above its zero-frequency value of unity. For a 6th-order Butterworth filter (n = 6) Figure 7.17 shows the transfer function gain  C:\Users\portman\Documents\Chapter 7_files\image367.gif  versus frequency  C:\Users\portman\Documents\Chapter 7_files\image368.gif .

 

It can be shown that the n characteristic roots of the Butterworth filter are distributed with equal polar angle separation on the unit half-circle in the left s plane. For example, if n = 6, the characteristic roots (i.e., transfer function poles) are given by  C:\Users\portman\Documents\Chapter 7_files\image369.gifC:\Users\portman\Documents\Chapter 7_files\image370.gif  and  C:\Users\portman\Documents\Chapter 7_files\image371.gif . The corresponding damping ratios of the three root pairs are equal to  C:\Users\portman\Documents\Chapter 7_files\image372.gifC:\Users\portman\Documents\Chapter 7_files\image373.gif and  C:\Users\portman\Documents\Chapter 7_files\image374.gif . Thus

C:\Users\portman\Documents\Chapter 7_files\image375.jpg

 

The transfer function of the 6th-order filter is then given by

C:\Users\portman\Documents\Chapter 7_files\image376.jpg

Figure 7.17. Frequency response of 6t-order Butterworth filter.

 

(7.100)  C:\Users\portman\Documents\Chapter 7_files\image377.jpg

 

Each of the three second-order transfer functions represented in Eq. (7.100) can be simulated using the modified-Euler method with root matching, as given by Eq. (7.44), This results in the following difference equations:

(7.101)  C:\Users\portman\Documents\Chapter 7_files\image378.jpg

 

where the coefficients D and E are given by Eqs. (7.45) and (7.46). Note in (7.101) that we have used the updated output of the first 2nd-order subsystem,  C:\Users\portman\Documents\Chapter 7_files\image379.gif , as the input to the second subsystem, and the updated output of the second subsystem,  C:\Users\portman\Documents\Chapter 7_files\image380.gif , as the input to the third subsystem. In this way the final filter output, X = X3, at the end of the kth integration frame, is actually  C:\Users\portman\Documents\Chapter 7_files\image381.gif  rather than  C:\Users\portman\Documents\Chapter 7_files\image382.gif . In a real-time simulation this means that the output is available two frames ahead of its occurrence in real time. On the other hand, when we replace the input  C:\Users\portman\Documents\Chapter 7_files\image383.gif  by  C:\Users\portman\Documents\Chapter 7_files\image384.gif , its average over the interval from  C:\Users\portman\Documents\Chapter 7_files\image385.gif  to  C:\Users\portman\Documents\Chapter 7_files\image386.gif , we cannot begin the computation for the kth frame until  C:\Users\portman\Documents\Chapter 7_files\image386.gif . In this case the output  C:\Users\portman\Documents\Chapter 7_files\image381.gif  will become available at  C:\Users\portman\Documents\Chapter 7_files\image387.gif , not  C:\Users\portman\Documents\Chapter 7_files\image355.gif . Furthermore, if we apply the quadratic compensation described in Section 7.12 using central-difference formulas, we will need the outputs one frame ahead of when they would occur in real time in order to produce a compensated real-time output. Thus input averaging and quadratic compensation will use up one and a half frames of the two-frame lead we have realized in the mechanization of Eq. (7.101).

 

When using the modified Euler method with root matching, Eq. (7.49) gives the approximate transfer function gain and phases errors for each of the second-order subsystem simulations. It follows that the approximate gain and phase errors for the overall simulation will simply be the sum of the individual errors. Thus

(7.102)  C:\Users\portman\Documents\Chapter 7_files\image388.jpg

 

where  C:\Users\portman\Documents\Chapter 7_files\image389.gif  in our example here. To cancel these second-order terms we use Eqs. (7.81) and (7.85) for  C:\Users\portman\Documents\Chapter 7_files\image390.gif  and  C:\Users\portman\Documents\Chapter 7_files\image391.gif , with  C:\Users\portman\Documents\Chapter 7_files\image392.gif  and  C:\Users\portman\Documents\Chapter 7_files\image393.gif  replaced by  C:\Users\portman\Documents\Chapter 7_files\image394.gif  and  C:\Users\portman\Documents\Chapter 7_files\image395.gif , respectively. From Eqs. (7.84) and (7.86) it then becomes apparent that the compensated output variable,  C:\Users\portman\Documents\Chapter 7_files\image396.gif , is given by the formula

(7.103)  C:\Users\portman\Documents\Chapter 7_files\image397.jpg

 

with  C:\Users\portman\Documents\Chapter 7_files\image398.gif  again equal to 1 on our example. We note that Eq. (7.103) can be rewritten as

(7.104)  C:\Users\portman\Documents\Chapter 7_files\image399.jpg

Since the coefficients of  C:\Users\portman\Documents\Chapter 7_files\image394.gif  and  C:\Users\portman\Documents\Chapter 7_files\image395.gif  can be precomputed, it is apparent that the quadratic compensation only requires 2 multiplies and 2 adds per integration frame.

 

The quadratic compensation given by Eq. (7.104) is based on using the direct input data point  C:\Users\portman\Documents\Chapter 7_files\image383.gif  for the kth integration frame in Eq. (7.101). If we use the input averaging described in Section 5.11, where we replace  C:\Users\portman\Documents\Chapter 7_files\image383.gif  by its average over the time frame centered about kh, namely,  C:\Users\portman\Documents\Chapter 7_files\image384.gif , Eq. (7.97) shows that an additional gain error equal to  C:\Users\portman\Documents\Chapter 7_files\image400.gif  will be introduced for  C:\Users\portman\Documents\Chapter 7_files\image401.gif . When this is added to the gain error of  C:\Users\portman\Documents\Chapter 7_files\image402.gif  in Eq. (7.102), the overall gain error in simulating the filter becomes approximately  C:\Users\portman\Documents\Chapter 7_files\image403.gif  . Under these conditions the quadratic compensation formula of Eq. (7.104), when input averaging is also used, becomes

(7.105)  C:\Users\portman\Documents\Chapter 7_files\image404.jpg

 

We now consider simulation of the 6th-order Butterworth filter response to a unit step input using Modified Euler integration with root matching. In Figure 7.18 the exact response to an ideal step input occurring at t = 0 is shown. Figure 7.19 shows the simulation error with and without quadratic compensation. In both cases the integration step size h = 0.2 and input averaging is employed, i.e.,  C:\Users\portman\Documents\Chapter 7_files\image383.gif  in Eq. (7.101) is replaced by  C:\Users\portman\Documents\Chapter 7_files\image384.gif For the unit step input at t = 0 this means that  C:\Users\portman\Documents\Chapter 7_files\image405.gif  is equal to 0.5, the average value of the input from –h/2 to h/2. The input  C:\Users\portman\Documents\Chapter 7_files\image384.gif  for subsequent frames, where  C:\Users\portman\Documents\Chapter 7_files\image406.gif  is equal to 1. When quadratic compensation is used in accordance with Eq. (7.106) to calculate the final filter output  C:\Users\portman\Documents\Chapter 7_files\image407.gif , it is apparent in Figure 7.19 that the simulation error is reduced very substantially.

 

C:\Users\portman\Documents\Chapter 7_files\image408.jpg

Figure 7.18. Exact 6th-order Butterworth filter response to a unit-step input.

 

C:\Users\portman\Documents\Chapter 7_files\image409.jpg

Figure 7.19. Unit step response errors of 6th-order Butterworth filter simulation using modified-Euler integration with root matching, input averaging; h = 0.2

.

Although the quadratic compensation has cancelled the transfer function errors to order h2 in Eqs. (7.97) and (7.102), it should be noted that the time domain errors in the compensated output are still of order h2. This is because the error formulas are only valid for  C:\Users\portman\Documents\Chapter 7_files\image401.gif . The unit step input, which has a Fourier transform given by  C:\Users\portman\Documents\Chapter 7_files\image361.gif , is non-zero for all finite frequencies  C:\Users\portman\Documents\Chapter 7_files\image368.gif ,  including those for which  C:\Users\portman\Documents\Chapter 7_files\image410.gif . Figure 7.20, which shows the compensated output errors versus time for step sizes h equal to 0.2 and 0.4, clearly demonstrates the error dependence on h2.

 

C:\Users\portman\Documents\Chapter 7_files\image411.jpg

Figure 7.20. Unit step response errors of 6th-order Butterworth filter simulation using modified-Euler simulation with root matching and quadratic compensation.

 

In the results shown in Figures 7.19 and 7.20 the modified Euler simulation with root matching employed input averaging. When input averaging is not used, the unit step response errors generally become much larger and are dependent on the time at which the unit step is applied. Only for the case where a step input is applied exactly half-way through the k -1 integration frame will the input sample  C:\Users\portman\Documents\Chapter 7_files\image383.gif  at the end of the frame equal the average input value over the interval from  C:\Users\portman\Documents\Chapter 7_files\image412.gif  to  C:\Users\portman\Documents\Chapter 7_files\image386.gif  . The advantage of using modified-Euler integration with input averaging for step-function inputs is discussed further in Chapter 11.

 

The very high accuracy attainable using modified Euler integration with root matching and quadratic compensation suggests that we can consider simulation of the 6th-order Butterworth filter using quite a large step size, accompanied by interpolation to produce an accurate multi-rate output. For example, consider the following formula for quadratic interpolation over the time interval ah using output data points  C:\Users\portman\Documents\Chapter 7_files\image413.gif  and C:\Users\portman\Documents\Chapter 7_files\image414.gif :

C:\Users\portman\Documents\Chapter 7_files\image415.jpg

or

(7.106)  C:\Users\portman\Documents\Chapter 7_files\image416.jpg

 

Implementation of Eq. (7.106) requires only two multiplies and two adds per interpolation, since the coefficients for each of the required interpolation intervals can be precomputed. As a specific example, we consider the simulation of the sixth-order Butterworth filter using modified Euler integration with root matching, quadratic compensation, and input averaging when the input is again a unit step at t = 0 . We let the integration step size h = 1 and employ interpolation to produce an output data sequence at five times the integration frame rate. In this case the dimensionless extrapolation interval a in Eq. (7.106) takes on the values 0, 0.2, 0.4, 0.6, and 0.8. The resulting simulation is shown in Figure 7.21. Despite the very large step size  C:\Users\portman\Documents\Chapter 7_files\image417.gif  since  C:\Users\portman\Documents\Chapter 7_files\image418.gif , the solution, including the multi-rate data sequence obtained by interpolation, is quite close to the result that would be obtained when using an integration step size h = 0.2. The actual error of both the main data sequence output with h = 1 and the interpolated data points is shown in Figure 7.22. The peak error is approximately 1 percent, with the root mean square error much smaller than this.

 

C:\Users\portman\Documents\Chapter 7_files\image419.jpg

Figure 7.21. Filter step response using modified-Euler integration, root matching and quadratic compensation, h = 1; multi-rate output using quadratic interpolation.

 

In the interpolation formula of Ect (7.106) it is apparent that the interpolated output over the kth integration frame,  C:\Users\portman\Documents\Chapter 7_files\image420.gif  , requires  C:\Users\portman\Documents\Chapter 7_files\image414.gif , the compensated output at the end of the frame. In a real-time simulation this means that a one-frame lead in the computed output  C:\Users\portman\Documents\Chapter 7_files\image396.gif  is required. When this is added to the half-frame lead necessary to accommodate input averaging and the one-

C:\Users\portman\Documents\Chapter 7_files\image421.jpg

Figure 7.22. Error in multi-rate output illustrated in Figure 7.21.

 

frame lead required to mechanize the quadratic compensation formula of Eq. (7.105), the total required time advance to produce the real-time multi-rate output becomes two and one-half frames. We have seen that the difference equations represented by (7.101) only provide a two-frame lead. Thus the multi-rate example considered here falls one-half frame short of being able to produce a real-time output. We do note from Eq. (7.101) that an additional one-frame lead can be realized if the order of the Butterworth filter is raised from six to eight. Also, a real-time multi-rate output may not be necessary in many simulations, in which case the method illustrated here can save a great deal of computing time.

 

7.14 Summary of Modified-Euler Integration Results

In this chapter we have seen how a simple version of modified Euler integration can be used to simulate linear second-order systems. For lightly-damped systems the method is especially effective, and it exhibits exactly zero damping when the system being simulated is undamped. Improvement in both accuracy and stability can be obtained by selecting the coefficients in the difference equation such that the characteristic roots of the digital simulation match exactly those of the continuous system. This is easily accomplished using simple analytic formulas. The resulting algorithm provides better accuracy than any conventional 2nd-order integration method and only requires the same number of adds and multiplies as standard Euler integration.

 

For the case where velocity rather than displacement represents the output of the second-order system, the modified Euler method yields 2nd-order accuracy if the output velocity is interpreted as occurring at half-integer frame times. The algorithm can be used in simulating any order of linear system, although it is especially straightforward to use in the simulation of higher order systems that consist of second-order linear systems in series. In particular, we have shown how it can be used for very efficient simulation of high-order bandpass and lowpass filters. Modified Euler integration can also be used to simulate nonlinear systems by evaluating each nonlinear state-variable derivative halfway through the integration interval.

 

Finally, we have shown that it is straightforward to add quadratic compensation to the modified Euler algorithm such that the 2nd-order errors are canceled when simulating a linear system. This results in a 4th-order algorithm with respect to transfer function gain and phase errors. When used to simulate linear filters, the method then exhibits better accuracy than RK-4 integration and executes more than four times as fast.