ONLY USE MATLAB TO SOLVE!! Task c : Write your differential equations in a matri
ID: 3885411 • Letter: O
Question
ONLY USE MATLAB TO SOLVE!!
Task c: Write your differential equations in a matrix form. Develop a code named four_dof_matraix.m to find the natural frequencies of the building if the damping between different floors are ignored. Use the same data for the masses and stiffness in Task b. Follow the example of two_dof_matraix.m. Print the corresponding eigenvectors and natural circular frequencies of vibrations. Show the four modal shapes of vibration and associated natural frequencies of vibration.
PLEASE SOLVE USING MATLAB ONLY
_
Find below the differential equations mentioned for part C.
Find below the data from part b mentioned for part C.
*PLEASE ONLY SOLVE PART C*
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
Answer: See the details below:
Given:
1. M1*x1''+C1*(x1'-y')+K1*(x1-y)-C2*(x2'-x1')-K2*(x2-x1)=0
2. M2*x2''+C2*(x2'-x1')+K2*(x2-x1)-K3*(x3-x2)-C3*(x3'-x2')=0
3. M3*x3''+C3*(x3'-x2')+K3*(x3-x2)-K4*(x4-x3)-C4*(x4'-x3')=0
4. M4*x4''+C4*(x4'-x3')+K4*(x4-x3)=0
Let
1. x1 = X1, x1' = X1_dash, it means x1'' = X1_dash'
2. x2 = X2, x2' = X2_dash, it means x2'' = X2_dash'
3. x3 = X3, x3' = X3_dash, it means x2'' = X3_dash'
4. x4 = X4, x3' = X4_dash, it means x4'' = X4_dash'
5. y = Y, y' = Y_dash
Now, the given second order diff. eqn. can be written as a set of first order
diff. eqn. as:
1. M1*X1_dash'+C1*(X1_dash-Y_dash)+K1*(X1_dash-Y)-C2*(X2_dash-X1_dash)-K2*(X2-X1)=0
2. M2*X2_dash'+C2*(X2_dash-X1_dash)+K2*(X2-X1)-K3*(X3-X2)-C3*(X3_dash-X2_dash)=0
3. M3*X3_dash'+C3*(X3_dash-X2_dash)+K3*(X3-X2)-K4*(X4-X3)-C4*(X4_dash-X3_dash)=0
4. M4*X4_dash'+C4*(X4_dash-X3_dash)+K4*(X4-X3)=0
On rearranging, we can write them as:
1. M1*X1_dash' = C1*Y_dash-(C1+K1+C2)*X1_dash+C2*X2_dash+K1*Y-K1*X1+K2*X2
2. M2*X2_dash' = C2*X1_dash-(C2-C3)*X2_dash+C3*X3_dash+K2*X1-(K2-K3)*X2+K3*X3
3. M3*X3_dash' = C3*X2_dash-(C3+C4)*X3_dash+C4*X4_dash+K3*X2-(K3+K4)*X3+K4*X4
4. M4*X4_dash' = C4*X3_dash-C4*X4_dash+K4*X3-K4*X4
Or
1. M1*X1_dash' = C1*Y_dash-(C1+K1+C2)*X1_dash+C2*X2_dash+0*X3_dash+0*X4_dash+K1*Y-K1*X1+K2*X2+0*X3+0*X4
2. M2*X2_dash' = 0*Y_dash+C2*X1_dash-(C2-C3)*X2_dash+C3*X3_dash+0*X4_dash+0*Y+K2*X1-(K2-K3)*X2+K3*X3+0*X4
3. M3*X3_dash' = 0*Y_dash+0*X1_dash+C3*X2_dash-(C3+C4)*X3_dash+C4*X4_dash+0*Y+0*X1+K3*X2-(K3+K4)*X3+K4*X4
4. M4*X4_dash' = 0*Y_dash+0*X1_dash+0*X2_dash+C4*X3_dash-C4*X4_dash+0*Y+0*X1+0*X2+K4*X3-K4*X4
Now dividing each by M1,M2, M3, M4 respectively:
1. X1_dash' = (C1/M1)*Y_dash-((C1+K1+C2)/M1)*X1_dash+(C2/M1)*X2_dash+0*X3_dash+0*X4_dash+(K1/M1)*Y-(K1/M1)*X1+(K2/M1)*X2+0*X3+0*X4
2. X2_dash' = 0*Y_dash+(C2/M2)*X1_dash-((C2-C3)/M2)*X2_dash+(C3/M2)*X3_dash+0*X4_dash+0*Y+(K2/M2)*X1-((K2-K3)/M2)*X2+(K3/M2)*X3+0*X4
3. X3_dash' = 0*Y_dash+0*X1_dash+(C3/M3)*X2_dash-((C3+C4)/M3)*X3_dash+(C4/M3)*X4_dash+0*Y+0*X1+(K3/M3)*X2-((K3+K4)/M3)*X3+(K4/M3)*X4
4. X4_dash' = 0*Y_dash+0*X1_dash+0*X2_dash+(C4/M4)*X3_dash-(C4/M4)*X4_dash+0*Y+0*X1+0*X2+(K4/M4)*X3-(K4/M4)*X4
Also, we will need to consider:
5. Y_dash' = 0
6. Y' = 0
7. X1' = 0
8. X2' = 0
9. X3' = 0
10. X4' = 0
Finally overall system of first order differential equations will be:
1. Y_dash' = 0
2. X1_dash' = (C1/M1)*Y_dash-((C1+K1+C2)/M1)*X1_dash+(C2/M1)*X2_dash+0*X3_dash+0*X4_dash+(K1/M1)*Y-(K1/M1)*X1+(K2/M1)*X2+0*X3+0*X4
3. X2_dash' = 0*Y_dash+(C2/M2)*X1_dash-((C2-C3)/M2)*X2_dash+(C3/M2)*X3_dash+0*X4_dash+0*Y+(K2/M2)*X1-((K2-K3)/M2)*X2+(K3/M2)*X3+0*X4
4. X3_dash' = 0*Y_dash+0*X1_dash+(C3/M3)*X2_dash-((C3+C4)/M3)*X3_dash+(C4/M3)*X4_dash+0*Y+0*X1+(K3/M3)*X2-((K3+K4)/M3)*X3+(K4/M3)*X4
5. X4_dash' = 0*Y_dash+0*X1_dash+0*X2_dash+(C4/M4)*X3_dash-(C4/M4)*X4_dash+0*Y+0*X1+0*X2+(K4/M4)*X3-(K4/M4)*X4
6. Y' = 0
7. X1' = 0
8. X2' = 0
9. X3' = 0
10. X4' = 0
In matrix form (MATLAB):
Let
X = [Y_dash;X1_dash;X2_dash;X3_dash;Y;X1;X2;X3;X4]
A = [0 0 0 0 0 0 0 0 0 0;
(C1/M1) -((C1+K1+C2)/M1) (C2/M1) 0 0 (K1/M1) -(K1/M1) (K2/M1) 0 0;
0 (C2/M2) -((C2-C3)/M2) (C3/M2) 0 0 (K2/M2) -((K2-K3)/M2) (K3/M2) 0;
0 0 (C3/M3) -((C3+C4)/M3) (C4/M3) 0 0 (K3/M3) -((K3+K4)/M3) (K4/M3);
0 0 0 (C4/M4) -(C4/M4) 0 0 0 (K4/M4) -(K4/M4);
0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0;]
Hence
odes = diff(X) == A*X
In MATLAB:
syms y x1 x2 x3 x4
X = [Y_dash;X1_dash;X2_dash;X3_dash;Y;X1;X2;X3;X4];
A = [0 0 0 0 0 0 0 0 0 0;
(C1/M1) -((C1+K1+C2)/M1) (C2/M1) 0 0 (K1/M1) -(K1/M1) (K2/M1) 0 0;
0 (C2/M2) -((C2-C3)/M2) (C3/M2) 0 0 (K2/M2) -((K2-K3)/M2) (K3/M2) 0;
0 0 (C3/M3) -((C3+C4)/M3) (C4/M3) 0 0 (K3/M3) -((K3+K4)/M3) (K4/M3);
0 0 0 (C4/M4) -(C4/M4) 0 0 0 (K4/M4) -(K4/M4);
0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0;];
odes = diff(X) == A*X;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.