Marine systems simulation

A general sine source.

+ Collaboration diagram for Sine wave:

Sine is a trigonometric function (function of an angle). The sine function gives the ratio of the length of the side opposite to an angle, to the length of the hypotenuse.

Two sine functions demonstrating the principles of bias and phase margin.

The bias represents the offset from zero to the average value of the sine function. The phase margin is the angle between the two sine waves. In the figure above, the phase margin is set to pi/2 and the bias is set to 0.5.

Author
Vegar Johansen
Karl-Johan Reite
Date
10.07.2007 VJ: Initial version.
16.02.2011 KJR: Rewritten as part of porting to FSim 2.0
19.07.2011 KGA: Added documentation

Example configuration excerpt

<Lib
LibName = "fhsim_base"
SimObject = "Src/Sine"
Name = "sine"
PortWidth = "2"
Amplitude = "1,2"
PhaseRad = "0.1,0.2"
PeriodS = "1,2"
Bias = "0,0"
StartTime = "0,1"
StopTime = "10,12"
/>

Input Ports

This function has no inputs.

Output Ports

Name Width Description
Out <PortWidth> The sine signal
OutDot <PortWidth> The derivative of the sine signal

Configuration parameters

Name Width Description
PortWidth The number of elements in the signal.
Amplitude <PortWidth>

The signal amplitude

PhaseRad <PortWidth>

The phase of the signal in radians

PhaseDeg <PortWidth> The phase of the signal in degrees
FHz <PortWidth>

The signal frequency [Hz]. This parameter is overridden by PeriodS

PeriodS <PortWidth> Period of the signal (sec). Overrides parameter FHz
Bias <PortWidth>

The amplitude bias (offset from zero to the mean value of the sine wave)

StartTime <PortWidth>

The time to start the step. This may either be a scalar, or a comma separated list referring to the different elements of the signal.

StopTime <PortWidth>

The time to stop the step. This may either be a scalar, or a comma separated list referring to the different elements of the signal. If this is negative, this is a true step function with unlimited duration. If it is larger than zero, it is a pulse function, which goes back to the StartValue after the StopTime.

Initial conditions

This SimObject contains no initial conditions.

Full example file

<Contents>
<OBJECTS>
<Lib
LibName="base"
SimObject="Src/Sine"
Name="A"
PeriodS="6.28318530718"
PhaseRad ="0"
/>
</OBJECTS>
<INTERCONNECTIONS>
<Connection
/>
</INTERCONNECTIONS>
<INITIALIZATION>
<InitialCondition
/>
</INITIALIZATION>
<INTEGRATION>
<Engine
IntegratorMethod="2"
NumCores="1"
TOutput="0, 0:0.5: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 Src/Sine