Certification
Constraints, their provenance, and the traceability matrix.
A constraint here is what prob.model.add_constraint(...) is in OpenConcept’s own optimizing
examples – a bound on something the black box publishes – plus two optional fields those
examples have nowhere to put: the regulation the number comes from, and the source of that
particular number.
constraints:
- name: takeoff_field_length # traceable to a regulation
upper: 8000.0
units: ft
regulation: 14 CFR 25.113
source: Design field length, 8000 ft dry runway at sea level, ISA
- name: climb_throttle # a plain bound, no provenance claimed
lower: 0.01
upper: 1.05
Both are legal. A constraint that names a regulation and a source appears in the traceability matrix as a defensible requirement; one that does not is reported as a design constraint, and the matrix says which is which rather than implying every row is certification evidence.
Everything else about a constraint – the bound form, the units, the scaling, which elements of a vector are constrained, whether it is linear – is passed through to OpenMDAO unchanged.
- class cdadt.certification.CertificationBasis(constraints=())[source]
Bases:
objectThe set of constraints a design is held to, and the matrix that reports them.
- Parameters:
constraints (sequence of Constraint) – What must hold. May be empty: an unconstrained study is a valid thing to run, and the report says so rather than printing an empty table.
- Raises:
ConstraintError – If two constraints share a name, which OpenMDAO would resolve by keeping one of them.
- classmethod from_specs(specs, catalog=None)[source]
Build the basis a case file’s
constraintslist describes.- Parameters:
specs (Sequence[ConstraintSpec])
catalog (ResponseCatalog | None)
- Return type:
- property constraints: tuple[Constraint, ...]
The constraints, in the order the case file states them.
- property traceable: tuple[Constraint, ...]
The constraints that name both a regulation and a source.
- register(model)[source]
Declare every constraint on the model, before setup.
- Parameters:
model (Group)
- Return type:
None
- evaluate(box)[source]
Evaluate every constraint against a converged design.
- Parameters:
box (Any)
- Return type:
list[ConstraintResult]
- class cdadt.certification.Constraint(spec, catalog=None)[source]
Bases:
objectOne constraint, ready to register on a model and evaluate against a design.
- Parameters:
spec (ConstraintSpec) – The case file’s entry.
catalog (ResponseCatalog, optional) – Used to turn a response name into a black-box path and supply its units. A name the catalogue does not know is passed through as a raw path.
- property spec: ConstraintSpec
The case file’s entry.
- property name: str
The name the case file used, which is also the constraint’s alias.
- property title: str
One line naming the constraint in a report.
- property regulation: str
The regulation this constraint comes from, or an empty string.
- property source: str
Where the number came from, or an empty string.
- property is_traceable: bool
Whether this constraint names both a regulation and a source.
- property path: str
Where the constrained quantity lives inside the black box.
- property units: str | None
Units the constraint is evaluated in.
- register(model)[source]
Declare this constraint on the black box’s group, before setup.
Scaled by the magnitude of its own bound unless the case file says otherwise. Without that, a climb gradient in hundredths of a radian is numerically invisible next to a field length in thousands of feet.
- Parameters:
model (Group)
- Return type:
None
- exception cdadt.certification.ConstraintError[source]
Bases:
ExceptionRaised when a constraint cannot be registered or evaluated as stated.
- class cdadt.certification.ConstraintResult(constraint, value)[source]
Bases:
objectOne constraint, evaluated against one converged design.
- Variables:
ACTIVE_TOLERANCE (float) – Relative distance from the bound within which a constraint is called active rather than merely met. An active constraint is one that shaped the design.
- Parameters:
constraint (Constraint)
value (float)
- ACTIVE_TOLERANCE: ClassVar[float] = 0.0001
- property constraint: Constraint
The constraint that was checked.
- property value: float
The governing value, in the constraint’s units.
- property margin: float
How far the design is on the satisfying side of its bound.
Positive is compliant, whichever form the bound takes, so the sign means one thing across a whole matrix: an upper limit gives
upper - value; a lower limit givesvalue - lower; a band gives whichever is smaller; an equality gives-|value - equals|.
- property relative_margin: float
The margin as a fraction of the bound’s magnitude.
- property satisfied: bool
Whether the constraint is met.
- property active: bool
Whether the design sits on the bound, and was therefore shaped by it.
- property status: str
"MET","ACTIVE"or"VIOLATED".