Skip to main content
These methods allow you to define boundary conditions, elastic supports, local coordinate systems, end offsets, releases, and property modifiers for your structural model.

add_restraint()

Applies restraints (fixed boundary conditions) to a node.
model.add_restraint(
    node_id=1,
    ux=True,
    uy=True,
    rz=False
)

Parameters

node_id
int
required
ID of the node where restraints are applied
ux
bool
required
If True, restrains translation in X direction
uy
bool
required
If True, restrains translation in Y direction
rz
bool
required
If True, restrains rotation about Z axis

Raises

  • ValueError - If the node does not exist
  • ValueError - If ux, uy, or rz are not boolean values

add_elastic_support()

Applies elastic spring supports to a node.
model.add_elastic_support(
    node_id=1,
    kx=1000.0,
    ky=2000.0,
    krz=500.0,
    CSys=CoordinateSystemType.GLOBAL
)

Parameters

node_id
int
required
ID of the node where elastic support is applied
kx
float | None
default:"None"
Spring stiffness in X direction. None means no spring in this direction
ky
float | None
default:"None"
Spring stiffness in Y direction. None means no spring in this direction
krz
float | None
default:"None"
Rotational spring stiffness about Z axis. None means no rotational spring
CSys
str | CoordinateSystemType
default:"'GLOBAL'"
Coordinate system for spring directions. Options:
  • 'GLOBAL' or CoordinateSystemType.GLOBAL
  • 'LOCAL' or CoordinateSystemType.LOCAL

Raises

  • ValueError - If the node does not exist

add_local_axis_for_node()

Defines a local coordinate system for a node by specifying a rotation angle.
model.add_local_axis_for_node(
    node_id=1,
    angle=45.0  # degrees
)

Parameters

node_id
int
required
ID of the node
angle
float
required
Rotation angle of the local axis in degrees (counterclockwise from global X)

Raises

  • ValueError - If the node does not exist

Notes

Local axes are useful for:
  • Applying inclined supports
  • Getting results in a node-specific coordinate system
  • Defining local load directions

add_end_length_offset()

Adds rigid end offsets (rigid arms) to a member.
model.add_end_length_offset(
    member_id=1,
    la=0.5,
    lb=0.5,
    qla=True,
    qlb=True,
    fla=1.0,
    flb=1.0
)

Parameters

member_id
int
required
ID of the member
la
float
default:"0.0"
End offset length at start node (i-end)
lb
float
default:"0.0"
End offset length at end node (j-end)
qla
bool
default:"True"
If True, loads are applied on the rigid arm at start node
qlb
bool
default:"True"
If True, loads are applied on the rigid arm at end node
fla
float
default:"1.0"
Rigid zone factor for start node (1.0 = fully rigid)
flb
float
default:"1.0"
Rigid zone factor for end node (1.0 = fully rigid)

Raises

  • ValueError - If the member does not exist

add_releases()

Adds member end releases to create pins or other partial connections.
model.add_releases(
    member_id=1,
    pi=False,
    vi=False,
    mi=True,  # Moment release at start
    pj=False,
    vj=False,
    mj=False
)

Parameters

member_id
int
required
ID of the member
pi
bool
default:"False"
If True, releases axial force at start node (i-end)
vi
bool
default:"False"
If True, releases shear force at start node (i-end)
mi
bool
default:"False"
If True, releases moment at start node (i-end)
pj
bool
default:"False"
If True, releases axial force at end node (j-end)
vj
bool
default:"False"
If True, releases shear force at end node (j-end)
mj
bool
default:"False"
If True, releases moment at end node (j-end)

Raises

  • ValueError - If the member does not exist
  • ValueError - If both axial releases (pi and pj) are specified
  • ValueError - If both shear releases (vi and vj) are specified

set_property_modifiers()

Modifies the properties of a section by applying scaling factors.
model.set_property_modifiers(
    section_name='Column',
    axial_area=1.0,
    shear_area=0.8,
    moment_inertia=0.7,
    weight=1.0
)

Parameters

section_name
str
required
Name of the section to modify
axial_area
float
default:"1.0"
Multiplier for axial area (1.0 = no modification)
shear_area
float
default:"1.0"
Multiplier for shear area (1.0 = no modification)
moment_inertia
float
default:"1.0"
Multiplier for moment of inertia (1.0 = no modification)
weight
float
default:"1.0"
Multiplier for weight (1.0 = no modification)

Raises

  • ValueError - If the section does not exist

Example Usage

import milcapy as milca
from milcapy.utils.types import CoordinateSystemType

model = milca.SystemMilcaModel()

# Add fixed support
model.add_restraint(
    node_id=1,
    ux=True,  # Fixed in X
    uy=True,  # Fixed in Y
    rz=True   # Fixed rotation
)

# Add pinned support (rotation free)
model.add_restraint(
    node_id=2,
    ux=True,
    uy=True,
    rz=False  # Free to rotate
)

# Add elastic support
model.add_elastic_support(
    node_id=3,
    ky=5000.0  # Vertical spring only
)

# Add inclined support at 30 degrees
model.add_local_axis_for_node(node_id=4, angle=30.0)
model.add_restraint(
    node_id=4,
    ux=True,  # Fixed along inclined axis
    uy=True,
    rz=False
)

# Create simply supported beam with moment releases
model.add_releases(
    member_id=1,
    mi=True,  # Pin at start
    mj=True   # Pin at end
)

# Add rigid end offsets for beam-column connection
model.add_end_length_offset(
    member_id=2,
    la=0.3,  # 0.3m offset at start
    lb=0.3   # 0.3m offset at end
)

# Reduce stiffness for cracked section analysis
model.set_property_modifiers(
    section_name='Beam',
    moment_inertia=0.5  # 50% of gross section
)

Build docs developers (and LLMs) love