Dummy Test Data
Mass=276.7;
I=[11.64 15.8 15.69 -.8 3.2 .9];
ModeShapes=[-0.0215 -0.1682 -0.2146 0.1786 0.1355 -0.0028;
0.4662 -0.2614 -0.0813 -0.0772 0.0042 -0.0261;
-0.1276 -0.8945 0.0951 -0.0358 0.0308 0.0024;
1.0000 -0.1792 1.0000 1.0000 -0.1344 0.5292;
0.1440 1.0000 0.5528 -0.4136 1.0000 0.0781;
0.0508 -0.1289 -0.3124 -0.2263 -0.0161 1.0000];
Code:
function [KE_Distribution_Matrix]= Kinetic_Energy_Distribution(Mass,I,ModeShapes)
Ixx=I(1);
Iyy=I(2);
Izz=I(3);
n=length(ModeShapes);
for i=1:n
X_Mode(i)=ModeShapes(n,1);
Y_Mode(i)=ModeShapes(n,2);
Z_Mode(i)=ModeShapes(n,3);
Theta_Mode(i)=ModeShapes(n,4);
Rho_Mode(i)=ModeShapes(n,5);
Phi_Mode(i)=ModeShapes(n,6);
KE_Dom(i)=(Mass*(X_Mode(i)^2+Y_Mode(i)^2+Z_Mode(i)^2)+Ixx*(Theta_Mode(i)^2)+Iyy*(Rho_Mode(i)^2)+Izz*(Phi_Mode(i)^2));
KE_X(i)=(Mass*(X_Mode(i)^2))/KE_Dom(i);
KE_Y(i)=(Mass*(Y_Mode(i)^2))/KE_Dom(i);
KE_Z(i)=(Mass*(Z_Mode(i)^2))/KE_Dom(i);
KE_Theta(i)=(Ixx*(Theta_Mode(i))^2)/KE_Dom(i);
KE_Rho(i)=(Iyy*(Rho_Mode(i))^2)/KE_Dom(i);
KE_Phi(i)=(Izz*(Phi_Mode(i))^2)/KE_Dom(i);
end
KE_XF=KE_X*100;
KE_YF=KE_Y*100;
KE_ZF=KE_Z*100;
KE_ThetaF=KE_Theta*100;
KE_RhoF=KE_Rho*100;
KE_PhiF=KE_Phi*100;
KE_Distribution_Matrix=[KE_XF; KE_YF; KE_ZF; KE_ThetaF; KE_RhoF; KE_PhiF];
KE_Distribution_Matrix=KE_Distribution_Matrix';