Page 361 - MATLAB an introduction with applications
P. 361
346 ——— MATLAB: An Introduction with Applications
Figure E6.3(a) shows the response history.
0.15
0.1
0.05
Displacement(m) –0.05 0
–0.1
–0.15
–0.2
0 0.2 0.4 0.6 0.8 1 1.2 1.4
Time(s)
Fig. E6.3(a) Response history
Example E6.4: Solve numerically the solution to the problem of a spring mass system excited by a triangular
impulse. The differential equation of motion and the initial conditions are given as
0.5X + 8π X = F ()
2
t
with X = X = 0
1
1
The triangular force is defined in Fig. E6.4. Use central difference method with ∆t = 0.05 sec.
F(t)
150
50
0 t
0 0.20 0.40
Fig. E6.4
Solution: The following MATLAB program is developed:
% INITIAL VALUES
m=0.5;k=8*pi^2;c=0;dt=0.05;
x0=0;x0d=0;

