Commit 1cf0f84d authored by Andreas Zilian's avatar Andreas Zilian
Browse files

Sparse coefficent matrices

parent 0649cc5d
......@@ -27,7 +27,7 @@ classdef FeAnalysisDynamicFD < mafe.FeAnalysis
end
end
%% calculate dynamic response
function [u, lambda] = analyse(self)
function analyse(self)
% make sure the problem is initialised
self.fep.init();
% get system mass and stiffness matrix and force vector
......@@ -44,7 +44,7 @@ classdef FeAnalysisDynamicFD < mafe.FeAnalysis
self.X = zeros(self.fep.ndofs,length(self.L));
for ii = 1:length(self.L)
lambda = self.L(ii);
A = full( lambda^2 * self.M(act,act) + lambda * self.D(act,act) + self.K(act,act) );
A = lambda^2 * self.M(act,act) + lambda * self.D(act,act) + self.K(act,act);
% compute eigenvector by solution of linear system A(lambda_k)*x_k=e
% b = -A(:,1);
......@@ -55,7 +55,7 @@ classdef FeAnalysisDynamicFD < mafe.FeAnalysis
% compute eigenvector by singular value decomposition
% TODO: check if this is generalisable
[U,S,V] = svd(A);
[U,S,V] = svds(A, 1, 'smallest');
self.X(act,ii) = V(:,end);
% scale computed eigenvector
self.X(:,ii) = 1./sqrt(self.X(:,ii)'*self.M*self.X(:,ii)) * self.X(:,ii); % normalize mode wrt M
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment