%REQUIRES MATLAB'S SYMBOLIC TOOLBOX.
clear;syms s;
M1=8.164;M2=11.953;
M3=11.654;M4=5.018;
B=90;K=3500;E=B+K/s;
%Use formulae from the text.
%Form 3X3 system matrix:
A=[M2*s+2*E,-E,0];
A=[A;-E,M3*s+2*E,-E];
A=[A;0,-E,M4*s+E];
B=[E;0;0];V=A\B;V4=V(3);
%Convert symbolic solution
%to non-symbolic solution:
[N,D]=numden(V4);
N=sym2poly(N);
D=sym2poly(D);
[R P]=residue(N,D);
t=linspace(0,5,1000);
Y=0.01*real(R.'*exp(P*t));
subplot(211),plot(t,Y)
