Professional Documents
Culture Documents
Solutions To Mechanical Homework Questions
Solutions To Mechanical Homework Questions
3 – SOLLUTION
N Homeework ## 05– Te
erm 16
62
Dr. Ha
assen M. O
OUAKAD
# 1)
1 | P a g e
2 | P a g e
3
3 | P a g e
4
4 | P a g e
# 2)
5
5 | P a g e
# 3)
6 | P a g e
7
7 | P a g e
MATLAB SCRIPT:
m1=2;m2=1;k1=6;k2=3;c1=0.1;c2=0.3;F1=2;w1=3;F2=5;w2=2;
EOM0=@(tspan,X)EOM(tspan,X,k1,k2,c1,c2,m1,m2,F1,F2,w1,w2);
X0=[0 0 0 0];
tspan=[0 20];
[T,X] = ode45(EOM0,tspan,X0);
figure(1)
plot(T,X(:,2))
hold on
plot(T,X(:,4))
title('Displacement with Damping and Harmonic Force')
xlabel('Time, \it t, \rm (s)')
ylabel('Displacement, \it x, \rm (m)')
legend('X1','X2')
-1
-2
-3
0 5 10 15 20
Time, t, (s)
8 | P a g e