Pulse voltage
electrical.pulse_voltage
Ideal square wave source: offset + V for the first duty fraction of each period T, offset for the rest.
Ports
| Name | Domain |
|---|---|
p | electrical |
n | electrical |
Parameters
| Name | Unit | Default | Range | Description |
|---|---|---|---|---|
V | V | 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 | V | 0 | Voltage between pulses |
Variables
| Name | Unit |
|---|---|
v | V |
i | A |
Equations
v = p.v - n.v 0 = p.i + n.i i = p.i v = offset + (if time - T * floor(time / T) < duty * T then V else 0)