Section 2.1 of Chapter 2: Three-Dimensional Truss Structures
Large Displacements of 3D Truss Structures
A total-potential-energy formulation for straight, prismatic three-dimensional truss elements, including exact displacement kinematics, a consistent tangent matrix, Newton–Raphson solution, and a comparison with ANSYS.
Linear elastic materialSmall strainLarge displacementMATLAB tested in R2017b and R2026a
01
Overview and assumptions
Consider a spatial structure assembled from straight, prismatic, two-node truss elements. Each element carries axial force only.
MaterialLinear elastic
StrainSmall
DisplacementPotentially large
Notation
u
Nodal-displacement vector in the global reference frame xyz
F
Nodal-force vector in the global reference frame xyz
U,V,Π
Strain energy, potential of the applied forces, and total potential energy
σ,ε
Axial stress and engineering strain
E,A,L
Young's modulus, cross-sectional area, and initial element length
I3
Three-by-three identity matrix
02
Three-dimensional element kinematics
For the initial nodal coordinates(x1,y1,z1) and(x2,y2,z2), the initial element length is:
L=(x2−x1)2+(y2−y1)2+(z2−z1)2
Let(ui,vi,wi) be the displacement components of nodei. The deformed length is:
The complete six-component strain gradient and the exact Hessian are:
∂uel∂ε=LLf1a
∂uel2∂2ε=LLf1G−LLf31aaT
When axial deformation is very small, the approximation Lf≈L may be used. This gives:
∂uel∂ε≈L21a
Exact derivative used in the program
Replacing Lf by L does not by itself reduce the exact Hessian to(1/L2)G. That shorter expression also omits the outer-product term. The supplied deriv.m uses the exact gradient and exact Hessian shown above.
06
Newton–Raphson solution and MATLAB implementation
At each iteration, the program assembles the structural tangent matrix and residual vector, applies the displacement constraints, and solves
Δu(i)=−(Kt(i))−1Ψ(i)
u(i+1)=u(i)+Δu(i)
deriv.mExact derivatives
% Exact engineering strain and derivatives
ep = Lf/L - 1;
q = [dx+du; dy+dv; dz+dw];
a = [-q; q];
G = [eye(3) -eye(3); -eye(3) eye(3)];
ep1 = a/(L*Lf);
ep2 = G/(L*Lf) - (a*a')/(L*Lf^3);
stiff.mElement contribution
fel = EA*L*ep*ep1;
kel = EA*L*(ep*ep2 + ep1*ep1');
K(ip,ip) = K(ip,ip) + kel;
F(ip) = F(ip) + fel;
MATLAB compatibility
Tested in MATLAB R2017b and MATLAB R2026a. Both versions produced the same displacement history and converged at all five load steps. The code uses standard MATLAB syntax and is expected to be compatible with intermediate and newer MATLAB versions.
07
Numerical example and ANSYS comparison
The example in gen.m contains 18 repeated spatial modules, 76 nodes, 234 truss elements, and 228 structural degrees of freedom. The complete load is applied in five equal steps.
At load step 4, the three displacement components of node 76 are compared below. The values are expressed in millimetres.
Solution
u
v
w
MATLAB
1760.9
2508.7
−2639.6
ANSYS
1775.3
2520.0
−2665.3
Relative difference
0.81%
0.45%
0.96%
The agreement is close, with every reported component differing by less than 1%. The supplied ANSYS macro uses BEAM188 with a very small bending inertia to approximate an axial member; therefore, it is not mathematically identical to the pure truss model. ANSYS did not converge for the fifth load level, whereas the MATLAB program converged in seven iterations.
Figure 1. Successive deformed configurations of the 3D truss structure. Node 76 is identified at the top.
Scope
Within the stated assumptions, the formulation uses exact displacement kinematics and a consistent tangent. The number of load steps controls the numerical continuation path, not the converged equilibrium state. Local buckling of individual truss members is not included.
08
Program files
The MATLAB archive contains seven commented source files and a short README. The ANSYS macro is supplied separately so that the comparison model remains transparent.