Skip to content

Saturation ​

Clamps a double signal between a lower and an upper limit: out = min(max(in, lower), upper). The limits come either from parameters or from two input ports (max on top, min at the bottom) for limits that move at run time. With fixed limits, a lower limit above the upper one is logged as an error and the two are swapped; with port limits the upper limit wins if they cross.

Category: Nonlinear

Ports ​

PortKindSignalNotes
inControl inputReal
maxControl inputRealShown when Limits from is Input ports
minControl inputRealShown when Limits from is Input ports
outControl outputReal

Parameters ​

ParameterTypeDefaultUnitsDescriptionID
Limits fromChoice: Parameters / Input portsParameters—Parameters = fixed upper / lower limits below. Input ports = read the limits from the `max` and `min` ports every step.limit_source
Upper limitNumber1—Largest value the output can take.upper_limit
Lower limitNumber-1—Smallest value the output can take. Must not exceed the upper limit.lower_limit

In the course ​