Skip to main content

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Documentation pages

pystran: Python for Structural Analysis

A simple structural analysis tool in Python, for structures consisting of truss and beam members, springs, and rigid bodies, both in two dimensions and in three dimensions. The finite-element principles and development of the techniques is described in the textbook "Finite Element Modeling of Structures with Shells and Beams ".

Alt pystran capabilities in graphic abstract

News

  • 07/16/2026: Refactor add methods.
  • 07/16/2026: Add tutorials as Jupyter notebooks.

Past news

Features & Limitations

  • The package analyzes two-dimensional and three-dimensional structures made up of truss (axial) members and beams (possibly in combination), rigid links, and general springs. Concentrated masses can be added at joints.
  • Linear statics and dynamics (free vibration) solvers are included.
  • Only elastic models can be solved.
  • For beams, only the Bernoulli-Euler model is implemented, so no shear deformation is taken into account.
  • Only straight members are treated.
  • It is assumed that the cross sections are doubly symmetric, and there is no coupling between the bending actions in the two orthogonal principal planes.
  • Coupling of axial and bending action is not implemented. This means that the neutral axis must pass through the centroid.
  • Warping of the cross sections is not modelled, hence only free torsion effects are included.
  • Member loading is not considered. All member loading needs to be converted to nodal forces by the user.
  • Member end releases (hinges) are not implemented. Internal hinges can be modelled with linked joints.
  • Degrees of freedom are only along the global Cartesian axes. Skew supports are not included (except with a penalty method based on springs)
  • Offsets of the beams from the joints are currently not implemented.
  • Rigid links between pairs of joints can be modeled with a penalty approach.

Requirements

pystran depends on the following Python packages:

  • NumPy
  • SciPy
  • Matplotlib
  • ipympl

These requirements can be easily satisfied by running the examples in the Spyder IDE.

Alternatively, run

python -m pip install -r ./requirements.txt

in the pystran folder.

Running

The easiest option is to use pystran.live. Just open a Jupyter notebook from the derivations or tutorials folders. However, only static figures are produced in the notebooks (JupyterLite does not handle well ipympl).

It is also possible to run pystran examples etc. in mybinder. It will take a minute to spin it up. It has an advantage over the previous method: Interactive figures are available, just put an additional line at the top of the imports:

%matplotlib widget

This package is distributed through the official Python channels (https://pypi.org). Just do

pip install pystran

It may also to be downloaded from GitHub as a zip file, and expanded in some convenient location. The pystran folder can be located by looking for this README.md file.

The easiest way to run a pystran example as a script is to download and install Spyder 6. Detailed instructions are provided.

It is also possible to run simulations using a plain Python in a terminal.

Tutorials

Step-by-step tutorials are available in the tutorials folder. For example, run tutorials in the pystran/tutorials in the terminal as

py tutorials/01_three_bars_tut.py

Or, use Spyder, which makes the whole process a lot easier to set up.

Finally, mybinder is a hassle-free way of running tutorials in the browser.

Testing

In the pystran/tests folder, run

py unittests_planar_truss.py 

and analogously for the other unit test files.

Documentation

Documentation of the package is provided in these HTML pages.

More details about the generation of the documentation are here.

If you are interested in how the techniques in the code are developed from the principles of weighted-residual methods (modern finite element analysis), check out the textbook "Finite Element Modeling of Structures with Shells and Beams ".

Past news

  • 05/21/2026: Refactoring.
  • 11/08/2025: Add publishing workflow.
  • 03/13/2025: Update documentation for the sphinx system.
  • 03/10/2025: Add rigid links and general springs.
  • 03/05/2025: Describe the operation of the scripts.
  • 02/12/2025: Make it possible to use general joint and member identifiers.
  • 02/05/2025: Add general springs to ground.
  • 01/30/2025: Add tutorials.
  • 01/22/2025: Implement initial functionality.

Metadata

Release files for pystran 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pystran 0.3.0
File Size Uploaded
pystran-0.3.0.tar.gz 6.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pystran 0.3.0
File Interpreter ABI Platform
pystran-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.1 MB

Release files / pystran-0.3.0.tar.gz

Download URL pystran-0.3.0.tar.gz
Size 6.1 MB
Tags Source
SHA-256 checksum
How to use checksums
5dcf14e49d245618b259d3c12b8a178db4eb75fdaef22f96ae13b18f628a3fe4
BLAKE2b-256 checksum
How to use checksums
462aceae17f1757f25c713fd504b968edf30b1cdf2b6946638ccefd2f87c6e7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Release files / pystran-0.3.0-py3-none-any.whl

Download URL pystran-0.3.0-py3-none-any.whl
Size 40.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f245cf6a5c6c5da102f619414c4720d840bb7b03badcbb528d001a5510e85cd7
BLAKE2b-256 checksum
How to use checksums
665b9506b017d5fbb50462d8a107c0c15370c46ff60f36ba76acfdc21bcf7e20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page