September 25, 2017, Monday
University of Colorado at Boulder Search A to Z Campus Map University of Colorado at Boulder CU 
Search Links


Elasticity.m

From MathBio

Jump to: navigation, search

Elasticity.m

Elasticity.m calculates the elasticity matrix from a submitted square matrix A.


   A = [0, 1000, 4000;
       0.7, 0, 0;
       0, 0.5, 0];
   count = length(A); %finding the dimensions of the matrix
   [B,C] = eig(A); % Calculating the eigenvalues and vectors of the matrix
   [D,E] = eig(A'); % Calculating the eigenvalues and vectors of the TRANSPOSED matrix
   lamda = max(max(C)); % Finding the dominant eigenvalue
   lamda2 = max(max(E));
   [i,j] = find(C == lamda); % Finding the position of the dominant eigenvalue
   [i2, j2] = find(E == lamda2); 
   W = B(:,i); % Right Eigenvector
   V = D(:,i2); % Left Eigenvector
   Z = zeros(count);
for i = 1:1:count
   for j = 1:1:count
   Z(i,j) = (A(i,j)/lamda)*((V(i)*W(j))/dot(W,V)); %calculate each aspect of Z
   end   
end