BondLib.Sources.trapSf

# .BondLib.Sources.trapSf

Trapezoidal flow source of the Modelica bond graph library

## 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))

Generated at 2026-05-12T20:19:03Z by OpenModelicaOpenModelica 1.26.7 using GenerateDoc.mos