ACCESS THE COMPLETE LIBRARY OF COURSES & TUTORIALS ➡️
44. Visualising our output
Optimising for Larger Structures in Python
📂 Please log in or enroll to access resources

Summary

In this lecture, we'll cover:

  • How to visualise the undeformed and deformed shape of a truss structure using Matplotlib
  • How to plot members and nodal positions with appropriate aspect ratio and labelling
  • How to incorporate global nodal displacements into the plotted geometry
  • How to apply a displacement amplification (scale) factor for clear visualisation
  • How to annotate the plot with scale information and numerical displacement values

In this lecture, we focus on the final stage of our structural analysis: visualising the results. We reproduce the same plotting approach used previously for the two-bar example to demonstrate that the overall process remains unchanged. We create a figure and axes in Matplotlib, enforce an equal aspect ratio to preserve geometric accuracy, and manually plot the undeformed members and nodal positions. This reinforces how the structure’s geometry is defined directly from nodal coordinates.

We then build the deformed shape by adding the calculated global displacements to each node’s original coordinates. To make the deformation visible, we introduce an amplification factor and apply it consistently to the displacement terms. We enhance clarity by distinguishing the deformed configuration with a dashed red line and by annotating the plot with the displacement scale factor and selected nodal displacement values. This gives us both an intuitive visual understanding and precise numerical information in one clear graphic.

Next up:

In the next lecture, we begin Section 8, where we fully generalise our code so that it can analyse any truss structure from a single set of input data.

Tags

Matplotlib visualisationtruss deformation plottingdisplacement amplification factornodal displacement annotation

Please log in or enroll to continue

If you've already enrolled, please log in to continue.

The Direct Stiffness Method for Truss Analysis with Python

Build your own finite element truss analysis software using Python and tackle large scale structures.

After completing this course...

  • You’ll understand how to use the Direct Stiffness Method to build complete structural models that can be solved using Python.
  • You’ll have your own analysis programme to identify displacements, reactions and internal member forces for any truss.
  • You’ll understand how common models of elastic behaviour such as plane stress and plane strain apply to real-world structures.
Next Lesson
45. Section 8 overview