{"id":16754401,"url":"https://github.com/ritchie46/anastruct","last_synced_at":"2025-05-14T20:10:58.123Z","repository":{"id":9534724,"uuid":"62470606","full_name":"ritchie46/anaStruct","owner":"ritchie46","description":"2D structural analysis in Python","archived":false,"fork":false,"pushed_at":"2025-03-31T05:25:07.000Z","size":2794,"stargazers_count":389,"open_issues_count":37,"forks_count":108,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-04-13T17:46:43.328Z","etag":null,"topics":["axial-forces","displacement","finite-element-analysis","shear-forces","stiffness","trusses"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ritchie46.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-07-02T21:35:43.000Z","updated_at":"2025-04-02T09:15:06.000Z","dependencies_parsed_at":"2023-09-30T13:35:21.003Z","dependency_job_id":"fe1f93de-b2dc-4ad2-b3c5-cdc360272cb3","html_url":"https://github.com/ritchie46/anaStruct","commit_stats":{"total_commits":758,"total_committers":17,"mean_commits":"44.588235294117645","dds":0.5699208443271768,"last_synced_commit":"c5feb82d5c6be219ee065607b11432922d079f3d"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ritchie46%2FanaStruct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ritchie46%2FanaStruct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ritchie46%2FanaStruct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ritchie46%2FanaStruct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ritchie46","download_url":"https://codeload.github.com/ritchie46/anaStruct/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254219374,"owners_count":22034397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axial-forces","displacement","finite-element-analysis","shear-forces","stiffness","trusses"],"created_at":"2024-10-13T03:04:50.184Z","updated_at":"2025-05-14T20:10:58.102Z","avatar_url":"https://github.com/ritchie46.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# anaStruct 2D Frames and Trusses\n[![Python tests](https://github.com/ritchie46/anaStruct/actions/workflows/test.yaml/badge.svg)](https://github.com/ritchie46/anaStruct/actions/workflows/test.yaml)\n[![Documentation Status](https://readthedocs.org/projects/anastruct/badge/?version=latest)](http://anastruct.readthedocs.io/en/latest/?badge=latest)\n![PyPI - Version](https://img.shields.io/pypi/v/anastruct)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/anastruct)\n![Latest Release](https://img.shields.io/github/release-date/ritchie46/anaStruct)\n![Commits since latest release](https://img.shields.io/github/commits-since/ritchie46/anaStruct/latest)\n\n\nAnalyse 2D Frames and trusses for slender structures. Determine the bending moments, shear forces, axial forces and displacements.\n\n## Installation\n\nFor the actively developed version:\n```\n$ pip install git+https://github.com/ritchie46/anaStruct.git\n```\n\nOr for a release:\n```\n$ pip install anastruct\n```\n\n## Read the docs!\n\n[Documentation](http://anastruct.readthedocs.io)\n\n## Questions\n\nGot a question? Please ask on [gitter](https://gitter.im/anaStruct/lobby).\n\n## Includes\n\n* trusses :heavy_check_mark:\n* beams :heavy_check_mark:\n* moment lines :heavy_check_mark:\n* axial force lines :heavy_check_mark:\n* shear force lines :heavy_check_mark:\n* displacement lines :heavy_check_mark:\n* hinged supports :heavy_check_mark:\n* fixed supports :heavy_check_mark:\n* spring supports :heavy_check_mark:\n* q-load in elements direction :heavy_check_mark:\n* point loads in global x, y directions on nodes :heavy_check_mark:\n* dead load :heavy_check_mark:\n* q-loads in global y direction :heavy_check_mark:\n* hinged elements :heavy_check_mark:\n* rotational springs :heavy_check_mark:\n* non-linear nodes :heavy_check_mark:\n* geometrical non linearity :heavy_check_mark:\n* load cases and load combinations :heavy_check_mark:\n* generic type of section - rectangle and circle :heavy_check_mark:\n* EU, US, UK steel section database :heavy_check_mark:\n\n## Examples\n\n```python\nfrom anastruct import SystemElements\nimport numpy as np\n\nss = SystemElements()\nelement_type = 'truss'\n\n# Create 2 towers\nwidth = 6\nspan = 30\nk = 5e3\n\n# create triangles\ny = np.arange(1, 10) * np.pi\nx = np.cos(y) * width * 0.5\nx -= x.min()\n\nfor length in [0, span]:\n    x_left_column = np.ones(y[::2].shape) * x.min() + length\n    x_right_column = np.ones(y[::2].shape[0] + 1) * x.max() + length\n\n    # add triangles\n    ss.add_element_grid(x + length, y, element_type=element_type)\n    # add vertical elements\n    ss.add_element_grid(x_left_column, y[::2], element_type=element_type)\n    ss.add_element_grid(x_right_column, np.r_[y[0], y[1::2], y[-1]], element_type=element_type)\n\n    ss.add_support_spring(\n        node_id=ss.find_node_id(vertex=[x_left_column[0], y[0]]),\n        translation=2,\n        k=k)\n    ss.add_support_spring(\n        node_id=ss.find_node_id(vertex=[x_right_column[0], y[0]]),\n        translation=2,\n        k=k)\n\n# add top girder\nss.add_element_grid([0, width, span, span + width], np.ones(4) * y.max(), EI=10e3)\n\n# Add stability elements at the bottom.\nss.add_truss_element([[0, y.min()], [width, y.min()]])\nss.add_truss_element([[span, y.min()], [span + width, y.min()]])\n\nfor el in ss.element_map.values():\n    # apply wind load on elements that are vertical\n    if np.isclose(np.sin(el.ai), 1):\n        ss.q_load(\n            q=1,\n            element_id=el.id,\n            direction='x'\n        )\n\nss.show_structure()\nss.solve()\nss.show_displacement(factor=2)\nss.show_bending_moment()\n\n```\n\n![](doc/source/img/examples/tower_bridge_struct.png)\n\n![](doc/source/img/examples/tower_bridge_displa.png)\n\n![](doc/source/img/examples/tower_bridge_moment.png)\n\n\n```python\nfrom anastruct import SystemElements\n\nss = SystemElements(EA=15000, EI=5000)\n\n# Add beams to the system.\nss.add_element(location=[0, 5])\nss.add_element(location=[[0, 5], [5, 5]])\nss.add_element(location=[[5, 5], [5, 0]])\n\n# Add a fixed support at node 1.\nss.add_support_fixed(node_id=1)\n\n# Add a rotational spring support at node 4.\nss.add_support_spring(node_id=4, translation=3, k=4000)\n\n# Add loads.\nss.point_load(Fx=30, node_id=2)\nss.q_load(q=-10, element_id=2)\n\n# Solve\nss.solve()\n\n# Get visual results.\nss.show_structure()\nss.show_reaction_force()\nss.show_axial_force()\nss.show_shear_force()\nss.show_bending_moment()\nss.show_displacement()\n```\n![](images/rand/structure.png)\n\n### Real world use case.\n[Non linear water accumulation analysis](https://ritchievink.com/blog/2017/08/23/a-nonlinear-water-accumulation-analysis-in-python/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fritchie46%2Fanastruct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fritchie46%2Fanastruct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fritchie46%2Fanastruct/lists"}