Time dependent SPICE3 voltage and current sources

This package contains the SPICE sources.

**Note:** There are differences between SPICE3 and Modelica concerning the default values of the parameter. Therefore it is recommended to specify **all** parameters of the source.

Extends from `Modelica.Icons.SourcesPackage`

(Icon for packages containing sources).

Name | Description |
---|---|

`I_constant` | Constant independent current sources |

`I_exp` | Exponential current source |

`I_pulse` | Pulse current source |

`I_pwl` | Piece-wise linear current source |

`I_sffm` | Single-frequency FM current source |

`I_sin` | Sinusoidal current source |

`V_constant` | Constant independent voltage sources |

`V_exp` | Exponential voltage source |

`V_pulse` | Pulse voltage source |

`V_pwl` | Piece-wise linear voltage source |

`V_sffm` | Single-frequency FM voltage source |

`V_sin` | Sinusoidal voltage source |

Constant independent voltage sources

The V_constant source is a source is a simple constant voltage source for an ideal constant voltage which is provided by a parameter.

Extends from `Modelica.Electrical.Analog.Interfaces.OnePort`

(Component with two electrical pins p and n and current i from p to n).

Type | Name | Default | Description |
---|---|---|---|

`Voltage` | `V` | `1` | Value of constant voltage |

Type | Name | Description |
---|---|---|

`PositivePin` | `p` | Positive electrical pin |

`NegativePin` | `n` | Negative electrical pin |

Sinusoidal voltage source

Damped sinusoidal source

- All parameters of sources should be set explicitly.
- since TSTEP and TSTOP are not available for modeling in Modelica, differences to SPICE may occur if not all parameters are set.

Extends from `Modelica.Electrical.Analog.Interfaces.OnePort`

(Component with two electrical pins p and n and current i from p to n).

Type | Name | Default | Description |
---|---|---|---|

`Voltage` | `VO` | `0` | Offset |

`Voltage` | `VA` | `0` | Amplitude |

`Frequency` | `FREQ` | Frequency | |

`Time` | `TD` | `0` | Delay |

`Damping` | `THETA` | `0` | Damping factor |

Type | Name | Description |
---|---|---|

`PositivePin` | `p` | Positive electrical pin |

`NegativePin` | `n` | Negative electrical pin |

Exponential voltage source

Rising and falling exponential source.

- All parameters of sources should be set explicitly.
- since TSTEP and TSTOP are not available for modeling in Modelica, differences to SPICE may occur if not all parameters are set.- it should be set all the parameters definitely

- normally, there exist differences between Dymola and Spice, because TSTEP and TSTOP are not available.

Extends from `Modelica.Electrical.Analog.Interfaces.OnePort`

(Component with two electrical pins p and n and current i from p to n).

Type | Name | Default | Description |
---|---|---|---|

`Voltage` | `V1` | `0` | Initial value |

`Voltage` | `V2` | `0` | Pulsed value |

`Time` | `TD1` | `0` | Rise delay time |

`Time` | `TAU1` | `1` | Rise time constant |

`Time` | `TD2` | `1` | Fall delay time |

`Time` | `TAU2` | `1` | Fall time constant |

Type | Name | Description |
---|---|---|

`PositivePin` | `p` | Positive electrical pin |

`NegativePin` | `n` | Negative electrical pin |

Pulse voltage source

Periodic pulse source with not limited number of periods.

A single pulse is described by the following table:

## time |
## value |

0 |
V1 |

TD |
V1 |

TD+TR |
V2 |

TD+TR+PW |
V2 |

TD+TR+PW+TF |
V1 |

TSTOP |
V1 |

Intermediate points are determined by linear interpolation.

A pulse it looks like a saw tooth, use this parameters e.g.:

## Parameter |
## Value |

V1 |
0 |

V2 |
1 |

TD |
0 |

TR |
1 |

TF |
1 |

PW |
2 |

PER |
1 |

- All parameters of sources should be set explicitly.
- since TSTEP and TSTOP are not available for modeling in Modelica, differences to SPICE may occur if not all parameters are set.

