Elastic supports allow you to model spring supports at nodes, where the support provides resistance proportional to displacement rather than fully restraining the node. This is essential for modeling foundations, soil-structure interaction, and flexible support conditions.Unlike rigid restraints that completely prevent displacement, elastic supports provide a stiffness that resists movement. The reaction force is proportional to the displacement: R = k × δ, where k is the spring stiffness and δ is the displacement.
model.add_elastic_support( node_id, kx=None, # Stiffness in X direction ky=None, # Stiffness in Y direction krz=None, # Rotational stiffness about Z CSys=CoordinateSystemType.GLOBAL # Coordinate system)
Apply springs in a local coordinate system (useful for inclined supports):
import math# Create node on inclined surfacemodel.add_node(5, 3, 2)# Define local axis at 30 degreesangle = 30 * math.pi / 180model.add_local_axis_for_node(5, angle)# Add spring in local coordinates# Spring is perpendicular to inclined surfacemodel.add_elastic_support( node_id=5, kx=None, ky=100, # Normal to inclined surface (local Y) krz=None, CSys=CoordinateSystemType.LOCAL # Use local coordinates)
When using local coordinate systems, the spring directions are oriented according to the local axes defined at the node. See Local Node Axes for more details.
You can combine elastic supports with rigid restraints:
# Node with:# - Rigid restraint in X (no movement)# - Elastic support in Y (spring)# - Free rotationmodel.add_restraint(node_id=4, x=True, y=False, rz=False)model.add_elastic_support(node_id=4, ky=500)
Don’t apply both a rigid restraint and elastic support in the same direction at the same node. The rigid restraint will override the spring, making the spring ineffective.For example, this is incorrect:
model.add_restraint(node_id=4, x=True, y=True, rz=False) # y is fixedmodel.add_elastic_support(node_id=4, ky=500) # y spring is ignored!
milcapy currently supports linear elastic springs only. For non-linear spring behavior (e.g., tension-only springs, gap elements), you would need to use an iterative approach or different analysis software.
# Different soil stiffnesses under different footingssoft_soil_stiffness = 5000 # kN/mstiff_soil_stiffness = 15000 # kN/mmodel.add_elastic_support(footing_1, ky=soft_soil_stiffness)model.add_elastic_support(footing_2, ky=stiff_soil_stiffness)# Differential settlement will occur under load
Check units: Ensure stiffness values are in consistent units
Verify stiffness magnitude: Very low stiffness → large displacements; very high stiffness → nearly rigid
Compare with rigid restraint: Run analysis with both elastic support and rigid restraint to see the difference
Monitor reactions: Spring reactions should equal k × δ
If you’re unsure about appropriate stiffness values, start with a sensitivity analysis by running the model with different spring stiffnesses to understand the impact on results.