V

Voltage Source

Physical Networks
Run the live example Free · no sign-up · runs in your browser

The VoltageSource block models an ideal electrical voltage source that maintains a prescribed potential difference between its positive terminal p and negative terminal n. The source can operate in either direct current (DC) mode or alternating current (AC) sinusoidal mode.

Additionally, the block features an optional causal input port in (Ctrl). When connected, the incoming numerical control signal modulates or directly overrides the source voltage, allowing dynamic setpoint control and closed-loop excitation of physical circuits from standard block diagram signals.

Real-World Analog: Represents a chemical battery, bench DC power supply, or alternator maintaining a specified voltage across its terminals.

Mathematical Model

The voltage across the source terminals is defined by:

Vp(t)−Vn(t)={Vset,if DCVset⋅sin⁡(2πft),if ACV_p(t) - V_n(t) = \begin{cases} V_{set}, & \text{if DC} \\ V_{set} \cdot \sin(2\pi f t), & \text{if AC} \end{cases}

Where:

  • V_p(t) is the potential at the positive conserving terminal p (V).
  • V_n(t) is the potential at the negative conserving terminal n (V).
  • V_{set} is either the static voltage parameter or the dynamic value arriving at control input in.
  • f is the excitation frequency in Hertz (Hz) for AC mode.

Inputs & Outputs

Direction ID Label Type Status
→ In p + number Required
→ In n - number Required
→ In in Ctrl number Optional

Parameters

Parameters Label Type Default Description
voltage Voltage (V) number 10
source_type Type select DC
frequency Frequency (Hz) number 50 AC frequency in Hertz (active when Type is AC)

Usage Examples

Step-Modulated Power Supply

In examples/basic-voltagesource.json, a Step block commands the source from 0 V to 12 V across a 24 Ω resistive load to Ground, with a VoltageSensor monitoring the output.

Constant DC Power Supply

Supply an active 12V rail to an electrical subcircuit:

VoltageSource(voltage: 12, source_type: DC) → Circuit

Remarks & Best Practices

  • Acausal Augmentation: Adds an auxiliary current variable to the MNA equation system.
  • Signal Bridging: Seamlessly translates causal control signals into physical acausal voltages.
  • Ideal Characteristic: Exhibits zero internal output impedance; place a series resistor to model real source resistance.
  • High Frequency Sampling: Ensure simulation sample time satisfies the Nyquist condition (Ts≪1/(2f)T_s \ll 1/(2f)) when using AC mode.

Related Components

  • VoltageSensor: Measure voltages across arbitrary circuit branches
  • CurrentSensor: Measure through currents delivered by the source
  • Ground: Zero-volt reference potential
  • Resistor: Add internal source impedance