• Stars
    star
    350
  • Rank 121,229 (Top 3 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

2D structural analysis in Python

anaStruct 2D Frames and Trusses

Python tests Documentation Status

Analyse 2D Frames and trusses for slender structures. Determine the bending moments, shear forces, axial forces and displacements.

Installation

For the actively developed version:

$ pip install git+https://github.com/ritchie46/anaStruct.git

Or for a release:

$ pip install anastruct

Read the docs!

Documentation

Questions

Got a question? Please ask on gitter.

Includes

  • trusses ✔️
  • beams ✔️
  • moment lines ✔️
  • axial force lines ✔️
  • shear force lines ✔️
  • displacement lines ✔️
  • hinged supports ✔️
  • fixed supports ✔️
  • spring supports ✔️
  • q-load in elements direction ✔️
  • point loads in global x, y directions on nodes ✔️
  • dead load ✔️
  • q-loads in global y direction ✔️
  • hinged elements ✔️
  • rotational springs ✔️
  • non-linear nodes ✔️
  • geometrical non linearity ✔️
  • load cases and load combinations ✔️
  • generic type of section - rectangle and circle ✔️
  • EU, US, UK steel section database ✔️

Examples

from anastruct import SystemElements
import numpy as np

ss = SystemElements()
element_type = 'truss'

# Create 2 towers
width = 6
span = 30
k = 5e3

# create triangles
y = np.arange(1, 10) * np.pi
x = np.cos(y) * width * 0.5
x -= x.min()

for length in [0, span]:
    x_left_column = np.ones(y[::2].shape) * x.min() + length
    x_right_column = np.ones(y[::2].shape[0] + 1) * x.max() + length

    # add triangles
    ss.add_element_grid(x + length, y, element_type=element_type)
    # add vertical elements
    ss.add_element_grid(x_left_column, y[::2], element_type=element_type)
    ss.add_element_grid(x_right_column, np.r_[y[0], y[1::2], y[-1]], element_type=element_type)

    ss.add_support_spring(
        node_id=ss.find_node_id(vertex=[x_left_column[0], y[0]]),
        translation=2,
        k=k)
    ss.add_support_spring(
        node_id=ss.find_node_id(vertex=[x_right_column[0], y[0]]),
        translation=2,
        k=k)

# add top girder
ss.add_element_grid([0, width, span, span + width], np.ones(4) * y.max(), EI=10e3)

# Add stability elements at the bottom.
ss.add_truss_element([[0, y.min()], [width, y.min()]])
ss.add_truss_element([[span, y.min()], [span + width, y.min()]])

for el in ss.element_map.values():
    # apply wind load on elements that are vertical
    if np.isclose(np.sin(el.ai), 1):
        ss.q_load(
            q=1,
            element_id=el.id,
            direction='x'
        )

ss.show_structure()
ss.solve()
ss.show_displacement(factor=2)
ss.show_bending_moment()

from anastruct import SystemElements

ss = SystemElements(EA=15000, EI=5000)

# Add beams to the system.
ss.add_element(location=[0, 5])
ss.add_element(location=[[0, 5], [5, 5]])
ss.add_element(location=[[5, 5], [5, 0]])

# Add a fixed support at node 1.
ss.add_support_fixed(node_id=1)

# Add a rotational spring support at node 4.
ss.add_support_spring(node_id=4, translation=3, k=4000)

# Add loads.
ss.point_load(Fx=30, node_id=2)
ss.q_load(q=-10, element_id=2)

# Solve
ss.solve()

# Get visual results.
ss.show_structure()
ss.show_reaction_force()
ss.show_axial_force()
ss.show_shear_force()
ss.show_bending_moment()
ss.show_displacement()

Real world use case.

Non linear water accumulation analysis

More Repositories

1

lsh-rs

Locality Sensitive Hashing in Rust with Python bindings
Rust
109
star
2

vanilla-machine-learning

vanilla machine learning
Jupyter Notebook
107
star
3

sagemaker-custom-model

Deploy your pretrained model on AWS SageMaker
Python
35
star
4

serverless-model-aws

Deploy any Machine Learning model serverless in AWS.
Python
25
star
5

dbignore

Automatically ignore directories in your Dropbox folder
Go
13
star
6

computer-build-me-a-bridge

Utilizing genetic strategies to evaluate structural configurations.
Python
10
star
7

sequence

Various models for handling sequence related data.
Python
10
star
8

FORM

First Order Reliability Methods. Taylor series approximation of the performance function of different stochastic variables.
Python
9
star
9

GOPHY

Create GIF files from images.
C
8
star
10

vi-torch

Python
8
star
11

pydata-pymc3-prophet

Presentation for PyData Amsterdam 2019
Jupyter Notebook
7
star
12

M-N-Kappa

JavaScript
7
star
13

music-classification

Deep learning music classification
Jupyter Notebook
6
star
14

fastpelt

Changepoint detection with Pruned Exact Linear Time
Rust
5
star
15

monkey-rust

Rust implementation of the famous Monkey programming language.
Rust
3
star
16

vibrations

Python
3
star
17

cookiecutter-kubernetes-flask-nginx

Shell
3
star
18

hulk

HULK DoS tool ported to Scala (inspired by https://github.com/grafov/hulk)
Scala
3
star
19

dumpster

Simple model registry that saves model state, source code and global imports.
Python
2
star
20

tectime-training

Python
1
star
21

airflow

Setup and utilities for airflow focussed on EMR.
Python
1
star
22

column-design

JavaScript
1
star
23

base-flask-mvc

A flask mvc with user registration/ logins
CSS
1
star
24

concatPDF

Build process for merging PDF files. Made in Python 3.
Python
1
star
25

static

my public static folder
1
star
26

ritchievink.com

hugo static site
Python
1
star
27

mandelbrot-explorer

Explore the mandelbrot set interactively.
Rust
1
star
28

linear-median-rs

Median search in linear time
Rust
1
star
29

async_task_template

Too much boilerplate, just spawn on a tokio runtime.
Rust
1
star