Marine systems simulation
Linear system

Linear time-invariant system.

+ Collaboration diagram for Linear system:

Implements a linear system with constant coefficients. The system is formulated as from the input \(u\) to the output \(y\) with the internal state \(x\).

\[\dot{x}=Ax+Bu,\\ y=Cx+Du\]

The size of the system state vector \(x\), the input \(u\) and the output \(y\) is derived from the sizes of the input matrices which define the system. The matrices are defined as a list of comma separated row vectors, which are in turn separated by the column separator ";".

Example configuration excerpt

<Lib
LibName = "fhsim_base"
SimObject = "Math/LinearSystem"
Name = "SystemOne"
A = "0,1;-0.5,-2"
B = "0;1"
C = "1,0"
/>
...
<Connection
SystemOne.In = "1"
/>
...
<InitialCondition
SystemOne.State="10,5"
/>

The number of internal system states is N, the number of inputs M and the number of outputs K.

Input Ports

Name Width Description
In M The input signal \(u\)

Output Ports

Name Width Description
Out K \(y=Cx+Du\)

Configuration parameters

Name Width Description
A NxN System matrix
B NxM Gain matrix
C KxN Output matrix
D KxM Feedthrough matrix (Default: zero-matrix)

Initial conditions

Name Width Description
State N State vector initial conditions

Full example file

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