`Modelica.Electrical.Analog.Interfaces.OnePort`

(Component with two electrical pins p and n and current i from p to n).

Type | Name | Default | Description |
---|---|---|---|

`Voltage` | `V1` | `0` | Initial value |

`Voltage` | `V2` | `0` | Pulsed value |

`Time` | `TD` | `0` | Delay time |

`Time` | `TR` | Rise time | |

`Time` | `TF` | `TR` | Fall time |

`Time` | `PW` | `Modelica.Constants.inf` | Pulse width |

`Time` | `PER` | `Modelica.Constants.inf` | Period |

Type | Name | Description |
---|---|---|

`PositivePin` | `p` | Positive electrical pin |

`NegativePin` | `n` | Negative electrical pin |

Piece-wise linear voltage source

This model generates a voltage by **linear interpolation** in a given table. The time points and voltage 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 voltage to be interpolated. The table interpolation has the following properties:

- 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 independently of the actual time instant, i.e., this is a constant voltage source. - The table is implemented in a numerically sound way by generating
**time events**at interval boundaries. This generates continuously differentiable values for the integrator.

Example:

table = [0 0 1 0 1 1 2 4 3 9 4 16] If, e.g., time = 1.0, the voltage v = 0.0 (before event), 1.0 (after event) e.g., time = 1.5, the voltage v = 2.5, e.g., time = 2.0, the voltage v = 4.0, e.g., time = 5.0, the voltage v = 23.0 (i.e., extrapolation).

`Modelica.Electrical.Analog.Interfaces.OnePort`

(Component with two electrical pins p and n and current i from p to n).

Type | Name | Default | Description |
---|---|---|---|

`Real` | `table[:,:]` | `[0,0; 1,1; 2,4]` | Table matrix (time = first column, voltage = second column) |

Type | Name | Description |
---|---|---|

`PositivePin` | `p` | Positive electrical pin |

`NegativePin` | `n` | Negative electrical pin |

Single-frequency FM voltage source

The single-frequency frequency modulation source generates a carrier signal of the frequency FC. This signal is modulated by the signal frequency FS. See the formula in the Modelica text.

- All parameters of sources should be set explicitly.
- since TSTEP and TSTOP are not available for modeling in Modelica, differences to SPICE may occur if not all parameters are set.

`Modelica.Electrical.Analog.Interfaces.OnePort`

(Component with two electrical pins p and n and current i from p to n).

Type | Name | Default | Description |
---|---|---|---|

`Voltage` | `VO` | `0` | Offset |

`Voltage` | `VA` | `0` | Amplitude |

`Frequency` | `FC` | Carrier frequency | |

`Real` | `MDI` | `0` | Modulation index |

`Frequency` | `FS` | `FC` | Signal frequency |

Type | Name | Description |
---|---|---|

`PositivePin` | `p` | Positive electrical pin |

`NegativePin` | `n` | Negative electrical pin |

Constant independent current sources

The I_constant source is a simple constant current source for an ideal constant current which is provided by a parameter.

`Modelica.Electrical.Analog.Interfaces.OnePort`

(Component with two electrical pins p and n and current i from p to n).

Type | Name | Default | Description |
---|---|---|---|

`Current` | `I` | `1` | Value of constant voltage |

Type | Name | Description |
---|---|---|

`PositivePin` | `p` | Positive electrical pin |

`NegativePin` | `n` | Negative electrical pin |

Sinusoidal current source

Damped sinusoidal source

- All parameters of sources should be set explicitly.
- since TSTEP and TSTOP are not available for modeling in Modelica, differences to SPICE may occur if not all parameters are set.

`Modelica.Electrical.Analog.Interfaces.OnePort`

(Component with two electrical pins p and n and current i from p to n).

Type | Name | Default | Description |
---|---|---|---|

`Current` | `IO` | `0` | Offset |

`Current` | `IA` | `0` | Amplitude |

`Frequency` | `FREQ` | Frequency | |

