10 Frequency Analysis: Bode Plots and Transfer Function
Studying the behaviour of systems with respect to time is the primary approach for systems modelling and analysis. However, when a system behaves in a repetitive mode under some applied load and/or boundary conditions—a quasi-static mode—we are interested in the changes in terms of the inherently-involved frequencies of the system rather than the details of instantaneous variations with respect to time. Therefore, transforming the domain of analysis from time to frequency provides us with useful and important information about the behaviour of systems. For example, identifying characteristics of a system—such as its natural frequency, behaviour at large and small frequencies, and magnitude of certain quantities at specific frequencies—provides useful insights in terms of system analysis, design, and control.
In this section, we present a brief background of frequency analysis and methods with focus on Bode plot method and transfer function, with worked-out examples. However, this textbook does not present a full discussion of control theory and related methods for system analysis.
For further reading, consult with references cited in this chapter. 20-sim has tools for performing frequency analysis using BG models and for drawing Bode plots for systems. Through some examples, we will demonstrate how to use these tools.
Performing analysis in frequency domain requires a transformation from time domain to frequency domain. Having a mathematical model describing the behaviour of a system, we can use a transformer to convert the governing equations from time domain to frequency domain . Using applied engineering mathematics, we usually employ Laplace and/or Fourier transforms for such an operation. The Laplace transform (defined in complex -domain) is a more general case of Fourier’s transform (defined in -domain), as given below for transforming a function of time , , .
where and for these two transforms are comparable. Note that, in principle, but the real part, of complex variable , is not included here since we are interested in equilibrium at a steady state in frequency analysis. Application of these transforms greatly simplifies the solutions of system equations, both for ODEs and PDEs. The original functions in time domain can be calculated back using the inverse transforms of Laplace and Fourier, given as
In control theory for systems, several methods are used for studying system behaviour and design, including Bode and Nichols plots requiring frequency-domain response representation, root-locus method requiring complex-domain pole-zero representation, and polynomial-domain design requiring transfer-function representation , . A transfer function, by definition, is the ratio of the output signal (i.e., magnitude, power) of a system over selected input signal values. Among these methods, we focus on Bode plots for application in system design using BG models. Bode plots are used for linear systems or linearized non-linear systems. For more detail, see Reference Manual 20-sim 4.6. To access the manual, from the 20-sim Editor window, go to Help, and then select Manual (PDF).
10.3 Motivational Example: A Linear System
A linear system, or LTI (linear time invariant), is a system for which the linear combination of output of a set of inputs is equal to the sum of outputs resulting from each input, e.g., as shown in Figure 10‑1.
Considering a proportional integral (PI) controller (for which the output is equal to the input multiplied by a constant and added to the integral of the input), we provide a sinusoidal signal input with frequency of 0.5 rad/s (or ) given as 0.5. Assuming the constant multiplier to be 2, we get the output as ). From the output, we observe that the frequency remains the same as that of the input. Now, by multiplying to the output, we rewrite it as a single sinusoidal function, or:
Therefore, the input amplitude is magnified by a factor of , frequency remains the same as mentioned, and a phase change of is introduced to the output signal by the PI controller. But one can ask the question: what would be the controller response to a similar signal with a different frequency? For example, if we repeat the same calculation for an input signal given as , we get the response . To find the response to a spectrum of input frequencies, in principle we can repeat similar calculations and analyze the system behaviour. Table 10‑1 shows some typical response result for input signals of the form into a PI controller.
|Frequency (rad/s),||Response Amplitude||Response Phase (deg.)|
One can make graphs of the response amplitude and phase changes versus input frequency to study the behaviour of the PI controller used in this example.
10.4 Bode Plots and Cutoff Frequency
The results of the calculations mentioned in section 10.3 motivate us to look for a more general and practical method of frequency analysis of systems. The calculations presented are laborious, although new computer tools, e.g., Excel or even computer coding can speed up the process. However, Hendrik Wade Bode, working at Bell Labs in the 1930s, suggested a more practical and now commonly used graphical method—Bode plots, , , , . This method has a wide range of applications in system dynamics, control, and design. An important outcome of having Bode plots for a system is a quick visual insight into the system’s dynamical behaviour for a wide range of frequencies.
In this section, we present the basic idea and some formulas related to Bode plots and what they intend to represent when applied to a system.
Following the example presented in section 10.3, we assume, without losing generality, to have an input sinusoidal signal to the PI controller with frequency given as . The output is, then, with amplitude and phase . The relations for the output amplitude and phase angle depend on the PI controller specifications. For our example having a proportionality factor of two and an integration, using similar manipulations as those given in section 10.3, we find and . Now, after transforming the input and output signals to the Laplace -domain, using Laplace transform (see Equation (10.1)), we get and . The transfer function (also referred to as gain function) is defined as the ratio of the output amplitude over input amplitude. For our examples, we get, after some simplifications, . Having the transfer function, we can substitute , to transform from -domain to -domain, guided by Equation (10.1). Therefore, , or the transfer function in frequency domain. This is a function of a complex variable and can be written, in general, as its real and imaginary parts or . Therefore, after some manipulations, we get . This gives the real part and imaginary part . Therefore, the magnitude of the transfer function is . The relations for transfer function including its magnitude and phase are summarized in Equation (10.3).
A set of plots consisting of magnitude and versus logarithm (at base 10) of is called Bode plots. However, magnitude is traditionally measured in decibel (dB), phase angle in degrees, and frequency as logarithm of frequency in rad/s (or in Hz).
Recall that dB (one tenth of a bel) is a unit for measuring the power of a signal with reference to a threshold. For example, the threshold for human hearing is , given as power intensity; dB is measured in logarithm of the power ratios at base ten, or . But since power of a wave signal is proportional to its amplitude squared, then we get , or
Therefore, Bode plots are composed of two charts: signal gain in dB and phase in degrees versus logarithm of , usually given in a single graph chart. The graphs in Figure 10‑4 show the Bode plots for the PI controller, generated using 20-sim. The tools available for drawing Bode plots in 20-sim can also be used when a transfer function is available or calculated and also after a BG model is built for systems. For this example, we calculated the transfer function and used it to draw the corresponding Bode plots. For drawing the corresponding Bode plots, follow these steps:
- From the Editor window, go to Tools, select Frequency Domain Toolbox, and then select Linear System Editor. The 20-sim Linear System Editor window opens, as shown in Figure 10‑2.
- Select Transfer Function and click on the Edit A window opens in which you can enter the coefficients of the transfer function, as shown in Figure 10‑3.
- Enter the desired transfer function as a polynomial fraction with numerator and denominator polynomials with their corresponding coefficients in descending power of . For this example, having the coefficients for the numerator polynomial are (2, 1) and for the denominator polynomial are (1, 0). Note the zero term, i.e., the coefficient for the term , or the constant term. A space can be used instead of a comma, to separate the coefficients.
- Click on Apply and then OK This takes you back to the Linear System Editor window with the transfer function listed. Double check the resulted transfer function to make sure it is entered correctly into 20-sim.
- From the 20-sim System Editor window (see Figure 10‑2) under Plots, select Bode. The Bode Plot window opens with the corresponding Bode plots, as shown in Figure 10‑4. From these plots, we can conclude that the PI controller is a high-pass filter system because it passes through the high frequency signals but attenuates low frequency signals. The gain for low frequency signals decreases linearly with a slope of 20 dB per decade from 40 dB. The phase change is from close to at low frequencies to null at high frequencies. Therefore, the PI controller is in phase with the input signals at high frequencies and out of phase, by about , at low frequencies.
- The asymptotes to the high frequency and low frequency gains intersect at a point defined as the cutoff frequency, (also referred to as corner or break frequency). This frequency is defined when the output power reaches to 50% of the input signal power (so-called half-power point), or .
The 3dB-point is the standard method of finding cut off frequency from the Bode plot gain chart. For this example, the asymptote to the high frequency gain (i.e., the horizontal line as the frequency ) is at about 6.02 dB. Hence, the cutoff frequency corresponds to the point at 6.02+3=9.02 dB, or using Equation (10.4). This gives the cutoff frequency of rad/s, using . At the cutoff frequency the phase reads deg, using , after conversion.
By following the steps presented in the following section, we can also draw Bode plots using 20-sim when a BG model of a system is available.
10.4.1 Guideline for Drawing Bode Plots for BG Models
After using 20-sim to build a BG model, to draw related Bode plots, click on Tools and select the options in the Frequency Domain Toolbox to draw related Bode plots. We can draw Bode plots using transfer function, either manually or using computer graphing tools. The following steps can be used for drawing Bode plots, by either (A) using 20-sim software tool or (B) manually:
- Drawing Bode plots using 20-sim (See the 20-sim Reference Manual.)
- Build BG model. Include data for related variables.
- From the Editor window, go to Tools, select Frequency Domain Toolbox, and then select Model Linearization. The 20-sim Model Linearization window opens, as shown in Figure 10‑5.
- Drawing Bode plots using 20-sim (See the 20-sim Reference Manual.)
- Select the input and output variables for which you want to draw the Bode plots. The resulting transfer function is related to this selection. Click on the Variable Chooser icon to get a list of model variables to choose from. Leave the rest of options as selected by default. Note that unless output is used as feedback, usually Open Loop is selected. Select OK.
- The 20-sim System Editor interface window opens (see Figure 10‑2). The transfer function, based on input/output selection appears. From the selections under Plots, choose the Bode The corresponding Bode plots appear in a new window as shown in Figure 10‑6.
- Go to Properties and select Plots to edit plots for title, axes scales, labels, legends, etc.
- Manual drawing of Bode plots using transfer function
- Derive transfer function and transform it to -domain, , using Laplace transform.
- Plug in into transfer function, to get .
- Calculate the real and imaginary parts of the .
- Calculate magnitude and power, using Equation (10.4).
- Calculate the phase angle in degrees, using Equation (10.3).
Alternatively, Bode plots can be drawn using 20-sim after having the desired transfer function from step 1 above, by following the guideline given in section 10.4.
10.5 Example: Bode Plots Using Transfer Function
A system’s transfer function is given. Find expressions for magnitude and phase angle and draw the corresponding Bode plots. Consider the frequency range 0.01–1000 rad/s. Discuss the system dynamical behaviour at low and high frequencies, including cutoff frequency.
Using the guidelines, we substitute in . Therefore, After multiplying and dividing by the conjugate of the denominator, we get . From this expression, we get the real and imaginary parts as and . Using the real and imaginary parts and Equation (10.3), we can calculate the magnitude and phase as and . Note that at and at . We can draw the Bode plots, manually or using 20-sim, for example. The cutoff frequency can be calculated as follows. The gain magnitude at reads . Therefore, the corresponding power is . The cutoff frequency corresponds to . Therefore, the corresponding gain is , using . After substituting for and using , we get cutoff frequency . The phase at the cutoff frequency can be calculated using or .
Following the steps given in section 10.4, we can use 20-sim and the transfer function to draw the Bode plots. The coefficients for the polynomials are (1) for numerator, and (1, 6, 8) for denominator. The resulting Bode plots are shown in Figure 10‑7.
The following video shows how to build and run the model for this example in 20-sim.
10.6 Example: Bode Plots Using a BG Model
Build the BG model and its Bode plots considering transfer function based on force as input and displacement of the spring as output. Use the mechanical system as shown in Figure 10‑8 with
, , , , , , , and .
The damper connects mass and the wall at the right side. Repeat the simulation for the following cases:
- Use given damper coefficient values to study its effect on the system with Parameter Sweep tool in 20-sim (available at the 20-sim Simulator window: select Tools > Time Domain Toolbox >Parameter Sweep). During the sweep, monitor the displacement of mass .
- Use a pulse-type signal as the applied force with amplitude 200, start time 2 sec, and stop time 3.5 sec.
The following video shows how to build and run the model for this example in 20-sim.
Figure 10‑9 shows the resulting Bode plots. Note that in this video, the force is applied to mass , in the first try and then moved to mass according to the sketch shown in Figure 10‑8.
- Pierre Simon Laplace © James Posselwhite is licensed under a Public Domain license
- Jean Baptiste Joseph Fourier © Louis-Léopold Boilly is licensed under a Public Domain license
- Hendrik Wade Bode is licensed under a Public Domain license