Use the MATLAB code of “lsim” to compute the relative displacement through this linearized model with keff and ζeff

Use the MATLAB code of “lsim” to compute the relative displacement through this linearized model with keff and ζeff, with the El Centro ground acceleration (E-W) as the excitation. The unit of the mass, damping, and stiffness is kg, N/m s, and N/m, respectively.

The Correct Answer and Explanation is :

To compute the relative displacement using the MATLAB lsim function for a linearized model with effective stiffness (keff) and effective damping (ζeff), where the excitation is the El Centro ground acceleration (E-W), follow these steps:

MATLAB Code Implementation

Here is an example of how to implement the code using the lsim function:

% Given Parameters
m = 1000;             % mass in kg
keff = 50000;         % effective stiffness in N/m
zeta_eff = 0.02;      % effective damping ratio
ground_acc = load('elcentro.txt');  % Ground acceleration (El Centro E-W)
time = ground_acc(:, 1);           % Time vector from El Centro data
acceleration = ground_acc(:, 2);   % Ground acceleration (E-W)

% Compute the undamped natural frequency (wn) and damping coefficient (c)
wn = sqrt(keff / m);               % Natural frequency (rad/s)
c = 2 * zeta_eff * wn * m;         % Damping coefficient (N*s/m)

% Define the system (mass-spring-damper)
A = [0 1; -keff/m -c/m];
B = [0; 1/m];
C = [1 0];
D = 0;

% Use the lsim function to compute the relative displacement
[y, t, x] = lsim(A, B, C, D, acceleration, time);

% Plot the relative displacement
plot(t, y)
title('Relative Displacement Response to El Centro E-W Ground Motion')
xlabel('Time (s)')
ylabel('Relative Displacement (m)')

Explanation:

  1. Mass, Stiffness, and Damping:
  • m is the mass in kilograms (kg).
  • keff is the effective stiffness in Newtons per meter (N/m).
  • ζeff is the effective damping ratio, a dimensionless quantity representing energy dissipation in the system.
  1. Ground Acceleration Input:
    The El Centro ground acceleration (E-W direction) is stored in a file (e.g., elcentro.txt). This file should contain time and ground acceleration data, where the second column represents the ground acceleration at each time step.
  2. System Representation:
    The system is modeled as a mass-spring-damper system. The state-space matrices A, B, C, and D represent the state-space form of the system, which is used in the lsim function.
  • The matrix A contains the dynamics of the system (mass and damping).
  • The matrix B describes how the input (ground acceleration) affects the system.
  • The matrix C is used to output the relative displacement, and D is the direct transmission term (set to 0 in this case).
  1. Solving the Equation:
    The lsim function simulates the time response of the system (y, relative displacement) to the El Centro ground acceleration. The t variable holds the time vector, and x contains the system’s state variables (e.g., velocity and displacement).
  2. Plotting the Results:
    The relative displacement is plotted over time, showing how the structure responds to the seismic excitation.

Conclusion:

The lsim function in MATLAB provides an effective way to simulate the response of a mass-spring-damper system subjected to ground excitation. By defining the system parameters (mass, stiffness, and damping), the ground motion, and the appropriate system matrices, you can calculate the relative displacement of the structure during an earthquake event. This method is particularly useful in engineering to assess how buildings or structures react to seismic activities.

Scroll to Top