Using user develop TEST INPUT

(Uses Matlab): ss, sin, abs, length, zeros, lsim, plot, xlabel, ylabel
Beside the normal step and impulse input signals, one can employ different TEST INPUT signals by providing the necessary Matlab statements. Function lsim must be used to obtain the system response.

For (Sample 2): Mountain Bike

A = [ 0,1,0; -(k1+k2)/m, 0, k1/m; k1/b,0,-k1/b]
B = [0;1;0]
C = [1,0,0]
D = [0]

Say, k1=2, k2=1 & m=1, desired TEST INPUT signal as follow,

Suitable m-script,

% ap3_4SINEPULSE.m
b=2;
A=[0,1,0; -3,0,2; 2/b,0,-2/b];
B=[0;1;0];
C=[1,0,0];
D=0;
sys=ss(A,B,C,D);

%sinepulse.m
%u=full sinewave pos pulse
t1=0:.01:3.14;
u1=abs(sin(2*t1));
t2=3.15:.01:16;
t=[t1,t2];
lenn=length(t2);
u2=zeros(1,lenn);
u=[u1,u2];

[Y,T]=lsim(sys,u,t);
Yabs=abs(Y);
plot(T,Yabs)
xlabel('time')
ylabel('response')

The response,