A Python library for stability analysis of structures
>> pip install stablex
# 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
With an error = 0.05%
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
With an error = 0.75%
Output: Critical Buckling Load: 666.667 N
1st mode
2nd mode
1st mode
4th mode
2nd mode (Braced)
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.
stablex
was created by Hazem Kassab. It is licensed under the terms of the MIT license.
stablex
was created with cookiecutter
and the py-pkgs-cookiecutter
template.