Skip to content

PenaltyConstraintHandler

PenaltyConstraintHandler

PenaltyConstraintHandler(alpha_s: float, alpha_m: float)

Bases: ConstraintHandler

Penalty-based constraint handler.

PenaltyConstraintHandler enforces boundary constraints by adding very large stiffness (penalty numbers) along the constrained degrees of freedom, keeping the original size of the system matrix.

Tcl form

constraints Penalty <alphaS> <alphaM>

Note
  • Choosing penalty numbers too small can lead to constraint violations.
  • Choosing penalty numbers too large can result in numerical ill-conditioning.
Example
from femora.core.model import Model

model = Model()
handler = model.analysis.constraint.penalty(alpha_s=1e10, alpha_m=1e10)

Create a Penalty constraint handler.

Parameters:

Name Type Description Default
alpha_s float

Penalty scale factor for single-point (SP) constraints.

required
alpha_m float

Penalty scale factor for multi-point (MP) constraints.

required