Question
have written code to obtain eigen values and vectors using Stiffness K and Mass M and i want to obtain the damping matrix using an inherent damping ratio of 2% of the structure for all the vibration modes. How do i do it? here under is the my code thus far. clc; h=[5.5]+[0:3.96:20*3.95]; % Total floor height(m)% %--------------Start of Mass Matrix---------------% M(1,1)=1.126e+003 ; % unit: ton M(20,20)=1.170e+003 ; % unit: ton for i=2:19 M(i,i)=1.100e+003; % unit: ton end disp('Mass Matrix(ton):'); disp(M) %--------------end of Mass Matrix-----------------% %--------------Start of Stiffness Matrix----------% for i=1:5 k(1,i)=862.07e+003; % unit: kN/m end for i=6:11 k(1,i)=554.17e+003 ; % unit: kN/m end for i=12:14 k(1,i)=453.51e+003 ; % unit: kN/m end for i=15:17 k(1,i)=291.23e+003 ; % unit: kN/m end for i=18:19 k(1,i)=256.46e+003 ; % unit: kN/m end k(1,20)=171.70e+003 ; % unit: kN/m K=zeros(20,20) for j=1:(20-1) K(j,j) = k(1,j)+k(1,j+1); K(j,j+1) = -k(1,j+1); K(j+1,j) = -k(1,j+1); end K(20,20)=171.70e+003 ; % unit: kN/m %--------------End of Stiffness Matrix--------------% %----Start of Eigen Values and Eigne Vectors--------% [eigvec,eigval]=eig(K,M); %Eigen Values and Vectors% wn = sort(sqrt(diag(eigval))); f =(wn/(2*pi)); Tn = (2*pi)./wn; disp('Mode Omega(w) Time_Period ') for i = 1:length(wn) fprintf (' %d %.2f %.2f \n',i,wn(i,1),Tn(i,1)) end %-------End of Eigen values and Eigne Vectors-------% %-----Start of Normalisation of mode shapes---------% for j = 1 : length(wn) eigvec(:,j)=eigvec(:,j)/eigvec(length(wn),j); end disp('Mode shapes:'); disp(eigvec) %-----------End of Normalisation of mode shapes-----------%
Expert Answer
Prashant Kumar
PhD Expert
Answered Aug 25, 2026
To obtain the damping matrix using an inherent damping ratio of 2% for all vibration modes, you can modify your existing code by following these steps:
- Calculate the damping coefficient (c) using the formula: c = 2 * damping_ratio * sqrt(mass * stiffness), where damping_ratio is the desired inherent damping ratio (2% in this case), mass is the mass matrix, and stiffness is the stiffness matrix.
- Multiply the damping coefficient by the mass matrix to obtain the damping matrix (C).
Here's the modified code to incorporate these changes:
clc;
h = [5.5] + [0:3.96:20*3.95]; % Total floor height(m)
% Start of Mass Matrix
M(1,1) = 1.126e+003; % unit: ton
M(20,20) = 1.170e+003; % unit: ton
for i = 2:19
M(i,i) = 1.100e+003; % unit: ton
end
disp('Mass Matrix(ton):');
Mass Matrix(ton):
disp(M);
Columns 1 through 16
1126 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1100 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1100 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1100 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1100 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1100 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1100 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1100 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1100 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1100 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1100 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1100 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1100 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1100 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1100 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1100
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 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 17 through 20
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 0 0
0 0 0 0
0 0 0 0
0 0 0 0
1100 0 0 0
0 1100 0 0
0 0 1100 0
0 0 0 1170
%--------------Start of Stiffness Matrix----------% for i=1:5 k(1,i)=862.07e+003; % unit: kN/m end for i=6:11 k(1,i)=554.17e+003 ; % unit: kN/m end for i=12:14 k(1,i)=453.51e+003 ; % unit: kN/m end for i=15:17 k(1,i)=291.23e+003 ; % unit: kN/m end for i=18:19 k(1,i)=256.46e+003 ; % unit: kN/m end k(1,20)=171.70e+003 ; % unit: kN/m K=zeros(20,20)
K = 20×20
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 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
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 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
for j=1:(20-1)
K(j,j) = k(1,j)+k(1,j+1);
K(j,j+1) = -k(1,j+1);
K(j+1,j) = -k(1,j+1);
end
K(20,20)=171.70e+003 ; % unit: kN/m
% Calculate the damping coefficient (c)
damping_ratio = 0.02; % 2% inherent damping ratio
mass = M;
stiffness = K;
c = 2 * damping_ratio * sqrt(mass * stiffness);
% Multiply the damping coefficient by the mass matrix to obtain the damping matrix (C)
C = c .* M;
% Start of Eigen Values and Eigen Vectors
[eigvec, eigval] = eig(K, M); % Eigen Values and Vectors
wn = sort(sqrt(diag(eigval)));
f = wn / (2*pi);
Tn = (2*pi) ./ wn;
disp('Mode Omega(w) Time_Period ')
Mode Omega(w) Time_Period
for i = 1:length(wn)
fprintf(' %d %.2f %.2f \n', i, wn(i,1), Tn(i,1))
end
1 1.79 3.51 2 4.65 1.35 3 7.73 0.81 4 10.45 0.60 5 13.16 0.48 6 16.07 0.39 7 18.51 0.34 8 21.48 0.29 9 23.70 0.27 10 26.15 0.24 11 27.84 0.23 12 30.07 0.21 13 31.42 0.20 14 34.49 0.18 15 37.31 0.17 16 39.31 0.16 17 41.60 0.15 18 43.90 0.14 19 48.23 0.13 20 53.93 0.12
% Start of Normalisation of mode shapes
for j = 1:length(wn)
eigvec(:,j) = eigvec(:,j) / eigvec(length(wn),j);
end
disp('Mode shapes:');
Mode shapes:
disp(eigvec);
1.0e+11 *
Columns 1 through 19
0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0157
0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0163
0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0001
0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0162
0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0157
0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0073
0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0034
0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0016
0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0007
0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 0.0000 0.0003
0.0000 -0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0001
0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000
0.0000 -0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 -0.0000 -0.0000 -0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000
0.0000 0.0000 -0.0000 -0.0000 -0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000
0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
Column 20
-3.9705
7.1448
-8.2594
6.9930
-3.7107
1.0641
-0.3051
0.0875
-0.0251
0.0071
-0.0019
0.0004
-0.0001
0.0000
-0.0000
0.0000
-0.0000
0.0000
-0.0000
0.0000
By adding the calculation of the damping coefficient and multiplying it with the mass matrix, you will obtain the desired damping matrix (C) using the inherent damping ratio of 2% for all vibration modes.
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related damping matrix c Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →