example, IBM claims that difference equations derived by a new method that they have developed can be used to simu- late linear or nonlinear, continuous or sampled-data control systems (Ref. 24). They suggest that the accuracy of very high-speed difference equation techniques can surpass much of the analog simulation work.
10-4.2 DIGITAL SOLUTION OF TRANSFER FUNCTIONS
A transfer function corresponds to a linear differential equation with constant coefficients; therefore, any method of numerically integrating differential equations can be used to evaluate transfer functions. For example, the Runge-Kutta method often is used in simulations to solve transfer function equations. However, because of the linear, time-invariant properties of transfer functions, special tech- niques can be used for their solution, and in general, no exploitation of these properties is possible with the general numerical integration methods. A number of special tech- niques for digital solution of transfer functions have been developed. The more important of these methods are ascribed to Blum, Boxer-Thaler, Tustin, and Mad- wed-Truxal. The Tustin method of evaluating transfer func- tions is. one of the simplest to apply once a necessary set of constants has been determined and was judged “probably the best, overall” by one investigator (Ref. 14).
10-4.2.1 The Tustin Method
Digital simulation of continuous systems at discrete time intervals falls within the general class of sampled data sys- tems. A form of transformation calculus known as z-trans- form theory was developed specifically for treating sampled data systems (Ref. 25). The substitution method used to simulate transfer functions derives difference equa- tions by substituting a z-transform function for the s-1 in the Laplace transfer function of the system to be simulated and inverting the resulting z-domain transfer function, i.e., find- ing the inverse z-transformation, into a difference equation.
The well-known Tustin method is based on such a z-trans- form substitution. This method leads to relatively stable, although not necessarily highly accurate, difference equa- tions for simulating the transfer functions of continuous processes (Ref. 15).
The z-transform variable z is related to the Laplace trans- form variables by the identity
In nearly all practical applications, the inverse of z, i.e., e-sT is most useful; therefore, the operator A is defined as
The Tustin method employs z-transforms to define a recur- sion difference equation that is used to solve a transfer func- tion. In this method a transfer function G(s) is transformed to G(A) by making the substitution
The resulting function G (∆) is simplified to the form
The corresponding recursion equation
10-14
MIL-HDBK-1211(MI)
The recursion equation is used in a simulation at each com- putation step n to find the output y resulting from the input x.
Eq. 8-29.
As an example, consider the transfer function given in
To solve the transfer function of Eq. 8-29 by the Tustin method, the constants ai and bi in Eq. 10-33 must be deter- mined. First, substitute Eq. 10-31 into Eq. 8-29 and arrange the resulting equation in the form of Eq. 10-32, giving
By inspection of Eq. l0-34, the constants in Eq. 10-33 are determined to be
As an example, suppose that the time constant t is given as 0.5 s, and the simulation time step T has been chosen as 0.1 s. A common rule of thumb for applying numerical methods is that the computational time step should be no greater than about one-tenth the system time constant. Here we use a time step only one-fifth the time constant in order to evaluate the method under less than ideal conditions.
Evaluating Eqs. 10-35 and substituting into Eq. 10-33 yields
the Tustin recursion equation for evaluating the transfer function of Eq. 8-29 for given t and T
Fig. 10-2(A) shows the response of the transfer function to a step input command applied at time zero. Each plotted point was calculated in sequence using Eq. 10-36.
Figure 10-2. Response of First Order Trans- fer Function to Step Input Calculated by Tustin Method
10-15
Since the particular transfer function of Eq. 8-29 is a rela- tively simple one, it can be solved exactly by analytical methods when the input commands are simple. The exact solution can then be used as a reference for measuring the accuracy of numerical methods used to solve that particular transfer function. When the input is a unit step, the exact solution of the transfer function of Eq. 8-29 is given by
Comparison of the numerical solution with the exact solu- tion in Fig. 1O-2(A) shows excellent agreement. Even when the time step is increased to be equal to the system time con- stant-and this increase often produces extremely errone- ous results in numerical methods, the Tustin method performs remarkably well for this example as shown in Fig.
1O-2(B).
In any numerical method, the simulation developer must determine the actual timing of the sequence of solution val- ues in order to compare them with a true continuous-time check case. Engineers and programmers often overlook this problem of timing and try to compare continuous and dis- crete computing processes at time nT instead of recognizing that numerical integration is an approximation process (Ref.
15), and adjustments in the timing sequence may be neces- sary because of the discrete nature of the time samples.
For example, in the digital application of the unit step function, the unit step command is represented digitally by the sequence ..0,0,1,1,1, . . . . The step command clearly orig- inates during the interval of time between the last "0" and the first “l” but exactly where within that interval is uncer- tain. One reasonable assumption would be that the step orig- inates at the instant of time corresponding to the first “1”;
however, to obtain the results shown in Fig. 10-2 by using the Tustin method, an assumption is required that the step originated halfway between the last "0" and the first "1". In this case time t is calculated by
Refs. 14 and 15 contain discussions of zero-order and first-order hold functions designed to improve the timing representation of digital data that simulate continuous sys- tems and that are employed in hybrid simulations to convert digital data to analog signals.
10-4.2.2 Root-Matching Method
As discussed in subpar. 10-4.1.2, root-matching methods are employed to form a difference equation with the same dynamic characteristics as the differential equation that describes the continuous system being simulated. This objective is achieved by a difference equation that (Ref. 15) 1. Has poles and zeros that match those of the differ- ential equation
2. Has a final value that matches the final value of the differential equation
3. Is phase adjusted to best match the response of the discrete system with the response of the continuous system.
To develop a root-matching difference equation for a transfer function, follow the algorithm:
1. Determine the Laplace transform of the transfer function.
2. Map the s-plane poles and zeros into the z-plane by using the relationship
3. Form a transfer function polynomial in z with the poles and zeros determined in Step 2.
4. Determine the final values of the unit step response of the continuous system and the unit step response of the discrete system, and match the final values by introducing a constant in the transfer function generated in Step 3.
5. Add additional zeros to the transfer function of the discrete system until the order of the denominator of the dis- crete system matches the order of the numerator of the dis- crete system.
6. Inverse z-transform the z-transfer function devel- oped in Step 5 to form the simulating difference equation.
The root-matching method is applicable only when the conditions that follow are met. The system ‘must
1. Be linear
2. Possess a Laplace transformation
3. Be asymptotically stable and satisfy the final value theorem*, and the final value must be nonzero.
The difference equation generated in this manner is not only stable but accurate. That is, the solution to the homoge- neous difference equation exactly matches the homoge- neous solution to the differential equation, and the difference equation will exactly compute the sequence of sampled values of the homogeneous solution of the continu-
*FinaI Value Theorem (Ref. 10): If f(t) is z-transformable, Zf(t) = F(z), and if F(z) contains no poles on or outside the unit circle, then
10-16
ous process. It will also exactly compute the sequence of solutions of the continuous system to unit step forcing func- tions. It follows then that the difference equation can be used to simulate accurately the response of the continuous system to an arbitrary forcing function provided that the forcing function is sampled often enough to extract the highest frequency components that are important to the sim- ulation (Ref. 15).
Applying the previous steps to the fist-order transfer function of Eq. 8-29 leads to the root-matched difference equation
Fig. 10-3(A) compares the results of Eq. 10-39 for a unit step input to the exact results calculated by Eq. 10-37. The conditions are the same as those for Fig. 10-2(A). That is, the system time constant τ = 0.5 s, and the computational step size T = 0.1 s. The match is perfect; the root-matching method gives results identical to the exact solution. In fact, the match is perfect no matter how large the step size is; for example, Fig. 10-3(B) shows a perfect match when the step size is equal to the system time constant. Furthermore, no shift in the time scale is necessary for Fig. 10-3, i.e., time is Calculated as t = nT.
Another important example of the root-matching method is the solution of transfer functions for second-order sys- tems. The transfer function of a second-order system is given by
If the six steps outlined previously are followed, the root-matched difference equation for digital solution of the second-order transfer function is determined to be (Ref. 15)
Figure 10-3. Response of First-Order Transfer Function to Step Input Calculated by
Root-Matching Method
Since root-matched difference equations are stable-pro- vided the system they are simulating is stable-no matter what the step size, numerical-method stability consider- ations need not be considered in the selection of a step size for a simulation that employs the root-matching method.
The primary criterion that remains for selecting the step size is to ensure that the simulated system responds properly to the highest frequency of interest within the objectives of the simulation. Shannon’s theorem states that if a continuous function f(t) is band limited at wL Hz, i.e., has no frequency components higher than wL, the minimum sampling rate that completely determines the function f(t) is 2wL samples per second (Refs. 15 and 26). If the function is sampled at a rate l/T less than 2wL, a phenomenon called “aliasing”, Or
“frequency foldback”, occurs in which the high-frequency components of the continuous-function spectrum are erro- 10-17
neously folded back and appear, along with the low-fre- quency components, within the band O - 1/(2T) HZ of the discrete-function spectrum.
Since most functions encountered in simulations are not band limited, i.e., there are no bounds on the highest fre- quency they may contain, the minimum rate at which func- tions should be sampled is 5 to 10 times the highest frequency of interest (Ref. 15).
For example, in simulating a second-order system, it seems prudent to set the step size small enough to excite the resonant frequency of the system. The damped natural fre- quency of a second-order system is given by
Adopting the criterion that the sampling rate (near midpoint of range of minimum rates given in Ref. 15) must be at least seven times the highest frequency of interest, the step size T that should be selected for this application is
Fig. 10-4 shows the solution of a second-order transfer function for a step input. The plotted points were calculated by the root-matching method that employs Eq. 10-41, and
Figure 10-4. Response of Second-Order Transfer Function to Step Input Calculated by Root-Matching Method
(cont’d on next page)
10-18
Figure 10-4. (cont'd) the continuous curve was calculated by using the exact
equation for the response of a second-order system to a step command (Ref. 27). The example case shown is for a sec- ond-order system with an undamped natural frequency wn = 20 rad/s and a damping ratio = 0.5. In Fig. 10-4(A) the time step T= 0.02s; this gives a sampling rate of about 16 times the damped natural frequency. At this sampling rate the root-matching difference equation gives good results.
When the sampling rate is reduced to about six times the damped natural frequency, the aliasing effect begins to introduce errors as shown in Fig. 10-4(B). At a sampling rate of only three times the damped natural frequency, the aliasing error is pronounced, as shown in Fig. 10-4(C).
To obtain the match between the difference equation solutions and the exact solution, shown in Fig. 10-4, the time after initiation of the step input is calculated by t = nT assuming n = 0 at the instant the step is initiated