Objectives and Constraints¶
Objectives define what to optimize. Constraints define what is acceptable.
Losses¶
FlowDesign includes:
EnergyLossTargetLossUpperBoundLossLowerBoundLossCompositeLoss
Example:
Constraints¶
Constraints can be soft or hard:
constraints = [
CLConstraint(target=0.5, tolerance=0.02, mode="soft", weight=20.0),
CDConstraint(max_value=0.015, mode="soft", weight=10.0),
ThicknessConstraint(min_thickness=0.08, mode="hard"),
]
Each constraint exposes:
Soft constraints contribute penalties to problem.loss(x). Hard constraints are
used by problem.is_feasible(x) and result filtering.