A Python library for stability analysis of structures
Project description
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.
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)
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
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
Triangulated Frame
Trussed Column
Arch
1st mode
2nd mode
Mult-storey Frame
1st mode
4th mode
2nd mode (Braced)
Portal Frame
Overhang
Truss Cantilever
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stablex-0.1.3.tar.gz.
File metadata
- Download URL: stablex-0.1.3.tar.gz
- Upload date:
- Size: 50.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e123245180e9d6e25c2114c472bb07453881d5194f8ff4fdf69b8ffb348550ca
|
|
| MD5 |
34149107a5bd436fb518bde08f2b720c
|
|
| BLAKE2b-256 |
807d22274ebccfab23e05b83d754eecd8327e62e35c31233d134aeaa01c1a9fd
|
File details
Details for the file stablex-0.1.3-py3-none-any.whl.
File metadata
- Download URL: stablex-0.1.3-py3-none-any.whl
- Upload date:
- Size: 56.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9d1d238ffb102b0850f1a4506e135fb2221c1ed9937bf97fde5b23e4c2dcee9
|
|
| MD5 |
8d02d233cde6bda4b24a89232a51b5e9
|
|
| BLAKE2b-256 |
ed64b2c8e41de36ef29834d16b046eaf1f80d9d6318c9cd4d9744e1b871b1765
|