Marine systems simulation
Saturation

Limit range of signal.

+ Collaboration diagram for Saturation:

Defines a max and min value for the signal. If the value is outside this range, the value will automatically be changed to the specified max or min.

Author
Karl-Johan Reite
Benjamin Scholz
Date
14.08.2007 KJR: Initial version.
20.07.2011 KGA: Ported to FhSim 2.0.
25.07.2011 KGA: Added documentation.

Example configuration excerpt

<Lib
LibName = "fhsim_base"
SimObject = "Math/Saturation"
Name = "A"
Min = "0,-2"
Max = "5,6"
PortWidth = "2"
/>
...
<Connection
A.In = "10,4"
/>

Input Ports

Name Width Description
In <PortWidth> The input signal

Output Ports

Name Width Description
Out <PortWidth> The saturated input signal

Configuration parameters

Name Width Description
PortWidth 1

The number of elements in the input and output ports

Max <PortWidth>

The upper saturation value with size 1 (scalar saturation) or <PortWidth> (individual component saturation)

Min <PortWidth>

The lower saturation value with size 1 (scalar saturation) or <PortWidth> (individual component saturation

Initial conditions

There are no initial conditions for this function.

Full example file

<Contents>
<OBJECTS>
<Lib
LibName="base"
SimObject="Math/Saturation"
Name="A"
PortWidth="1"
Max="2"
Min="0"
/>
<Lib
LibName="base"
SimObject="Src/Sine"
Name="S"
Amplitude="3"
Bias="0"
StartTime="0"
PeriodS="4"
PhaseDeg="0"
/>
</OBJECTS>
<INTERCONNECTIONS>
<Connection
A.In="S.Out"
/>
</INTERCONNECTIONS>
<INITIALIZATION>
<InitialCondition
/>
</INITIALIZATION>
<INTEGRATION>
<Engine
IntegratorMethod="2"
NumCores="1"
TOutput="0, 0:1:5, 30"
LogStates ="1"
stepsize ="0"
HMax="0.002"
HMin="0.00000001"
AbsTol="1e-3" RelTol="1e-3"
UseRSSNormInsteadOfInfNorm="0"
FileOutput="objects:all"
/>
</INTEGRATION>
</Contents>

This SimObject is referred to as Math/Saturation