Boundary conditions define how the structure is supported and constrained. milcapy provides several types of boundary conditions including fixed restraints, prescribed displacements, elastic supports, and local coordinate systems.
Elastic supports provide flexible support using spring stiffness values:
model.add_elastic_support( node_id=1, kx=1000000, # Stiffness in X direction (N/m) ky=5000000, # Stiffness in Y direction (N/m) krz=100000, # Rotational stiffness (N·m/rad) CSys="GLOBAL")
# Semi-rigid rotational springmodel.add_elastic_support( node_id=5, kx=None, # No spring in X ky=None, # No spring in Y krz=5e5 # Rotational spring only)
Use None for infinite stiffness (rigid restraint in that direction). Use 0 for free movement, or a positive value for elastic support.
Results - Displacements/forces in local coordinates
import math# Create inclined support (30° from horizontal)angle = math.radians(30)model.add_local_axis_for_node(node_id=1, angle=angle)# Restrain in local Y direction (perpendicular to incline)model.add_restraint( node_id=1, ux=False, uy=True, # Restrained perpendicular to inclined surface rz=False)# Add load in local coordinatesmodel.add_point_load( node_id=1, load_pattern_name="LL", fx=0, fy=-1000, # Load perpendicular to inclined surface CSys="LOCAL")
Stability Check: Ensure your structure has sufficient restraints to prevent rigid body motion. A 2D structure typically needs at least 3 restraints to be stable.
Coordinate System Consistency: When using local axes, clearly document the angle convention. milcapy uses counter-clockwise positive angles from the global X-axis.
Elastic Support Stiffness:
Use realistic spring values from geotechnical reports
Very high stiffness (greater than 1e12) approaches rigid restraint
Very low stiffness (less than 1) approaches free movement