modeltableSf
Tabular flow source of the Modelica bond graph library
Extends from Interfaces.ActiveOnePort (Partial model invoking one bondgraphic connector).
Information
The tabular flow source is an active OnePort element. It inherits the effort and flow variables from the active OnePort. The tabular flow to be generated is modeled as a two-dimensional parameter table plus a set of two scalar 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: table: Two-dimensional table with supporting values (default value = [0, 0; 1, 1; 2, 4]) offset: Offset of time function to be generated (default value = 0) startTime: Start time of time function to be generated (default value = 0)
The model generates a flow source by linear interpolation in a table. The time points and flow values are stored in a matrix table[i,j], where the first column table[:,1] contains the time points, and the second column contains the flow to be interpolated. The table interpolation has the following proporties:
- The time points need to be monotonically increasing.
- Discontinuities are allowed, by providing the same time point twice in the table.
- Values outside of the table range, are computed by extrapolation through the last or first two points of the table.
- If the table has only one row, no interpolation is performed and the voltage value is just returned independantly of the actual time instant, i.e., this is a constant voltage source.
- Via parameters startTime and offset the curve defined by the table can be shifted both in time and in the voltage.
- The table is implemented in a numerically sound way by generating time events at interval boundaries, in order to not integrate over a discontinuous or not differentiable points.
Example:
table = [0 0
1 0
1 1
2 4
3 9
4 16]
If, e.g., time = 1.0, the flow f = 0.0 (before event), 1.0 (after event)
e.g., time = 1.5, the flow f = 2.5,
e.g., time = 2.0, the flow f = 4.0,
e.g., time = 5.0, the flow f = 23.0 (i.e. extrapolation).
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,:] | table | [0, 0; 1, 1; 2, 4] | Table matrix (time = first column, voltage = second column) |
| Real | offset | 0 | Offset of time function |
| Modelica.SIunits.Time | startTime | 0 | Start time of time 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.TimeTable | TimeTable1 |