%--- Calculate displacements ---------------------------------------------%
% Build global load vector
[P]=buildload(X,IX,ne,P,loads,mprop);
% Build global stiffness matrix
[Kmatr]=buildstiff(X,IX,ne,mprop,Kmatr);
% Enforce boundary conditions
[Kmatr,P]=enforce(Kmatr,P,bound);
% Solve system of equations
D=Kmatr\P;
% Calculate element stress and strain
[strain,stress]=recover(mprop,X,IX,D,ne,strain,stress);
%--- Plot results --------------------------------------------------------%
PlotStructure(X,IX,ne,neqn,bound,loads,D,stress) % Plot structure
Virtual Work Principle
For truss elements, displacement and external forces only applied in nodes, surface traction ({F}=0 and body force {Φ}=0). Now we have:
Where displacement of a truss element {d}={uiviujvj}T , element force Ne=AeEϵ and L0e is initial length of element e
The VWP hold for any {D} and {d}
[ke] Local stiffness matrix formulation
B0 is strain-displacement matrix
Assembly of element matrix to global matrix
Global stiffness matrix [K]=∑e[ke]
Enforce Boundary Conditions
Solve {D}
Example
BC: x=y=0 at node 1, x=0 at node 2 and Fy=-0.01 at node 3
How do you like this Post?
Attachment
Download the code from below GitHub repo 👇below, please give a five-star 👆
Acknowledgment: Content Originally from Notes and Exercise for the Course Finite Element Methods 41525, Ole Sigmund, Department of Mechanical Engineering, Technical University of Denmark