Commit 098a055b authored by Andreas Zilian's avatar Andreas Zilian
Browse files

Make sure internal variable is intialised.

parent fa55e1d9
......@@ -2,13 +2,14 @@ classdef Member2D < mafe.Li2Element2D
% member (= beam + truss) finite element in the plane (2D)
properties
%
%
end
methods
%% constructor
function obj = Member2D(varargin)
obj = obj@mafe.Li2Element2D(varargin{:});
obj.internal = zeros(6);
end
%% activation of dofs at the nodes of the element
function activateDofTypes(self)
......@@ -39,6 +40,11 @@ classdef Member2D < mafe.Li2Element2D
end
%% calculation of element stiffness matrix
function ele_mat = stiffness(self)
% global element matrix
ele_mat = self.stiffnessElastic() + self.stiffnessGeometric();
end
%% calculation of element elastic stiffness matrix
function ele_mat = stiffnessElastic(self)
% transformation matrix
[L, T] = self.transform();
% get parameters
......@@ -56,7 +62,26 @@ classdef Member2D < mafe.Li2Element2D
0, -h3, -h2, 0, +h3, -h2 ;
0, +h2, +h1, 0, -h2, 2*h1 ];
% global element matrix
ele_mat = T' * ele_mat_local * T;
ele_mat = T' * (ele_mat_local) * T;
end
%% calculation of element geometric stiffness matrix
function ele_mat = stiffnessGeometric(self)
% transformation matrix
[L, T] = self.transform();
% get parameters
N0 = self.internal(4); % extract normal force
% local element matrix: geometric stiffness
h5 = N0*6/5/L;
h6 = N0/10;
h7 = N0*L/30;
ele_mat_local = [ 0, 0, 0, 0, 0, 0 ;
0, +h5, +h6, 0, -h5, +h6 ;
0, +h6, 4*h7, 0, -h6, -h7 ;
0, 0, 0, 0, 0, 0 ;
0, -h5, -h6, 0, +h5, -h6 ;
0, +h6, -h7, 0, -h6, 4*h7 ];
% global element matrix
ele_mat = T' * (ele_mat_local) * T;
end
%% calculation of element mass matrix
function ele_mat = mass(self)
......
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