PLEASE ONLY SOLVE USING MATLAB!! Task b: Develop a general code named four_dof.m
ID: 3885130 • Letter: P
Question
PLEASE ONLY SOLVE USING MATLAB!!
Task b: Develop a general code named four_dof.m which includes the base motion and damping. Use the function ode45. Follow the example of two_dof.m. Use the code developed in Task b to simulate the dynamics of this structure from t = 0s to t = 6s. The initial conditions are 1 v m s (0) 0.012 = , 2 v m s (0) 0.032 = , 3 v m s (0) 0.055 = 4 v m s (0) 0.071 = . 1 x (0) 0 = , 2 x (0) 0 = , 3 x (0) 0 = and 4 x (0) 0 = . Other parameters are 1 M kg = 3900 , 2 M kg = 3600 , 3 M kg = 3500 , 4 M kg = 2500 , 1 k kN m = 3400 / , 2 k kN m = 2800 / , 3 k kN m = 2300 / and 4 k kN m =1800 / . Ignore the base motion and damping in this calculation. Present your results as time-series plots of displacement of each floor in the same plot.
ODE Required for above task
The model and the parameters Figure 1 is a schematic of the four story shear building. Each floor is represented by its mass and the superstructure supporting each floor is idealized by a spring constant representing resistance to lateral motion and a damping coefficient providing frictional energy losses. External forces applied to each floor are ignored in this model, but the base (or the ground) may move during an earthquake. Hence, only four degrees of freedom are needed to describe total displacements of the structure, described as Figure 2 MA AN Base Figure A fou-story shear building excited by the base motion. k,kkk N4 0 Figure 2 A simplified four DOF model for a shear building.Explanation / Answer
param.zeta = 0; % Damping ratio [t,z] = ode45(@(t,z) odesys( t,z,param ),tsim,z0); x(:,1) = z(:,1); % Save solution for future plotting. plot(t,x(:,1),'linewidth',2);grid on;hold all ylim([-1 1]) xlabel('Time [s]'); ylabel('Position [m]') title('Free Response: Undamped 2nd Order System'); zetavals = [0 1/sqrt(2) 1 1.5]; % Damping ratios to consider. case1 = 'Undamped: zeta = 0' ; case2 = 'Underdamped: zeta = 0.707' ; case3 = 'Critically Damped: zeta = 1' ; case4 = 'Overdamped: zeta = 1.5' ; for i = 2: length(zetavals) param.zeta = zetavals(i); % Set current damping ratio. [t,z] = ode45(@(t,z) odesys( t,z,param ),tsim,z0); % Compute free response. x(:,i) = z(:,1); % Save solution for future plotting. end; figure % Plot results plot(t,x,'linewidth',2);grid on xlabel('Time [s]'); ylabel('Position [m]') title('Free Response of 2nd Order System for Various Damping Ratios'); legend(case1,case2,case3,case4,0)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.