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
| Type | Name | Default | Description |
|---|---|---|---|
| Real | f0 | 1 | Amplitude of trapezoidal function |
| Modelica.SIunits.Time | rising | 0 | Rising duration of trapezoid |
| Modelica.SIunits.Time | width | 0.5 | Width duration of trapezoid |
| Modelica.SIunits.Time | falling | 0 | Falling duration of trapezoid |
| Modelica.SIunits.Time | period | 1 | Time for one period |
| Integer | nperiod | -1 | Number of periods (< 0 means infinite number of periods) |
| Real | offset | 0 | Offset of trapezoidal function |
| Modelica.SIunits.Time | startTime | 0 | Start time of trapezoidal function |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| BondLib.Interfaces.BondCon | BondCon1 (from ActiveOnePort) | Bond graph connector |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Real | e (from ActiveOnePort) | Bondgraphic effort | |
| Real | f (from ActiveOnePort) | Bondgraphic flow | |
| Modelica.Blocks.Sources.Trapezoid | Trapezoid1 |