Marine systems simulation

Output is 1 if input > 0, 0 if input is equal to zero, -1 otherwise.

+ Collaboration diagram for Sign:

Determines the sign of the input signal. The output is 1 when the input is greater than zero, 0 when the input is equal to zero, and -1 when the input is less than zero.

Author
Benjamin Scholz
Date
05.09.2007 BSC: Second 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/Sign"
Name = "A"
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 sign of the input signal

Configuration parameters

Name Width Description
PortWidth -

The number of elements in the input and output ports

Initial conditions

There are no initial conditions for this function.

Full example file

<Contents>
<OBJECTS>
<Lib
LibName="base"
SimObject="Math/Sign"
Name="A"
/>
<Lib
LibName="base"
SimObject="Math/Sign"
Name="B"
/>
<Lib
LibName="base"
SimObject="Math/Sign"
Name="C"
/>
</OBJECTS>
<INTERCONNECTIONS>
<Connection
A.In="100"
B.In="0"
C.In="-123"
/>
</INTERCONNECTIONS>
<INITIALIZATION>
<InitialCondition
/>
</INITIALIZATION>
<INTEGRATION>
<Engine
IntegratorMethod="2"
NumCores="1"
TOutput="0, 1, 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/Sign