Voltage Source
Physical NetworksThe 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:
Where:
V_p(t)is the potential at the positive conserving terminalp(V).V_n(t)is the potential at the negative conserving terminaln(V).V_{set}is either the staticvoltageparameter or the dynamic value arriving at control inputin.fis 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 () 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