Question
*Please solve the above task B using MATLAB only.* _ Please read carefully and find below the solution of a very similar question for part
*Please solve the above task B using MATLAB only.*
_
Please read carefully and find below the solution of a very similar question for part b.
*Task b Solution to a similar question* For you to use as a guide only!
% four_dof
function four_dof
t = 0:0.01:5 ; % time scale
c1 = 0 ;
c2 = 0 ;
c3 = 0 ;
c4 = 0 ;
k1 = 3200000 ;
k2 = 2600000 ;
k3 = 2000000 ;
k4 = 1500000 ;
m1 = 2500 ;
m2 = 3000 ;
m3 = 3000 ;
m4 = 1500 ;
init_x1 = 0.005 ;
init_v1 = 0 ;
init_x2 = 0.006 ;
init_v2 = 0 ;
init_x3 = 0.008 ;
init_v3 = 0 ;
init_x4 = 0.012 ;
init_v4 = 0 ;
init_y1 = init_x1 ;
init_y2 = init_v1 ;
init_y3 = init_x2 ;
init_y4 = init_v2 ;
init_y5 = init_x3 ;
init_y6 = init_v3 ;
init_y7 = init_x4 ;
init_y8 = init_v4 ;
initial = [init_y1 init_y2 init_y3 init_y4 ...
init_y5 init_y6 init_y7 init_y8];
[t,y]=ode45(@rhs,t,initial);
plot(t,y(:,1), t,y(:,3),t,y(:,5), t,y(:,7));
xlabel('t'); ylabel('x') ;
legend('x1 num','x2 num','x3 num', 'x4 num');
function dydt=rhs(t,y)
dydt_1 = y(2);
dydt_2 = -(c1+c2)*y(2)/m1 +c2*y(4)/m1-(k1+k2)*y(1)/m1+
k2*y(3)/m1 ...
+ f1(t)/m1 ;
dydt_3 = y(4);
dydt_4 = c2*y(2)/m2-(c2+c3)*y(4)/m2+k2*y(1)/m2-
(k2+k3)*y(3)/m2 ...
+k3*y(5)/m2+c3*y(6)/m2+f2(t)/m2 ;
dydt_5 = y(6);
dydt_6 = c3*y(4)/m3-(c3+c4)*y(6)/m3+k3*y(3)/m3-
(k3+k4)*y(5)/m3 ...
+k4*y(7)/m3+c4*y(8)/m3+f3(t)/m3 ;
dydt_7 = y(8);
dydt_8 = k4*y(5)/m4- k4*y(7)/m4 +c4*y(6)/m4- c4*y(8)/m4 +
f4(t)/m4 ;
dydt=[dydt_1;dydt_2;dydt_3;dydt_4;dydt_5;dydt_6;dydt_7;dydt_8]
;
end
function f_1 = f1(t)
f_1 = 0 ;
end
function f_2 = f2(t)
f_2 = 0 ;
end
function f_3 = f3(t)
f_3 = 0 ;
end
function f_4 = f4(t)
f_4 = 0 ;
end
end
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started