Lab 7 — Frequency response computations Agenda Time Item 5 min Lab introduction 10 min Computing the frequency response of a system 20 min Plotting the frequency response of a system 125 min The big picture: Lab activity 1 – Frequency response of an active band-pass filter Lab activity 2 – Frequency response of a two-degree-of-freedom oscillator Practice performing frequency response calculations with a single input frequency. Practice generating a Bode plot for a given transfer function. Model an active band-pass filter, obtain a transfer function, perform frequency response computations, and plot a Bode plot. Model a two-degree-of-freedom oscillator, obtain a transfer function, perform frequency response computations, and plot a Bode plot. Submit a memo presenting your results. ES 205 Lab 7 Page 1 of 8 Computing the frequency response of a system The big picture of frequency response analysis: Important frequency response quantities: • Input amplitude: • Input frequency: • Transfer function: () • Frequency response function (FRF): (i) = ()| • FRF magnitude: |(i)| • FRF phase: ∠(i) ES 205 Lab 7 Page 2 of 8 Practice Problem 1 () = 5(10 + 50) , (2 + 5)( + 20 + 30) withinput() = 3 sin 2. Given: A transfer function Taks: Compute the FRF magnitude |(i)| and FRF phase ∠(i). Create an m-file and record the following lines of code: w = 2; s = i*w; % % Input frequency from f(t) Set s = i*w Giw = (10*s + 50)/(s^2 + 20*s + 30) % FRF magGiw = abs(Giw) % FRF magnitude phaseGiw = angle(Giw)*180/pi % FRF phase in degrees Results: (i) = _______________________________ |(i)| = _______________________________ ∠(i) = _______________________________ The steady-state response "## () to the given input is "## () = __________________________________________________________________ ES 205 Lab 7 Page 3 of 8 Plotting the frequency response of a system The Bode plot: Plot the FRF magnitude and phase for a range of frequencies: 50 Magnitude (dB) 45 40 35 30 25 20 10 1 10 0 1 10 Frequency (rad/s) 10 2 10 3 40 Phase (deg) 20 0 20 40 60 80 10 1 10 0 1 10 Frequency (rad/s) • Frequency is represented on a logarithmic scale in rad/s. • Magnitude is plotted on a linear scale in decibels (dB): 10 2 10 3 $%& = 20 log*+(|(i)|) • ES 205 Phase is plotted on a linear scale in degrees. Lab 7 Page 4 of 8 Practice Problem 2 () = 5(10 + 50) . (2 + 5)( + 20 + 30) Given: A transfer function Task: Plot the Bode plot over the frequency range 0.1 rad/s to 1000 rad/s. In your m-file, record and complete the following lines of code: a b n w s = = = = = ___; ___; ___; logspace(a,b,n)'; i*w; % % % % % 10^a = 0.1 rad/s 10^b = 1000 rad/s Number of frequency points Define the frequency range Set s = i*w Giw = _____________; magGiw = abs(Giw); MdB = 20*log10(magGiw); phaseGiw = unwrap(angle(Giw))*180/pi; % % % % FRF – use ‘.’ operators FRF magnitude Magnitude in dB FRF phase in degrees figure(1) set(gcf, 'color', 'w') subplot(211) semilogx(w,MdB) grid on xlabel('Frequency (rad/s)') ylabel('Magnitude (dB)') % % Create a subplot figure Bode magnitude plot % Bode phase plot subplot(212) semilogx(w,phaseGiw) grid on xlabel('Frequency (rad/s)') ylabel('Phase (deg)') Print your Bode plot. Mark on the graph the points that correspond to the magnitude and phase you calculated in Practice Problem 1. ES 205 Lab 7 Page 5 of 8 Lab activity 1 – Frequency response of an active band-pass filter As a team, do the following: 1. Model the active band-pass filter shown below. 2. Use Maple to obtain the transfer function relating the input voltage ,- to the output voltage ,./0 . Use the following parameter values: • 1* = 1 = 10kΩ • 14 = 15 = 1kΩ • 6* = 10μF • 6 = 1μF 3. Let ,- () = 5 cos 100 V. Calculate the FRF (i), the FRF magnitude |(i)|, the magnitude $%& in dB, and the FRF phase ∠(i) at the input frequency. 4. Write an expression for the steady-state output voltage, ,./0,## (). 5. Plot the Bode plot over the frequency range 0.1 rad/s to 1000 rad/s. ES 205 Lab 7 Page 6 of 8 Lab activity 2 – Frequency response of a two-degree-of-freedom oscillator As a team, do the following: 1. Model the two-degree-of-freedom oscillator shown below. 2. Use Maple to obtain the transfer function relating the input force () to the block displacement "*. Use the following parameter values: • :* = 2 kg • : = 1 kg • ;* = ; = 0.5 N-s/m • <* = 10 N/m • < = 20 N/m 3. Let () = 2 sin 4 N. Calculate the FRF (i), the FRF magnitude |(i)|, the magnitude $%& in dB, and the FRF phase ∠(i) at the input frequency. 4. Write an expression for the steady-state block displacement, "*,## (). 5. Plot the Bode plot over the frequency range 0.1 rad/s to 100 rad/s. ES 205 Lab 7 Page 7 of 8 Submit a memo detailing your results Download the Lab 7 memo template from the course website. As a team, complete the Lab 7 memo: • Complete all tables. Include units. • Paste in all requested plots. Do NOT use the Snipping Tool. • Provide descriptive captions for all tables and figures. • Type in the transfer function for each system analyzed. Use Equation Editor. • No additional text is required in your memo. • Attach printouts of your Maple worksheet(s) and MATLAB m-file(s). Submit your Lab 7 memo by the end of the lab period. ES 205 Lab 7 Page 8 of 8