% Program "tra_llm.m" to demonstrate use of Matlab in % transient response analysis of a linear control system % Parameter values of model %L = 0.01 ; %inertance in units of cm H2O s2/L L = 0.00 ; %inertance in units of cm H2O s2/L C = 0.1 ; %compliance in units of L/cm H2O R = 1.0 ; %resistance in units of cm H2O s/L lambda = 1 ; %open-loop case % set up transfer function num = [1]; den = [L*C (R*C)+1 lambda]; Hs = tf(num,den); % generate time vector t = [0:0.005:1.8]; % compute and plot impulse response % x = impulse(Hs,t); % plot(t,x); % hold; % disp(' Press to continue >>'); % pause; % % compute and plot step response y = step(Hs,t); %figure; plot(t,y); %hold; %disp(' Press to continue >>'); %pause; % % % compute and plot response to arbitrary input, u (square wave) % [u,t]=gensig('square',0.5,5,0.005); % y=lsim(Hs,u,t); % figure; % plot(t,y)