2D Truss FEA Calculator

Finite element analysis of 2D pin-jointed trusses. Define nodes, elements, supports, and loads, then solve for displacements, reactions, and member forces.

Linear elastic Global stiffness method Visualization

Model definition

Applies to all elements (steel ≈ 210000 MPa).

Nodes

ID x y Support Fx Fy

Support types: free, pinned (Ux=Uy=0), roller X (Ux=0), roller Y (Uy=0).

Elements

ID Node i Node j Area A Unit

Area units consistent with E (e.g., mm² with MPa, in² with ksi/psi).

Visualization

Undeformed (gray) and scaled deformed (blue) shapes. Axial forces shown in red (tension) and green (compression).

Results

Run the analysis to see displacements, reactions, and member forces.

How the 2D truss FEA calculator works

This tool implements the classical finite element formulation for 2D pin-jointed trusses. Each bar element carries only axial force, and all loads are applied at the nodes. The solution follows the global stiffness method.

1. Element stiffness in local and global coordinates

For an element between nodes \(i\) and \(j\) with Young’s modulus \(E\), cross-sectional area \(A\), and length \(L\):

Element length:

\[ L = \sqrt{(x_j - x_i)^2 + (y_j - y_i)^2} \]

Direction cosines:

\[ c = \frac{x_j - x_i}{L}, \quad s = \frac{y_j - y_i}{L} \]

Local axial stiffness matrix:

\[ k^{(e)}_{\text{local}} = \frac{AE}{L} \begin{bmatrix} 1 & -1 \\ -1 & 1 \end{bmatrix} \]

In global coordinates, each element has four degrees of freedom: \(u_{ix}, u_{iy}, u_{jx}, u_{jy}\). Using the direction cosines, the 4×4 global element stiffness matrix is:

\[ k^{(e)} = \frac{AE}{L} \begin{bmatrix} c^2 & cs & -c^2 & -cs \\ cs & s^2 & -cs & -s^2 \\ -c^2 & -cs & c^2 & cs \\ -cs & -s^2 & cs & s^2 \end{bmatrix} \]

2. Global stiffness matrix and boundary conditions

The calculator assembles the global stiffness matrix \(K\) by adding each element’s 4×4 matrix into the appropriate rows and columns corresponding to the node degrees of freedom.

Supports are applied by constraining degrees of freedom:

  • Free: no constraints.
  • Pinned: \(u_x = 0\), \(u_y = 0\).
  • Roller X: \(u_x = 0\), \(u_y\) free.
  • Roller Y: \(u_y = 0\), \(u_x\) free.

The reduced system for unknown displacements \(u_f\) is:

\[ K_{ff} \, u_f = F_f \]

3. Solving for displacements, reactions, and member forces

Once \(u_f\) is found, the full displacement vector \(u\) is reconstructed by inserting zeros at constrained DOFs. Support reactions are obtained from:

\[ R = K \, u - F \]

For each element, the end displacements are projected along the element axis to compute axial force:

\[ u_{\text{local}} = \begin{bmatrix} u_i^{\parallel} \\ u_j^{\parallel} \end{bmatrix} = \begin{bmatrix} c & s & 0 & 0 \\ 0 & 0 & c & s \end{bmatrix} \begin{bmatrix} u_{ix} \\ u_{iy} \\ u_{jx} \\ u_{jy} \end{bmatrix} \]

\[ f^{(e)} = \frac{AE}{L} \begin{bmatrix} -1 & 1 \end{bmatrix} u_{\text{local}} \]

Positive axial force is reported as tension, negative as compression. Stress is simply \(\sigma = f^{(e)} / A\).

4. Typical sources of errors

  • Singular matrix / instability: structure not adequately supported or has a mechanism.
  • Zero-length element: nodes with identical coordinates.
  • Inconsistent units: e.g., using mm for length but in² for area with MPa for E.

Disclaimer

This calculator is for educational use and preliminary checks. For safety-critical or code-compliant design, always verify results with professional structural analysis software and a qualified engineer.

2D Truss FEA – Frequently Asked Questions

What does this 2D truss FEA calculator do?

It performs a linear elastic finite element analysis of 2D truss structures. You define nodes, elements, supports, and nodal loads. The tool assembles the global stiffness matrix, solves for nodal displacements, computes support reactions, and reports axial forces and stresses in each member, along with a visual deformed shape.

Which units should I use?

Use a consistent set of units. For example, if you choose mm for length and MPa for E, then areas must be in mm² and forces in N. If you use inches and psi, areas must be in in² and forces in lb. The calculator does not convert between incompatible unit systems automatically.

How do I model supports correctly?

At a minimum, you need enough constraints to prevent rigid body motion. A common pattern is one pinned support (fixes both x and y) and one roller support (fixes only one direction). Avoid over-constraining the structure unless you intend to model a statically indeterminate truss, which FEA can handle but may increase reaction redundancy.

Can I apply distributed loads on members?

No. This simplified truss FEA tool supports only nodal forces. To approximate a distributed load on a member, convert it to equivalent nodal forces at the member ends based on statics, or use a frame/beam FEA tool that includes bending.

Why do I see very large displacements?

Large displacements usually indicate a very flexible structure (small E or area), a missing support, or a mechanism. Check your units, material properties, and boundary conditions. Also remember that the plotted deformed shape is scaled for visibility; use the numeric displacement table for actual values.