FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches

A general gain object with port width and gain ratio decided by input parameters.

+ Collaboration diagram for Gain:

Multiplies the input with a scalar value (gain).

Author
Karl-Johan Reite
Date
21.11.2006 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/Gain"
Name = "A"
Gain = "20"
PortWidth = "1"
/>
...
<Connection
A.In = "1"
/>

Input Ports

Name Width Description
In <PortWidth> The input signal.

Output Ports

Name Width Description
Out <PortWidth> The input multiplied by a gain.

Configuration parameters

Name Width Description
PortWidth

The number of elements in the input and output ports

Gain <PortWidth>

The signal gain with size 1 (scalar gain) or <PortWidth> (individual signal gains)

Initial conditions

This SimObject contains no initial conditions.

Full example file

<Contents>
<OBJECTS>
<Lib
LibName="base"
SimObject="Math/Gain"
Name="A"
Gain="5"
/>
</OBJECTS>
<INTERCONNECTIONS>
<Connection
A.In="20"
/>
</INTERCONNECTIONS>
<INITIALIZATION>
<InitialCondition
/>
</INITIALIZATION>
<SIMULATION>
<Timing TStart="0" TEnd="2.0"/>
<Integrator Method="RK45_i" NumCores="1" LogStates="1" UseRSSNorm="0">
<StepControl StepMax="0.002" StepMin="0.00000001" AbsTol="1e-3" RelTol="1e-3"/>
</Integrator>
</SIMULATION>
<OBSERVERS>
<FileOutput TOutput="0, 1, 30" Select="objects:all"/>
</OBSERVERS>
</Contents>

This SimObject is referred to as Math/Gain