Assignment Chef icon Assignment Chef
All English tutorials

Programming lesson

Mastering Modal Analysis of Shear Buildings: A MATLAB Tutorial for ME 370

Learn how to derive equations of motion, perform modal analysis, and simulate steady-state responses of a 3-story shear building using MATLAB. This tutorial covers undamped and damped cases, tuned mass dampers, and practical tips for your ME 370 project.

ME 370 shear building modal analysis MATLAB 3 DOF spring mass system steady state response harmonic impulse response Dirac delta tuned mass damper design pendulum TMD MATLAB vibration analysis tutorial structural dynamics assignment MATLAB code shear building natural frequencies mode shapes damping ratio modal analysis Euler Lagrange equations building vibration control ME 370 Fall 2025 project seismic response simulation

Introduction to Shear Building Dynamics

In structural engineering, shear buildings are simplified models used to analyze the dynamic response of multi-story structures under lateral loads such as wind, earthquakes, or machinery vibrations. The ME 370 Fall 2025 assignment focuses on a three-story shear building modeled as a 3-degree-of-freedom (DOF) spring-mass system. This tutorial will guide you through the key steps: deriving equations of motion (EOM), performing modal analysis, and computing steady-state responses for harmonic and impulse forces using MATLAB. We'll also explore the effect of damping and the design of a pendulum tuned mass damper (PTMD) to control vibrations—a concept that's gaining attention in modern skyscraper design, similar to how the Burj Khalifa uses advanced damping systems.

Step 1: Deriving Equations of Motion (EOM) with Newton's Second Law

For a three-story shear building, each floor is represented by a lumped mass (m1, m2, m3) connected by springs (k1, k2, k3). Assuming only horizontal motion, we apply Newton's second law to each mass. Draw free-body diagrams (FBDs) for each mass showing spring forces and external forces. For mass m1 (first floor):

m1*x1'' = -k1*x1 + k2*(x2 - x1) + F(t)

For m2:

m2*x2'' = -k2*(x2 - x1) + k3*(x3 - x2)

For m3:

m3*x3'' = -k3*(x3 - x2)

These can be written in matrix form: M x'' + K x = F(t), where M and K are mass and stiffness matrices. This systematic approach is similar to how AI algorithms break down complex problems into smaller, solvable components—like how a recommendation system models user preferences.

Step 2: Modal Analysis for Undamped System

Given m1 = m2 = m3 = 5000 kg and k1 = k2 = k3 = 2000 N/m, we compute natural frequencies and mode shapes. Solve the eigenvalue problem: (K - ω²M) φ = 0. In MATLAB, use [V, D] = eig(K, M); natural frequencies are sqrt(diag(D)). For this symmetric system, you'll get three frequencies: ω1 ≈ 0.6325 rad/s, ω2 ≈ 1.5811 rad/s, ω3 ≈ 2.2361 rad/s. Mode shapes show relative motion: first mode all floors move same direction, second mode first and second move opposite to third, third mode floors alternate. Plot these mode shapes to visualize the building's deformation patterns—a critical step in understanding resonance, much like how gamers analyze character movement patterns in competitive games.

Step 3: Steady-State Response to Harmonic Force

For F(t) = 300 cos(20t) N applied to the first floor, the steady-state response can be found using modal superposition. Transform the system into modal coordinates: let x = Φ q, where Φ is the mode shape matrix. The decoupled modal equations are: q_i'' + ω_i² q_i = f_i(t), where f_i(t) = φ_i^T F(t)/M_i (modal force). Since the excitation frequency (20 rad/s) is much higher than all natural frequencies, the response will be small and in phase with the force. In MATLAB, compute the modal participation factors and then reconstruct physical displacements. Plot both modal responses (q_i vs time) and physical responses (x_i vs time). Ensure your code runs without errors—remember, a non-working code costs 50% of the grade!

Step 4: Impulse Response Using Dirac Delta

For F(t) = 300 δ(t) N, the impulse force excites all modes. The response in modal coordinates is: q_i(t) = (f_i0 / ω_i) sin(ω_i t) for t>0, where f_i0 is the modal impulse magnitude. In MATLAB, simulate using initial conditions derived from the impulse. Plot the physical displacements; you'll see beating patterns if modes are close in frequency. This is analogous to how a sudden spike in social media traffic can cause server oscillations—a concept familiar to anyone following viral trends.

Step 5: Including Damping (ξ = 0.02)

Real structures have damping. With modal damping ratio ξ = 0.02, the modal equations become: q_i'' + 2ξ ω_i q_i' + ω_i² q_i = f_i(t). For the harmonic case, the steady-state amplitude is given by |H_i(ω)| = 1/√((ω_i² - ω²)² + (2ξ ω_i ω)²). For the impulse case, the response decays exponentially: q_i(t) = (f_i0 / ω_di) e^{-ξ ω_i t} sin(ω_di t), where ω_di = ω_i √(1-ξ²). In MATLAB, you can simulate using the analytical expressions or numerically integrate the equations. Compare damped vs undamped plots to see the reduction in amplitude—critical for ensuring the building stays within safe limits, much like how noise-cancelling headphones adapt to ambient sound.

Step 6: Designing a Pendulum Tuned Mass Damper (PTMD)

To control the third floor's motion, add a pendulum TMD with mass m4 and length L. The PTMD acts as a vibration absorber, similar to the Taipei 101's tuned mass damper. Derive the EOM using the Euler-Lagrange method: compute kinetic and potential energies of the building plus pendulum. The pendulum's natural frequency is ω_p = √(g/L). Tune L such that ω_p matches the first natural frequency of the building (≈0.6325 rad/s), giving L ≈ 24.5 m. Then adjust m4 (e.g., 500 kg) to keep the third floor displacement around 7 cm peak-to-peak under the impulse force. Use MATLAB to simulate the coupled system and iterate m4 and L. This optimization process mirrors how financial analysts tune portfolio parameters to minimize risk—a trending topic in fintech apps.

MATLAB Implementation Tips

Organize your code similar to Example_431.m. Use clear sections: define parameters, build M and K matrices, compute eigenvalues, define force functions, compute modal responses, and plot results. Include comments explaining each step. Test your code with the given values before submission. Remember: IF CODE DOES NOT RUN, YOU'LL AUTOMATICALLY LOSE 50% OF THE PROBLEM'S GRADE. Use plot for time histories and subplot to combine modal and physical responses. For the PTMD, you may need to solve a 4-DOF system using state-space representation or direct integration (e.g., ode45).

Conclusion

This tutorial covered the essential steps for the ME 370 shear building assignment: deriving EOM, modal analysis, steady-state response for harmonic and impulse forces, adding damping, and designing a PTMD. By following these steps and writing clean, well-documented MATLAB code, you'll be well-prepared to tackle the project. Remember to work in groups, list contributions, and submit a typed report with plots. Good luck!