% Define a LTI system and then compute the % transition matrix Ph_s and the transfere function G_s %%%%%%%%%%%%%%%%%%%% %%% State-space representation %%% %%% x_dot=Ax+Bu, y=Cx+Du %%%% %%%%%%%%%%%%%%%%%%%% clear all close all clc % define the matrixes A, B,C and D of the ss representation A=[-2 -1.5; 2 0]; B=[2;0]; C=[0.5 0.5]; D=0; % define a symbolic variable for the laplace variable syms s % define the identity matrix I=eye(2); % define Ph_s Phs=inv(s*I-A); % define G_s Gs=C*Phs*B+D; % define initial condition x0 x0=[1,2]'; % define X_free(s) for x0 Xs_free=Phs*x0; % define Y_free(s) for x0 Ys_free=C*Xs_free; %compute the response to step signal (U_s=1/s) Ys_step=Gs*1/s; Ys_step=simplify(Ys_step); % simplified version of Ys_step % display a simplified version of Ys_step disp('Ys_step='); disp(Ys_step); % compute the antitrasform functions xt_free=ilaplace(Xs_free); yt_free=ilaplace(Ys_free); yt_step=ilaplace(Ys_step);