Marine systems simulation
Vector norm

Vector 2-norm of input (Pythagorean).

+ Collaboration diagram for Vector norm:

With input \(x\), the output is calculated as \(\|x\|_2 = \sqrt{x_{1}^{2} + x_{2}^{2} + ... + x_{N}^{2}}\), where N is the number of vector elements in \(x\).

Author
Jorgen Haavind Jensen
Date
Q3 2014: Initial version.

Example configuration excerpt

<Lib
LibName = "fhsim_base"
SimObject = "Math/VectorNorm"
Name = "A"
PortWidth = "2"
/>
...
<Connection
A.In = "10,4"
/>

Input Ports

Name Width Description
In <PortWidth> The input port

Output Ports

Name Width Description
Out <PortWidth> The norm of "In".

Configuration parameters

Name Width Description
PortWidth 1 The number of elements in the signal.

Initial conditions

This SimObject contains no initial conditions.

Full example file

<Contents>
<OBJECTS>
<Lib
LibName="base"
SimObject="Math/VectorNorm"
Name="Norm"
PortWidth = "3"
/>
</OBJECTS>
<INTERCONNECTIONS>
<Connection
Norm.In="3,2,0"
/>
</INTERCONNECTIONS>
<INITIALIZATION>
<InitialCondition
/>
</INITIALIZATION>
<INTEGRATION>
<Engine
IntegratorMethod="2"
NumCores="1"
TOutput="0, 3: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/VectorNorm