I have these 3 equations
X1(s)*[m1*s^2 + c1*s+(k01+k12)] = F(s) + k12*X2(s)
X2(s)*[m2*s^2 + c2*s +(k12+k23)] = k12*X1(s)+k23*X3(s)
X3(s) [m3*s^2 + c3*s +(k23+k34)] = k23*X2(s)
and I want to extract the first trasnfer function. So I can input it in this line of code "sys = (insert TF here)"
I dont really know how I would go about doing this.
m1=1;
m2=1;
m3=1;
c1=1;
c2=1;
c3=1;
k01=0;
k12=100;
k23=10;
k34=0;
t = 0:0.01:10;
U1 = 10+2*t;
U2 = sin(t);
s = tf('s');
p1=(m1*s^2 + c1*s +(k01+k12));
p2=(m2*s^2 + c2*s +(k12+k23));
p3=(m3*s^2 + c3*s +(k23+k34));
M = [p1 -k12 0; k12 -p2 k23; 0 k23 -p3];
M^-1
sys = ??? ;
OPT = stepDataOptions('StepAmplitude', 100);
[Y1, t1]=impulse(sys, 10);
[Y2, t2]=step(sys,10,OPT);
[Y3, t3]=lsim(sys,U1,t);
[Y4, t4]=lsim(sys,U2,t);
subplot(2,2,1)
plot(t1,Y1,'r')
hold on
title ('Impulse Response')
xlabel ('Time (S)')
ylabel("Amplitude)")
grid on
subplot(2,2,2)
plot(t2,Y2,'r')
hold on
title ('Step Response')
xlabel ('Time (S)')
ylabel("Amplitude)")
grid on
subplot(2,2,3)
plot(t3,Y3,'r')
hold on
title ('Step Ramp Response')
xlabel ('Time (S)')
ylabel("Amplitude)")
grid on
subplot(2,2,4)
plot(t4,Y4,'r')
hold on
title ('Sin Response')
xlabel ('Time (S)')
ylabel("Amplitude)")
grid on