Skip to content

Voltage Source

Single-phase ideal voltage source. Outputs a configurable DC or sinusoidal (optionally with harmonics) voltage between its two electrical terminals, behind a selectable Thévenin impedance (Ideal / R / R-L series / R∥L parallel / R-R∥L). Supports a soft-start amplitude ramp and optional power monitoring: real power P (DC or AC) and reactive power Q (AC only), each measured at the terminal or at the internal EMF, low-pass filtered with a configurable time constant. Monitored quantities carry their own unit selectors: branch current (A / kA), P (W / kW / MW), Q (VAr / kVAr / MVAr). Impedance fields accept Ω / pu (R) and H / Ω-reactance / pu (L).

Category: Single-Phase / Sources

Ports

NameDirectionValue typeNotes
pelectricaldouble
nelectricaldouble

Parameters

Config

NameLabelTypeDefaultUnitsDescription
modeModeenum (DC / AC)00=DC, 1=AC. In DC mode the source holds a constant magnitude; the frequency / phase / harmonics fields and reactive-power monitoring are hidden.
voltageVdouble1V (V, kV, pu)Source voltage (peak amplitude for AC, magnitude for DC). Pick a unit; pu multiplies by V_base from the Units tab.
frequencyfdouble60Fundamental frequency (Hz). Also drives the pu / reactance → henries conversion for the inductive impedance element and the quarter-cycle window for reactive-power monitoring.
phaseφdouble0Phase angle (radians) of the fundamental sinusoid.
waveformWaveformenum (AC / Harmonics)acPure sinusoidal AC, or AC + user-defined harmonics. Picking `Harmonics` reveals the Harmonics tab.
impedance_typeImpedanceenum (Ideal / R / R-L / R∥L / R-R∥L)RThévenin impedance between the internal EMF and the terminals. `Ideal` = stiff source (exact, via MNA). `R` = pure series resistor. `R-L` = series R+L. `R∥L` = parallel R+L. `R-R∥L` = pre-series R then a parallel R∥L. Fields appear on the Impedance tab; entering 0 drops that element.
ramp_timet_rampdouble0Voltage ramp-up time (s). Amplitude scales 0 → full linearly over `t_ramp`, then holds. Use ~1 fundamental period to avoid a t=0 inrush. 0 disables.
measure_currentMeasure currentenum (Off / On)0Emit source branch current as a simulator observable. Name + unit live on the Signal Names tab.
measure_pMeasure Penum (Off / On)0Emit real (active) power P as an observable. Available in both DC and AC. Instantaneous v·i, low-pass filtered with `pq_time_constant`. Name + unit on the Signal Names tab.
measure_qMeasure Qenum (Off / On)0Emit reactive power Q as an observable. AC only (undefined for DC). Uses a quarter-cycle (T/4) orthogonal-voltage product, low-pass filtered with `pq_time_constant`. Name + unit on the Signal Names tab.
pq_time_constantP/Q filter τ (sec)double2Low-pass filter time constant for P/Q. Smaller tracks transients; larger gives a cleaner steady-state but slower response. Default 2 s rejects 50/60 Hz ripple by ~50 dB.
pq_locationP/Q measured atenum (Terminal / Internal source)terminalWhere the P/Q monitor reads voltage. `Terminal` uses the solved terminal voltage (power delivered into the network). `Internal source` uses the internal EMF behind the Thévenin impedance (the total power the source generates) — the difference is the loss in the source impedance. With `Ideal` impedance the two coincide.

Impedance

