Skip to main content

Python Structural Analysis package

Project description

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

  • 05/21/2026: Refactoring.

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

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

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 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.

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

  • 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pystran-0.2.2.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pystran-0.2.2-py3-none-any.whl (40.3 kB view details)

Uploaded Python 3

File details

Details for the file pystran-0.2.2.tar.gz.

File metadata

  • Download URL: pystran-0.2.2.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pystran-0.2.2.tar.gz
Algorithm Hash digest
SHA256 4085e5af5fb8619cdb654ee1b1df1e5c90f88f80b9d6ea6a508eb33b8aab6f56
MD5 942882c157d24d33b98d02596d2f9b2d
BLAKE2b-256 468268a4fd819c4713a72c973975ac3ea98882ff414e58c44af0a982ce9242ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pystran-0.2.2.tar.gz:

Publisher: pubflow.yml on PetrKryslUCSD/pystran

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pystran-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pystran-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 40.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pystran-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04d35dc76a8f26c0645b5cf0b53f215d3e2f3ac75dcd71d3c9d3f39b1d77daa2
MD5 dd4bbd3b0cf36534163853e6eb5acebd
BLAKE2b-256 2d6a47b5149e6ca02c3c3a25aefa9384c8f90a9e6ce471acdf38c2e0dc622884

See more details on using hashes here.

Provenance

The following attestation bundles were made for pystran-0.2.2-py3-none-any.whl:

Publisher: pubflow.yml on PetrKryslUCSD/pystran

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page