2D Truss Analyzer
Back
Structural FEM

2D Truss Analyzer

Direct Stiffness Method (FEM) solver for planar trusses. Members color-coded by axial force — tension in red, compression in blue.

Truss Configuration
Preset Geometry
Young's Modulus E
GPa
Cross-section Area A
cm²
Nodal Loads
Positive = right / up. Edit and press Enter.

Assemble element stiffness matrices into the global system and solve:

$$[K]\{u\}=\{F\}$$

Member axial force from nodal displacements:

$$f = \frac{EA}{L}\bigl[(u_j-u_i)\cos\theta + (v_j-v_i)\sin\theta\bigr]$$

Element stiffness: $k = EA/L$, transformed to global DOFs via rotation matrix.

Results
Max Tension [kN]
Max Compression [kN]
Max Displacement [mm]
Nodes / Members
Truss
Tension (+)
Compression (−)
Zero force
Support node

What is the Direct Stiffness Method for Trusses?

🙋
What exactly is the "Direct Stiffness Method" this simulator is using? It sounds complicated.
🎓
Basically, it's the core math behind most structural analysis software. In practice, we treat each truss member as a simple spring, create a tiny "stiffness matrix" for it, and then assemble all of them into one big system equation for the whole structure: $[K]\{u\}=\{F\}$. Try adding a member in the simulator—you're literally adding another small matrix to that global $[K]$.
🙋
Wait, really? So the colors (red/blue) for tension/compression come from solving that big equation? How?
🎓
Exactly! Once we solve for the nodal displacements $\{u\}$, we plug them back into each member's equation. For instance, if a member gets longer, it's in tension (red). If it squishes shorter, it's in compression (blue). The exact force depends heavily on the E and A values you can adjust with the sliders above—crank up the Young's Modulus E and see how the forces change!
🙋
So the parameters E and A are just in that force formula? Why are they so important for design?
🎓
Great question. They define the member's axial stiffness $EA/L$. A stiffer member (high E or large A) attracts more force in a statically indeterminate truss—like a stiffer spring in a network. This is key for sizing members. In the simulator, try designing a simple bridge, then change the cross-section Area A of one member and watch how the force redistribution changes the colors on the others.

Physical Model & Key Equations

The fundamental system equation assembled from all truss members. Each member acts as a spring oriented in 2D space, contributing to the overall stiffness matrix $[K]$.

$$[K]\{u\}= \{F\}$$

$[K]$: Global stiffness matrix (assembled from all elements).
$\{u\}$: Vector of all unknown nodal displacements ($u_i, v_i$).
$\{F\}$: Vector of applied nodal forces.
Solving this gives you how much every node in the truss moves.

Once displacements are known, the axial force in any member (between nodes i and j) is calculated. This is the formula that determines the tension (positive) or compression (negative) visualized in the simulator.

$$f = \frac{EA}{L}\bigl[(u_j-u_i)\cos\theta + (v_j-v_i)\sin\theta\bigr]$$

$E$: Young's Modulus (material stiffness, set by the slider).
$A$: Cross-sectional Area (member thickness, set by the slider).
$L, \theta$: Member length and angle from horizontal.
$u, v$: Nodal displacements from the system solution.
The term in brackets $[...]$ is essentially the member's elongation projected along its axis.

Real-World Applications

Bridge Design & Optimization: Engineers use this exact analysis to size members in steel truss bridges. By running analyses with different load cases (like a truck on the bridge), they can identify which members are in high compression and need to be reinforced, directly using the force values $f$ calculated by this formula.

Roof and Tower Structures: The analysis of transmission towers, radio masts, and warehouse roofs relies on planar truss models. The color-coding is vital for quickly spotting overstressed members—compression members (blue) often fail by buckling, which requires a different check than tension members (red).

CAE Software Verification: The formulation here is identical to elements like ANSYS LINK180 or Abaqus T2D2. This tool is perfect for performing a "sanity check" on a small model before building a complex, time-consuming FEM analysis in commercial software, ensuring your boundary conditions and loads make sense.

Educational Hand Calculations: In structural engineering courses, students learn to solve small trusses by hand. This simulator validates those manual matrix solutions instantly. Changing E and A shows the principle of load path and how stiffness distribution affects force flow in statically indeterminate structures.

Common Misunderstandings and Points to Note

When you start using this simulator, there are a few points you should be aware of. First, we often hear comments like, "The displacement is too small to see! Is the calculation wrong?" For an actual steel bridge (E=205 GPa), if you apply a 10 kN load to a member with a cross-sectional area of 1000 mm², the elongation is on the order of mere microns. Remember that the simulator exaggerates displacements for visibility. While you can trust these calculation results in practice, pay close attention to the modeling of "support conditions". Here we use simple pin supports, but in actual structures, rotation and movement are often somewhat restrained, which can significantly change the results.

Next, regarding the setting of parameters "E" and "A". For example, if you make "A" extremely small, the axial force remains the same but the displacement becomes enormous and unrealistic. Conversely, if you set "E" to a wood value (approx. 10 GPa), you get about 20 times the displacement under the same load compared to steel (approx. 200 GPa). While evaluating the effect of changing materials is good, note that if a member becomes extremely slender, buckling—a different phenomenon—becomes dominant. You cannot make safety judgments based solely on this tool's results in such cases.

Finally, be mindful of overlooking "zero-force members". At specific joints with no applied load, some members will have zero axial force due to force equilibrium. The simulator might display zero axial force in black, but in design, these are often members necessary to maintain the structural shape, not "unnecessary members". Try checking this in a K-truss, for instance.