NameLabelTypeDefaultUnitsDescription
series_resistanceR (series)double0.001physical (Ω, pu)Series resistive element of the Thévenin impedance. Active for `R` (the sole resistor), `R-L` (the series R between EMF and the terminal) and `R-R∥L` (the pre-series resistor: EMF → R(series) → R∥L → terminal). Set 0 (or non-positive, for the `R` / `R-L` topology with no L) for an ideal source via MNA. Independent Ω / pu selector.
l_mainLdouble0physical (H, Ω, pu)Inductive Thévenin element. `R-L` series L; `R∥L` parallel L; `R-R∥L` inner parallel L. Pick the unit: H (henries), Ω (reactance at this source's `frequency`), or pu (X_pu on V_base / S_base — the source's own `frequency` is used). 0 drops the element.
r_parallelR (parallel)double0.001physical (Ω, pu)Parallel resistive element of the Thévenin impedance. Active for `R∥L` (the parallel R) and `R-R∥L` (the inner parallel R; see `R (series)` for the pre-series resistor). Set 0 to short the parallel branch. Independent Ω / pu selector.

Harmonics

NameLabelTypeDefaultUnitsDescription
num_harmonicsNumber of harmonicsenum (None / 1 / 2 / 3 / 4 / 5)0Extra harmonic terms (1-5) added to the fundamental. Each k contributes mag·sin(kωt + angle).
h1_orderh1 orderint3Harmonic order (integer multiple of f). Common: 3, 5, 7.
h1_magnitudeh1 magnitude (% of V)double0Magnitude as % of V (5.0 = 5%).
h1_angleh1 angle (deg)double0Extra phase angle (deg) for this harmonic term.
h2_orderh2 orderint5
h2_magnitudeh2 magnitude (% of V)double0
h2_angleh2 angle (deg)double0
h3_orderh3 orderint7
h3_magnitudeh3 magnitude (% of V)double0
h3_angleh3 angle (deg)double0
h4_orderh4 orderint11
h4_magnitudeh4 magnitude (% of V)double0
h4_angleh4 angle (deg)double0
h5_orderh5 orderint13
h5_magnitudeh5 magnitude (% of V)double0
h5_angleh5 angle (deg)double0

Signal Names

NameLabelTypeDefaultUnitsDescription
current_nameCurrent namestringIA (A, kA)Signal name for the measured source branch current. Blank = skip. Pick the unit from the dropdown; the published value is scaled to it.
p_signal_nameP signal namestringPW (W, kW, MW)Signal name for filtered real power P. Blank = skip. Pick the unit from the dropdown; the published value is scaled to it.
q_signal_nameQ signal namestringQVAr (VAr, kVAr, MVAr)Signal name for filtered reactive power Q. Blank = skip. Pick the unit from the dropdown; the published value is scaled to it.

Units

NameLabelTypeDefaultUnitsDescription
S_baseS_base (MVA)double100System base apparent power in MVA. Used by `pu` impedance / admittance conversions in this component's `computations` block.
V_baseV_base (kV)double230Base RMS line-to-line voltage in kV. Used by `pu` impedance / admittance conversions in this component's `computations` block.

Observables

SignalTypeDefault nameEnableDescription
branchCurrentsignalfrom current_namemeasure_currentSource branch current, scaled to the chosen unit (A / kA). Active sign convention: positive when current flows OUT of the `p` terminal (and back IN at `n`), i.e. the source is delivering power. The arrow on the symbol points in the positive direction. Consistent across the ideal (MNA) and Norton companion impedance topologies.
p_filteredsignalfrom p_signal_namemeasure_pSource real power P, low-pass filtered with τ = pq_time_constant, scaled to the chosen unit (W / kW / MW). Instantaneous v·i where v is the terminal voltage (`pq_location = terminal`) or the internal EMF behind the Thévenin impedance (`pq_location = source`). Defined in both DC and AC modes.
q_filteredsignalfrom q_signal_namemeasure_qSource reactive power Q (AC only), low-pass filtered with τ = pq_time_constant, scaled to the chosen unit (VAr / kVAr / MVAr). Computed from the quarter-cycle (T/4) orthogonal-voltage product v(t−T/4)·i. v is the terminal voltage (`pq_location = terminal`) or the internal EMF (`pq_location = source`). Positive Q = the source supplies lagging (inductive) reactive power.

Used in samples