Skip to main content

stableX

A Python library for stability analysis of structures

Installation

>> pip install stablex

Usage

# pinned_column.py

import stablex as stx

# column length
l = 3000

# create nodes at quarter lengths
n1 = stx.Node(0, 0)
n2 = stx.Node(0, 0.25*l)
n3 = stx.Node(0, 0.5*l)
n4 = stx.Node(0, 0.75*l)
n5 = stx.Node(0, l)

# create section
section = stx.Rectangle(100, 100)

# create Frame elements and specify node connectivity and geometric non-linearity (Modulus of elasticity = 200000 MPa by default)
e1 = stx.FrameElement(n1, n2, section, True)
e2 = stx.FrameElement(n2, n3, section, True)
e3 = stx.FrameElement(n3, n4, section, True)
e4 = stx.FrameElement(n4, n5, section, True)

# assign boundary conditions (pinned at base, roller at top)
n1.x_dof.restrained = True
n1.y_dof.restrained = True
n5.x_dof.restrained = True

# assign load
p = -1
n5.y_dof.force = p

# create structure assembly of elements
structure = stx.Structure([e1, e2, e3, e4])

# create an Eigenvalue solver
solver = stx.EigenSolver(structure)

# solve for the required mode shape
eigenvalue, eigenvector = solver.solve(mode_shape=1)

# visualize the buckling mode shape
stx.plot_structure(structure, 1000)

Executing this script will open a window displaying the buckling mode and print the associated critical buckling load value.

Alt text

print(f"Critical Buckling Load: {eigenvalue/1000:.3f} N")
 Output: Critical Buckling Load: 1828.640 kN 

Verification with Euler's formula

$$ P_{cr} = \frac{\pi^2 EI}{l^2} = \frac{\pi^2 \times 200 \times 10^3 \times (100)^4/12}{3000^2 \times 1000} = 1827.705 kN $$

With an error = 0.05%

For the second mode:

eigenvalue, eigenvector = solver.solve(mode_shape=2)

stx.plot_structure(structure, 1000)

Alt text

print(f"Critical Buckling Load: {eigenvalue/1000:.3f} N")
 Output: Critical Buckling Load: 7365.812 kN 

Verification with Euler's formula

$$ P_{cr} = n^2 \frac{\pi^2 EI}{l^2} = 2^2 \frac{\pi^2 \times 200 \times 10^3 \times (100)^4/12}{3000^2 \times 1000} = 7310.818 kN $$

With an error = 0.75%

Other Examples:

Rigid Bars with Intermediate Spring

Alt text Alt text

 Output: Critical Buckling Load: 666.667 N 

$$ P_{cr} = 2 \frac{k}{l} = 2 \frac{1 \times 10^6}{3000} = 666.667 N $$

With an error = 0.75%

Trapezoidal Frame

Alt text

Triangulated Frame

Alt text

Trussed Column

Alt text

Arch

1st mode

Alt text

2nd mode

Alt text

Mult-storey Frame

1st mode

Alt text

4th mode

Alt text

2nd mode (Braced)

Alt text

Portal Frame

Alt text

Overhang

Alt text

Truss Cantilever

Alt text

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

stablex was created by Hazem Kassab. It is licensed under the terms of the MIT license.

Credits

stablex was created with cookiecutter and the py-pkgs-cookiecutter template.

Metadata

Release files for stableX 0.1.3

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

Source distribution (sdist)

Source distribution for stableX 0.1.3
File Size Uploaded
stablex-0.1.3.tar.gz 50.8 kB Details

Built distribution (wheel)

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

Total release size: 107.2 kB

Release files / stablex-0.1.3.tar.gz

Download URL stablex-0.1.3.tar.gz
Size 50.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e123245180e9d6e25c2114c472bb07453881d5194f8ff4fdf69b8ffb348550ca
BLAKE2b-256 checksum
How to use checksums
807d22274ebccfab23e05b83d754eecd8327e62e35c31233d134aeaa01c1a9fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Release files / stablex-0.1.3-py3-none-any.whl

Download URL stablex-0.1.3-py3-none-any.whl
Size 56.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9d1d238ffb102b0850f1a4506e135fb2221c1ed9937bf97fde5b23e4c2dcee9
BLAKE2b-256 checksum
How to use checksums
ed64b2c8e41de36ef29834d16b046eaf1f80d9d6318c9cd4d9744e1b871b1765
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Release history Release notifications | RSS feed

This release

0.1.3 This release

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