Spring-Mass System 02
Spring-Mass System 02
1. Blank
2. Blank
We used MATLAB, and this is the code
clear all
xo=[1; 0; 0; -2; 1; 0];
ts=[0 30];
[t,x]=ode45('f',ts,xo);
plot(t,x(:,1),t,x(:,2),'--',t,x(:,3))
6. Simulate and discuss the case k=0.1 for chosen input signal
and/or initial conditions.
function v=f(t,x)
m1=1; m2=1;
k1=1; k2=1; k3=1; k4=1;
c1=0.1; c2=0.1; c3=1; c4=1;
M=[m1 0 0; 0 m1*sind(45) 0; 0 0 m2];
K=[k1+k3 k2*cosd(45) -k3; 0 k2*sind(45) 0; -k3 0 k3+k4];
C=[c3 c2*cosd(45) -c3; 0 c2*sind(45) 0; -c3 0 c3+c4];
A1=[zeros(3) eye(3); -inv(M)*K -inv(M)*C];
v=A1*x
eigenvalues=eig(A1)
7. Simulate and discuss the case k=10 for chosen input signal
and/or initial conditions.
function v=f(t,x)
m1=1; m2=1;
k1=1; k2=1; k3=1; k4=1;
c1=10; c2=10; c3=10; c4=1;
M=[m1 0 0; 0 m1*sind(45) 0; 0 0 m2];
K=[k1+k3 k2*cosd(45) -k3; 0 k2*sind(45) 0; -k3 0 k3+k4];
C=[c3 c2*cosd(45) -c3; 0 c2*sind(45) 0; -c3 0 c3+c4];
A1=[zeros(3) eye(3); -inv(M)*K -inv(M)*C];
v=A1*x
eigenvalues=eig(A1)
Spring-Mass System 02