modeltrapSf

Trapezoidal flow source of the Modelica bond graph library

Extends from Interfaces.ActiveOnePort (Partial model invoking one bondgraphic connector).

Information

The trapezoidal flow source is an active OnePort element. It inherits the effort and flow variables from the active OnePort. The trapezoidal flow to be generated is modeled as a set of eight parameters.

The flow source has its causality stroke at the source.


Potential variables:

 e:          Bondgraphic effort variable

 f:          Bondgraphic flow variable, normalized positive for flows out of the model


Parameters:

 f0:         Amplitude of trapezoid to be generated (default value = 1)

 rising:     Length of rising time of trapezoid to be generated (default value = 0)

 width :     Length of on state of trapezoid to be generated (default value = 0.5)

 falling:    Length of falling time of trapezoid to be generated (default value = 0)

 period:     Length of period of trapezoid to be generated (default value = 1)

 nperiod:    Number of periods of trapezoid to be generated
             an infinite number of periods is being generated if nperiod < 0 (default value = -1)

 offset:     Offset of trapezoid to be generated (default value = 0)

 startTime:  Start time of trapezoid to be generated (default value = 0)


Equations:

when pre(counter2) <> 0 and sample(startTime, period) then
T0 = time
counter2 = pre(counter)
counter = pre(counter) - (if pre(counter) > 0 then 1 else 0)
end when
f = offset + (if (time < startTime or counter2 == 0 or time >= T0 + T_falling) then 0 else if (time < T0 + T_rising) then (time - T0)*f0/T_rising else if (time < T0 + T_width) then f0 else (T0 + T_falling - time)*f0/(T_falling - T_width))

Parameters

TypeNameDefaultDescription
Realf01Amplitude of trapezoidal function
Modelica.SIunits.Timerising0Rising duration of trapezoid
Modelica.SIunits.Timewidth0.5Width duration of trapezoid
Modelica.SIunits.Timefalling0Falling duration of trapezoid
Modelica.SIunits.Timeperiod1Time for one period
Integernperiod-1Number of periods (< 0 means infinite number of periods)
Realoffset0Offset of trapezoidal function
Modelica.SIunits.TimestartTime0Start time of trapezoidal function

Connectors

TypeNameDefaultDescription
BondLib.Interfaces.BondConBondCon1 (from ActiveOnePort)Bond graph connector

Components

TypeNameDefaultDescription
Reale (from ActiveOnePort)Bondgraphic effort
Realf (from ActiveOnePort)Bondgraphic flow
Modelica.Blocks.Sources.TrapezoidTrapezoid1