Question
USE MATLAB
Engineers and scientists use mass-spring models to gain insights into the dynamics of structures under the influence of disturbances such as earthquakes. The figure shows such as representation for a three-story building. For this case, the analysis is limited to horizontal motion of the structure. Using Newton s second law, the governing of motion can be developed for this system as where x is the displacement. Using Ode45. write a MATLAB script to simulate the dynamics of this structure from t = 0 to 20 seconds, given the initial condition that the velocity of the ground floor is dx t / dt = 1 m/s. and all other initial values of displacements and velocities arc zero. Present your results as two time-series plots (a) displacements vs. time and (b) velocities vs. time.
Explanation / Answer
First we have to write this as a system of 1st order ODEs
take
w1 = x1
w2 = x2
w3 = x3
w4 = x1'
w5 = x2'
w6 = x3'
then the system of ODE is :
w1' = w4
w2' = w5
w3' = w6
w4' = -(k1/m1)w1 + (k2/m1)(w2-w1)
w5' = -(k2/m2)(w2-w1) + (k3/m2)(w3-w2)
w6' = -(k3/m3)(w3-w2)
Initial conditions being
w1(0) = 0
w2(0) = 0
w3(0) = 0
w4(0) = 1
w5(0) = 0
w6(0) = 0