0% found this document useful (0 votes)
69 views

Matlab Handouts

Matlab Handouts

Uploaded by

Ahmed M T
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
69 views

Matlab Handouts

Matlab Handouts

Uploaded by

Ahmed M T
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 6
Figure 5-56 Unit-step response curve, 240 AS, ‘Step Response Amplimide Time (see) Hence, the time response ¢(¢) can be given by c(t) = -0.5626e cos4t + 0.3438" sin de ~ 0.4375e™ — 0375te* +1 ‘The fact that the response curve is an exponential curve superimposed by damped sinusoidal curves can be seen from Figure 5-56. When the closed-loop system involves a numerator dynamics, the unit-step response curve may exhibit a large overshoot. Obtain the unit-step response of the following system with MATLAB: C(s) 10s +4 RS) Peas +4 ‘Obtain also the unit-ramp response with MATLAB. Solution. MATLAB Program 5-19 produces the unit-step response as well as the unit-ramp response of the system. The unit-step response curv2 and unit-ramp response curve, together with the unit-ramp input, are shown in Figures 5-57(a) and (b), respectively. Notice that the unit-step response curve exhibits over 215% of overshoot. The unit-ramp response curve leads the input curve. These phenomena occurred because of the presence of a large derivative term in the numerator. Chapter 5 / Transient and Steady-State Response Analyses MATLAB Program 5-19 num =[10 41; den =[1 4 4]; 0:0.02:10; step(num,den,t); plotity) arid title('Unit-Step Response’) xlabel't (sec) ylabel‘Output’ (10 4); (14 4 0); yl =step(numt,dent,0; plot(t.t,'—,ty1) v=[0 10 0 1G); axis(v); grid title('Jnit-Ramp Response’) xlabel('t (sec)') ylabel(‘Unit-Ramp Input and Output') text(6.1,5.0,'Unit-Ramp Input’) text(3.5,7.1,'Output') UnitRamp Response Unit-Ramp Input and Output Example Problems and Solutions 241 Figure 6-71 Root-locus plot 362 AG. Root Locus Plt of G(s) ~K/s(s+1)6+2)] and Aysmptotes Imag Axis, Plot the root loci and asymptoies for a unity-feedback system with the following feedforwar transfer function: ‘ K B= GBF IEH DS) Determine the exact points where the root loci cross the ja axis, Solution. The feedforward trarsfer function G(s) can be written as K Os) = Fase Tse + as +10 Nove that as s approaches infinity, lim, G(s) can be writen as K limG(s) = lim => HmGls) = fim, Tap 4 as + las + 10 lim x rom st + 45° + 657 + 45 +1 in Sap where we used the following formula: (s + a)! = s* + das? + 60's" + 4a’s + a* ‘The expression K om (s+ 18 fio) = gives the equation for the asymptotes. Chapter 6 / Control Systems Analysis and Design by the Root-Locus Method The MATLAB program to plot the root loci of G(s) and the asymptotes is given in MATLAB Program 6-17. Note that the numerator and denominator for G(s) are num = [1] den={1 4 11 14 10) For the numerator and denominator of the asymptotes Jim G(s) we used nM 14641 Figure 6-72 shows the plot of the root loci and asymptote. Since the characteristic equation fo: the system is (s? + 2s + 2)(s? +2545) + K=0 MATLAB Program 6-17 % ***** Root-locus plot ***** num = [1]; den=[1 4 11 14 10); numa = [1]; dena=[1 46 4 1]; r= rlocus(num,den); plotir,'-") hold Current plot held plot(r,‘o') rlocus(numa,dena); 6 4 -5 5]; axis(v); axis('square') ve grid title(Plot of Root Loci and Asympiotes’) Plot of Root Loci and Asymptotes Imag Axis Example Proklems and Solutions 363 EXAMPLE 7-6 Consider the system shown in Figure 7-21. The open-loop transfer function is _ fs? +025 +1) Por 9) Plot a bode diagram. MATLAB Program 7-2 plots a Bade diagram for the system, The resulting plot is shown, Figure 7-22. The frequency range in this case is automatically determined terte from 001 10 rad/see. MATLAB Program 7. num = [9 1.8 9); den= (1 1.2 9 0); bode(num,den) ‘tle('Bode Diagram of Gls) = 9(s2 + 0.25 + 1)/s(sA2 + 1.25 + 9") Figure 7-21 Control system. gs 2 = = g 3 & Figure 7-22 Bode diagram of 9s? + 025 +1 =100 L Gta) = AE + 02s +) v0 s(e° ¥ 12s +9) Frequeney (md/see) 424 Chapter 7 / Control Systems Analysis and Design by the Frequency-Response Method If it is desired to plot the Bode diagram from 0.01 to 1000 rad/see, enter the following ‘command: w = logspace(-2,3,100) ‘This command generates 100 points logarithmically equally spaced between 0.01 and 1000 rad/sec. (Note that such a vector w specifies the frequencies in radians per second at which the frequency response will be calculated.) If we use the command bode(num,den,w) then the frequency range is as the user specified, but the magnitude range and phase-angle Tange will be automatically determined See MATLAB Program 7-3 and the resulting plot in Figure 7-23, SS MATLAB Program 7-3 po num = (9 1.8 9}; den=[1 1.2 9 0]; w = logspacet-2,3,100); bodeinum,den,w) Uitle(-Bode Diagram of G(s) = G52 + 0.25 + I/ls(s2 + 1.25 + 9))") Bode Diagram of Gts) = 9(2? +0.25-+ 1)fs(e24 1.28 +99) sD Ba $ Phase (deg); Magnitude (dB) © (2125 +9) Frequency (rad‘e2) Section 7-2 / Bode Diagrams 425

You might also like