% % A.A. Rodriguez % Feedback Control Systems % Copyright (c) 1998 % % % This macro examines the step response of a second order system: % % H(s) = 2/a (s + a) / s^2 + 2s + 2 % % for different values of a > 0. % % % For large a, the step response approaches that of the second order system % % H(s) = 2 / s^2 + 2s + 2 % % As a is decreased, the derivative action of the numerator becomes % more and more pronounced, resulting in more and more overshoot. % clf t = [0:0.1:10]; % Create time vector % % Generate Step Responses % a100=100; y100 = step( tf([2/a100 2],[1 2 2]), t); plot(t,y100) grid % activate grid on plot title('Step Response: H(s) = (2/a) (s+a)/(s^2+2s+2), a =[100 ]') ylabel('y(t)') xlabel('time (seconds)') text(2.25,0.7, 'For large a, system responds like H(s) = 2/(s^2 + 2s + 2).') text(2.5,0.95, 'a = 100') pause a10=10; y10 = step( tf([2/a10 2],[1 2 2]), t); plot(t,y100,t,y10) grid % activate grid on plot title('Step Response: H(s) = (2/a) (s+a)/(s^2+2s+2), a =[ 100, 10 ]') ylabel('y(t)') xlabel('time (seconds)') text(2.25,0.7, 'For large a, system responds like H(s) = 2/(s^2 + 2s + 2).') text(2.5,0.95, 'a = 100') text(1.0,0.95, 'a = 10') text(1.1,0.45, 'As a increases, derivative action of zero becomes less pronounced.') text(1.1,0.25, 'As a decreases, derivative action of zero becomes more pronounced.') pause a5=5; y5 = step( tf([2/a5 2],[1 2 2]), t); plot(t,y100,t,y10, t, y5) grid % activate grid on plot title('Step Response: H(s) = (2/a) (s+a)/(s^2+2s+2), a =[ 100, 10, 5 ]') ylabel('y(t)') xlabel('time (seconds)') text(2.25,0.7, 'For large a, system responds like H(s) = 2/(s^2 + 2s + 2).') text(2.5,0.95, 'a = 100') text(1.0,0.95, 'a = 5') text(1.1,0.45, 'As a increases, derivative action of zero becomes less pronounced.') text(1.1,0.25, 'As a decreases, derivative action of zero becomes more pronounced.') pause a2=2; y2 = step( tf([2/a2 2],[1 2 2]), t); plot(t,y100,t,y10, t, y5,t, y2) grid % activate grid on plot title('Step Response: H(s) = (2/a) (s+a)/(s^2+2s+2), a =[ 100, 10, 5, 2 ]') ylabel('y(t)') xlabel('time (seconds)') text(2.25,0.7, 'For large a, system responds like H(s) = 2/(s^2 + 2s + 2).') text(2.5,0.95, 'a = 100') text(1,0.95, 'a = 2') text(1.1,0.45, 'As a increases, derivative action of zero becomes less pronounced.') text(1.1,0.25, 'As a decreases, derivative action of zero becomes more pronounced.') pause a1=1; y1 = step( tf([2/a1 2],[1 2 2]), t); plot(t,y100,t,y10, t, y5,t, y2, t, y1) grid % activate grid on plot title('Step Response: H(s) = (2/a) (s+a)/(s^2+2s+2), a =[ 100, 10, 5, 2, 1 ]') ylabel('y(t)') xlabel('time (seconds)') text(2.25,0.7, 'For large a, system responds like H(s) = 2/(s^2 + 2s + 2).') text(2.5,0.95, 'a = 100') text(0.5,0.95, 'a = 1') text(1.1,0.45, 'As a increases, derivative action of zero becomes less pronounced.') text(1.1,0.25, 'As a decreases, derivative action of zero becomes more pronounced.') text(1.1,0.1, 'Derivative action of zero becomes most pronounced for a > 1.') pause a05=0.5; y05 = step( tf([2/a05 2],[1 2 2]), t); plot(t,y100,t,y10, t, y5,t, y2, t, y1,t, y05) grid % activate grid on plot title('Step Response: H(s) = (2/a) (s+a)/(s^2+2s+2), a =[ 100, 10, 5, 2, 1, 0.5 ]') ylabel('y(t)') xlabel('time (seconds)') text(2.25,0.7, 'For large a, system responds like H(s) = 2/(s^2 + 2s + 2).') text(2.5,0.95, 'a = 100') text(1.25,1, 'a = 2') text(0.75,1.2, 'a = 1') text(0.75,1.5, 'a = 0.5') text(1.1,0.45, 'As a increases, derivative action of zero becomes less pronounced.') text(1.1,0.25, 'As a decreases, derivative action of zero becomes more pronounced.') text(1.1,0.1, 'Derivative action of zero becomes most pronounced for a < 1.') pause return