anaStruct — The Complete Guide: 2D Frame and Truss Analysis in Python in a Few Lines
anaStruct is a light open-source Python library (LGPL-3.0 licence) for analysing plane frames and trusses. You build the structure from elements, define supports — hinged, fixed or spring — and loads, and get plots of bending moment, shear force, axial force and displacements. All of it in a few lines of code.

anaStruct
Ritchie Vink and contributors
Quick 2D frame and truss analysis in Python — moments, shear, axial force and displacements in a few lines of code.
Get it from the vendorWhat you get
- 2D frames and trusses — quick modelling from elements and nodes.
- Support types — hinges, fixed supports and spring supports.
- Ready-made plots — bending moment, shear, axial force and the deflected shape.
- Load cases — plus basic non-linear analysis.
- Steel section database — pick profiles without typing in properties.
Who it suits
anaStruct suits students who want to check a hand solution for a beam or frame, and engineers who want to turn a simple calculation into a script. It is not meant for 3D structures — for those you need another tool. It works best inside JupyterLab, where the plots appear right below the code.
Related tools
For 3D structural analysis in Python — Pynite. For 2D analysis with a graphical interface — Ftool. For properties of any cross-section shape — sectionproperties.

Pynite
D. Craig Brinck (JWock82)
A Python library for 3D finite element analysis of frames, plates and shear walls — static, P-Δ, modal and PDF reports.
Get it from the vendor
Ftool
PUC-Rio, Tecgraf
2D frame and beam analysis — fast to enter, aimed at learning and order-of-magnitude checks.
Get it from the vendor
sectionproperties
Robbie van Leeuwen
Section properties of any shape by finite elements — inertia, torsion, warping, shear centre and stresses in the section.
Get it from the vendor
Frame3DD
Frame3DD Project
3D frame and truss solver driven by an input file — excellent for automation and repeat runs.
Get it from the vendorKnown limitation: hinges in frames
Checking against a hand solution and a second program, we found that in version 1.7.0 the result is wrong where a beam hinged at its end meets a column at an angle in a statically indeterminate frame. This happens both with an end release (spring={1:0}) and with add_internal_hinge.
Example: a 6 × 4 m portal, columns EI = 2·10⁴ kNm², beam EI = 3·10⁴ kNm², one fixed base and one pinned base, the beam hinged at its left end and 10 kN/m on the beam. The force method gives a horizontal reaction of 3.75 kN at the pin; anaStruct gives 3.37 kN, about 10 % low. With a rotational spring in place of the hinge, the result does not even change monotonically with the spring stiffness.
A collinear hinge (a Gerber beam) is computed correctly. Also worth knowing: a second distributed load on the same element replaces the first rather than adding to it.
Until this is fixed, check hinged frames by hand or with a second program such as Pynite or OpenSees.
An alternative with a graphical interface: STRUCTSOFT from ADIT, the publisher of EngiFree, analyses 2D frames, trusses and arches for free. In the cross-check that revealed the problem, STRUCTSOFT gave 3.75 kN for the frame above, matching the hand solution. Guide: STRUCTSOFT — The Complete Guide.
The bottom line
anaStruct is the fast way to get force diagrams for a plane structure from Python. Simple, free and ideal for learning and for checking hand calculations.

