Overview
SystemModel is the primary class for building 2D structural analysis models in milcapy. It manages all model components including materials, sections, nodes, elements, loads, and analysis results.
Constructor
Materials
add_material()
Adds a material to the model.Unique name for the material
Modulus of elasticity (E) in force per area units
Poisson’s ratio (ν), must be in range (-1, 0.5)
Specific weight or density (kg/m³ or N/m³)
Returns the created Material object
Sections
add_rectangular_section()
Adds a rectangular cross-section to the model.Unique name for the section
Name of previously defined material
Width of the rectangular section
Height of the rectangular section
Returns the created Section object
add_circular_section()
Adds a circular cross-section to the model.Unique name for the section
Name of previously defined material
Diameter of the circular section (must be positive)
Returns the created Section object
add_generic_section()
Adds a generic section with custom geometric properties.Unique name for the section
Name of previously defined material
Cross-sectional area
Moment of inertia
Shear coefficient factor (Ac = A * k_factor)
Returns the created Section object
add_shell_section()
Adds a shell section for membrane/plate elements.Unique name for the section
Name of previously defined material
Thickness of the shell element
Returns the created ShellSection object
Nodes
add_node()
Adds a node to the model.Unique node identifier
X-coordinate of the node
Y-coordinate of the node
Returns the created Node object
Members
add_member()
Adds a frame member (beam/column) to the model.Unique member identifier
ID of the start node
ID of the end node
Name of previously defined section
Beam theory to use:
TIMOSHENKO or EULER_BERNOULLIReturns the created Member object
add_elastic_timoshenko_beam()
Adds a Timoshenko beam with axial stiffness.Unique member identifier
ID of the start node
ID of the end node
Name of previously defined section
add_elastic_euler_bernoulli_beam()
Adds an Euler-Bernoulli beam with axial stiffness.Unique member identifier
ID of the start node
ID of the end node
Name of previously defined section
add_truss()
Adds a truss element (axial force only).Unique truss identifier
ID of the start node
ID of the end node
Name of previously defined section
Boundary Conditions
add_restraint()
Adds restraints (boundary conditions) to a node.ID of the node to restrain
Restrain translation in X direction
Restrain translation in Y direction
Restrain rotation about Z axis
Load Patterns
add_load_pattern()
Creates a load pattern for organizing loads.Unique name for the load pattern
Multiplier for self-weight (1.0 = full self-weight)
Load pattern state:
ACTIVE or INACTIVEadd_point_load()
Adds a point load to a node.ID of the node to apply load
Name of the load pattern
Force in X direction
Force in Y direction
Moment about Z axis
Coordinate system:
GLOBAL or LOCALReplace existing load if True, otherwise add to existing
add_distributed_load()
Adds a distributed load to a member.ID of the member to apply load
Name of the load pattern
Load magnitude at start of member
Load magnitude at end of member
Coordinate system:
GLOBAL or LOCALLoad direction:
LOCAL_1, LOCAL_2, X, Y, GRAVITY, etc.Type of load:
FORCE or MOMENTReplace existing load if True
Analysis
solve()
Solves the structural model using the direct stiffness method.List of load pattern names to solve. If None, solves all active patterns.
Dictionary mapping load pattern names to Results objects
Results
get_results()
Retrieves analysis results for a specific load pattern.Name of the load pattern
Results object containing displacements, reactions, and internal forces
get_global_stiffness_matrix()
Returns the assembled global stiffness matrix.Global stiffness matrix
get_global_load_vector()
Returns the global load vector for a load pattern.Name of the load pattern
Global load vector
Visualization
show()
Launches the interactive model viewer window.The model must be solved before calling
show(). The viewer displays the model geometry, loads, deformed shape, and internal force diagrams.plot_model()
Creates a static plot of the model.Load pattern to display loads for
Show node ID labels
Show member ID labels
Advanced Features
add_elastic_support()
Adds an elastic support (spring) to a node.ID of the node
Spring stiffness in X direction
Spring stiffness in Y direction
Rotational spring stiffness about Z
Coordinate system for the spring
add_end_length_offset()
Adds rigid end offsets to a member (rigid arms).ID of the member
Length offset at start node
Length offset at end node
Apply loads on rigid arm at start
Apply loads on rigid arm at end
Rigidity factor for start offset (1.0 = fully rigid)
Rigidity factor for end offset (1.0 = fully rigid)
add_releases()
Adds member end releases.ID of the member
Release axial force at start node
Release shear force at start node
Release moment at start node
Release axial force at end node
Release shear force at end node
Release moment at end node
