% Example 3.21
% Feb 1, 2020

numG 	= [ 0	0  	0.0002	];
denG	= [ 1 	0  	0 	];

s = tf( 's' )
sysG = 0.0002/(s^2)

t = 0:0.01:10;

% u1

u1 = [ zeros( 1, 500 ) 	25*ones( 1, 10) zeros( 1, 491 ) ];
[ y1 ] = lsim( sysG, u1, t );
ff  =  180/pi;
y1 = ff*y1;

figure(1)
plot( t, u1 );
grid

figure(2)
plot( t, y1 );
grid


% u2

u2 = [ zeros(1,500) 25*ones(1,10) zeros(1,100) (-35)*ones(1,10) zeros(1, 381) ];
[ y2 ] = lsim( sysG, u2, t );
ff  =  180/pi;
y2 = ff*y2;

figure(3)
plot( t, u2 );
grid

figure(4)
plot( t, y2 );
grid
