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:
- Mass, Stiffness, and Damping:
mis the mass in kilograms (kg).keffis the effective stiffness in Newtons per meter (N/m).ζeffis the effective damping ratio, a dimensionless quantity representing energy dissipation in the system.
- 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. - System Representation:
The system is modeled as a mass-spring-damper system. The state-space matricesA,B,C, andDrepresent the state-space form of the system, which is used in thelsimfunction.
- The matrix
Acontains the dynamics of the system (mass and damping). - The matrix
Bdescribes how the input (ground acceleration) affects the system. - The matrix
Cis used to output the relative displacement, andDis the direct transmission term (set to 0 in this case).
- Solving the Equation:
Thelsimfunction simulates the time response of the system (y, relative displacement) to the El Centro ground acceleration. Thetvariable holds the time vector, andxcontains the system’s state variables (e.g., velocity and displacement). - 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.