modelTableCurrent
Tabular current source of analog electrical library
Extends from Interfaces.OnePort (OnePort partial model of analog electrical library).
Information
The tabular current source is built in bondgraphic technology from a bond graph tableSf element, a 1-junction, and three bonds. A-causal bonds must be used except at the source, because the causality depends on the embedding of the current source in its environment.
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 Volt) startTime: Start time of time function to be generated (default value = 0 sec)
The model generates a current source by linear interpolation in a table. The time points and current 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 current 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 current i = 0.0 (before event), 1.0 (after event)
e.g., time = 1.5, the current i = 2.5,
e.g., time = 2.0, the current i = 4.0,
e.g., time = 5.0, the current i = 23.0 (i.e. extrapolation).
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,:] | table | [0, 0; 1, 1; 2, 4] | Table matrix (time = first column, current = second column) |
| Modelica.SIunits.Current | offset | 0 | Current offset |
| Modelica.SIunits.Time | startTime | 0 | Time offset |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Electrical.Analog.Interfaces.PositivePin | p (from OnePort) | Left electrical connector | |
| Modelica.Electrical.Analog.Interfaces.NegativePin | n (from OnePort) | Right electrical connector |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.SIunits.Voltage | v (from OnePort) | Voltage drop between the two pins | |
| Modelica.SIunits.Current | i (from OnePort) | Current flowing from pin p to pin n |