Skip to Content

STRUCTURAL_FEA

Overview

The PyniteFEA package used in this function provides a Python interface for 3D static analysis of elastic structures. This example function only returns support reactions for 3D frames and beams, but much more is possible with the library. See the PyniteFEA documentation for details.

This example function is provided as-is without any representation or warranty of correctness. DO NOT USE for production applications without your own testing and validation.

Usage

To use this function in Excel, provide lists of nodes, members, materials, sections, supports, and loads as 2D arrays.

=STRUCTURAL_FEA(nodes, members, materials, sections, supports, nodal_loads)

Arguments

ArgumentTypeRequiredDescriptionExample
nodeslist[list]RequiredList of nodes: [name, x, y, z][[“N1”,0,0,0],[“N2”,168,0,0]]
memberslist[list]RequiredList of members: [name, i-node, j-node, material, section][[“M1”,“N1”,“N2”,“Steel”,“W8x24”]]
materialslist[list]RequiredList of materials: [name, E, G, nu, rho][[“Steel”,29000,11200,0.3,0.284/12**3]]
sectionslist[list]RequiredList of sections: [name, A, Iy, Iz, J][[“W8x24”,7.08,18.3,82.7,0.346]]
supportslist[list]RequiredList of supports: [node, DX, DY, DZ, RX, RY, RZ] (bools)[[“N1”,TRUE,TRUE,TRUE,TRUE,FALSE,FALSE]]
nodal_loadslist[list]RequiredList of nodal loads: [node, direction, value][[“N2”,“FY”,-5]]

Returns

Output TypeTypeDescriptionExample
reactionslist[list]Support reactions: [node, DX, DY, DZ, RX, RY, RZ][[“N1”,0.0,5.0,0.0,0.0,0.0,0.0]]
errorvariesError message if calculation fails”Error: Invalid input”

Example

Space Frame Nodal Loads

nodes:

namexyz
N1000
N2-10000
N300-100
N40-1000

members:

namei-nodej-nodematerialsection
M1N2N1SteelMySection
M2N3N1SteelMySection
M3N4N1SteelMySection

materials:

nameEGnurho
Steel30000100000.30.0002836

sections:

nameAIyIzJ
MySection1010010050

supports:

nodeDXDYDZRXRYRZ
N2TRUETRUETRUETRUETRUETRUE
N3TRUETRUETRUETRUETRUETRUE
N4TRUETRUETRUETRUETRUETRUE

nodal_loads:

nodedirectionvalue
N1FY-50
N1MX-1000

Output: reactions

nodeDXDYDZRXRYRZ
N2-0.2130.3180.052619.98-3.1719.0
N30.02957.707.06-2650.9400.517
N40.18342.0-7.11-236-0.0890-6.07

Python Code

import micropip await micropip.install('PyniteFEA') from Pynite import FEModel3D def structural_fea(nodes, members, materials, sections, supports, nodal_loads): """ Performs 3D finite element analysis using the Pynite package and returns support reactions. This function is provided as an example only without any representation or warranty of correctness. DO NOT rely on for production use without your own testing and validation. Args: nodes (list[list]): List of nodes: [name, x, y, z]. members (list[list]): List of members: [name, i-node, j-node, material, section]. materials (list[list]): List of materials: [name, E, G, nu, rho]. sections (list[list]): List of sections: [name, A, Iy, Iz, J]. supports (list[list]): List of supports: [node, DX, DY, DZ, RX, RY, RZ] (bools). nodal_loads (list[list]): List of nodal loads: [node, direction, value]. Returns: reactions (list[list]): Support reactions: [node, DX, DY, DZ, RX, RY, RZ]. If an error occurs, returns a list[list[str]] with the error message. """ try: model = FEModel3D() # Add materials for m in materials: model.add_material(str(m[0]), float(m[1]), float(m[2]), float(m[3]), float(m[4])) # Add sections for s in sections: model.add_section(str(s[0]), float(s[1]), float(s[2]), float(s[3]), float(s[4])) # Add nodes for n in nodes: model.add_node(str(n[0]), float(n[1]), float(n[2]), float(n[3])) # Add members for mem in members: model.add_member(str(mem[0]), str(mem[1]), str(mem[2]), str(mem[3]), str(mem[4])) # Add supports for sup in supports: model.def_support(str(sup[0]), bool(sup[1]), bool(sup[2]), bool(sup[3]), bool(sup[4]), bool(sup[5]), bool(sup[6])) # Add nodal loads for ld in nodal_loads: model.add_node_load(str(ld[0]), str(ld[1]), float(ld[2])) # Analyze model.analyze() # Get reactions reactions = [] for sup in supports: node = model.nodes[str(sup[0])] reactions.append([ str(sup[0]), float(node.RxnFX['Combo 1']), float(node.RxnFY['Combo 1']), float(node.RxnFZ['Combo 1']), float(node.RxnMX['Combo 1']), float(node.RxnMY['Combo 1']), float(node.RxnMZ['Combo 1']) ]) return reactions except Exception as e: # Return error as list[list[str]] to match output format return [[str(e)]]

Live Notebook

Edit this function in a live notebook.

Live Demo

Last updated on