`Time` | `TD` | `0` | Delay |

`Damping` | `THETA` | `0` | Damping factor |

Type | Name | Description |
---|---|---|

`PositivePin` | `p` | Positive electrical pin |

`NegativePin` | `n` | Negative electrical pin |

Exponential current source

Rising and falling exponential source.

- All parameters of sources should be set explicitly.

`Modelica.Electrical.Analog.Interfaces.OnePort`

(Component with two electrical pins p and n and current i from p to n).

Type | Name | Default | Description |
---|---|---|---|

`Current` | `I1` | `0` | Initial value |

`Current` | `I2` | `0` | Pulsed value |

`Time` | `TD1` | `0` | Rise delay time |

`Time` | `TAU1` | `1` | Rise time constant |

`Time` | `TD2` | `2` | Fall delay time |

`Time` | `TAU2` | `1` | Fall time constant |

Type | Name | Description |
---|---|---|

`PositivePin` | `p` | Positive electrical pin |

`NegativePin` | `n` | Negative electrical pin |

Pulse current source

Periodic pulse source with not limited number of periods.

A single pulse is described by the following table:

## time |
## value |

0 |
I1 |

TD |
I1 |

TD+TR |
I2 |

TD+TR+PW |
I2 |

TD+TR+PW+TF |
I1 |

TSTOP |
I1 |

Intermediate points are determined by linear interpolation.

A pulse it looks like a saw tooth, use this parameters e.g.:

## Parameter |
## Value |

I1 |
0 |

I2 |
1 |

TD |
0 |

TR |
1 |

TF |
1 |

PW |
2 |

PER |
1 |

- All parameters of sources should be set explicitly.

`Modelica.Electrical.Analog.Interfaces.OnePort`

(Component with two electrical pins p and n and current i from p to n).

Type | Name | Default | Description |
---|---|---|---|

`Current` | `I1` | `0` | Initial value |

`Current` | `I2` | `0` | Pulsed value |

`Time` | `TD` | `0` | Delay time |

`Time` | `TR` | Rise time | |

`Time` | `TF` | `TR` | Fall time |

`Time` | `PW` | `Modelica.Constants.inf` | Pulse width |

`Time` | `PER` | `Modelica.Constants.inf` | Period |

Type | Name | Description |
---|---|---|

`PositivePin` | `p` | Positive electrical pin |

`NegativePin` | `n` | Negative electrical pin |

Piece-wise linear current source

This model generates a current by **linear interpolation** in a given 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 properties:

- 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 current value is just returned independently of the actual time instant, i.e., this is a constant current source. - The table is implemented in a numerically sound way by generating
**time events**at interval boundaries. This generates continuously differentiable values for the integrator.

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

`Modelica.Electrical.Analog.Interfaces.OnePort`

(Component with two electrical pins p and n and current i from p to n).

Type | Name | Default | Description |
---|---|---|---|

`Real` | `table[:,:]` | `[0,0; 1,1; 2,4]` | Table matrix (time = first column, current = second column) |

Type | Name | Description |
---|---|---|

`PositivePin` | `p` | Positive electrical pin |

`NegativePin` | `n` | Negative electrical pin |

Single-frequency FM current source

The single-frequency frequency modulation source generates a carrier signal of the frequency FC. This signal is modulated by the signal frequency FS. See the formula in the Modelica text.

- All parameters of sources should be set explicitly.

`Modelica.Electrical.Analog.Interfaces.OnePort`

(Component with two electrical pins p and n and current i from p to n).

Type | Name | Default | Description |
---|---|---|---|

`Current` | `IO` | `0` | Offset |

`Current` | `IA` | `0` | Amplitude |

`Frequency` | `FC` | Carrier frequency | |

`Real` | `MDI` | `0` | Modulation index |

`Frequency` | `FS` | `FC` | Signal frequency |

Type | Name | Description |
---|---|---|

`PositivePin` | `p` | Positive electrical pin |

`NegativePin` | `n` | Negative electrical pin |