Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
% Element connectivity
connec=zeros(nel,2);
connec = [1 2 ; % 1st and 2nd node of element 1
2 4 ; % 1st and 2nd node of element 2
1 3 ; % 1st and 2nd node of element 3
3 4 ; % 1st and 2nd node of element 4
2 3]; % 1st and 2nd node of element 5
% Boundary conditions
nf = ones(nnd, nodof); % Initialize the matrix nf to 1
nf(1,1) = 0 ; % Prescribed nodal freedom of node 1
nf(1,2) = 0 ; % Prescribed nodal freedom of node 1
nf(4,1) = 0 ; % Prescribed nodal freedom of node 4
nf(4,2) = 0 ; % Prescribed nodal freedom of node 4
% loading
load = zeros(nnd, 2);
load(2,:)=[0 -150000]; % forces in X and Y directions at node 2
-1-
D:\PhD\Coursework\CEN-545 Finite element methods\CEN-545 PRA\Copy_of_trussfivebar.m Thursday, April 30, 2015 8:54 PM
-2-
D:\PhD\Coursework\CEN-545 Finite element methods\CEN-545 PRA\Copy_of_trussfivebar.m Thursday, April 30, 2015 8:54 PM
-3-
D:\PhD\Coursework\CEN-545 Finite element methods\CEN-545 PRA\Copy_of_trussfivebar.m Thursday, April 30, 2015 8:54 PM
end
fprintf( '\n');
% Print Nodal freedom
fprintf( '------------------------------------------------------ \n');
fprintf( 'Node disp_U disp_V\n');
for i=1:nnd
fprintf( ' %g, %g, %g\n',i, nf(i,1), nf(i,2));
end
fprintf( '\n');
% Print Nodal loads
fprintf( '------------------------------------------------------ \n');
fprintf( 'Node load_X load_Y\n');
for i=1:nnd
fprintf( '%g, %07.2f, %07.2f\n',i, load(i,1), load(i,2));
end
%
fprintf( '------------------------------------------------------ \n');
fprintf( '\n');
fprintf( 'Total number of active degrees of freedom, n = %g\n',n);
fprintf( '\n');
-4-