%Tan Nguyen, Trang Pham, Nhan Phan
%ECE 460 Lab
%WINTER 2003
%Lab #2
%Part B: Differential Equation- complete solution
%compute the solution to the following differential equation using Matlab:
%d^2x(t)/dt^2+2dx(t)/dt+10x(t)=r(t),x(0)=-1, x(0)=-2, t=[0:0.01:10]'
numgo=[-1 -4];
dengo=[1 2 10];
numgr=1;
dengr=[1 2 10];
t=[0:0.01:10]';
sysgo=tf(numgo,dengo);
sysgr=tf(numgr,dengr)
yigo=impulse(sysgo,t); %should goes to zero
ysgr=step(sysgr,t)
yst=yigo+ysgr;
figure(2);
hold on
plot (t,yigo)
plot (t,ysgr)
plot (t,yst,'.')
xlabel('The t axis')
ylabel('The y axis')
title('The plot of zero input, zero state, and total response ')
grid on
hold off