Pulse current
electrical.pulse_current
Ideal square wave current source: offset + I for the first duty fraction of each period T, offset for the rest. Positive current flows through the source from p to n.
Ports
| Name | Domain |
|---|---|
p | electrical |
n | electrical |
Parameters
| Name | Unit | Default | Range | Description |
|---|---|---|---|---|
I | A | 1 | Pulse amplitude | |
T | s | 1 | 0 to ∞ | Period |
duty | 1 | 0.5 | 0 to 1 | Fraction of the period at the high level |
offset | A | 0 | Current between pulses |
Variables
| Name | Unit |
|---|---|
v | V |
i | A |
Equations
v = p.v - n.v 0 = p.i + n.i i = p.i i = offset + (if time - T * floor(time / T) < duty * T then I else 0)