Sine Voltage Source (sineVoltageSource)
Produces a sine-wave voltage with offset and phase.
Group: Sources · Kind: {"kind":"sineVoltageSource"}
When to use it
Use it for AC mains, test signals and one phase of a three-phase supply. Use DC Voltage Source for DC.
Pins
| Pin | Domain | Meaning |
|---|---|---|
p |
electrical | Positive end |
n |
electrical | Negative end, the reference side |
Common parameters
amp: Height of the wave peak (Default: required)freq: Frequency (Default: required)phase: Where the wave starts in its cycle (Default: 0)offset: Fixed amount added to the wave (Default: 0)
Parameters
| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
amp |
V | required | Height of the wave peak | |
freq |
Hz | required | Frequency | |
phase |
° | 0 | Where the wave starts in its cycle | |
offset |
V | 0 | Fixed amount added to the wave | |
rs |
Ω | 0 | 1m – 10 Ω | Resistance inside the source |
Parameter descriptions are in English in both languages.
Use for: AC mains · Test signals · One grid phase
Not for: Balanced three-phase supply → sine3VoltageSource · Sine references in control → sine
Formulas
| Formula | Equation | Source |
|---|---|---|
| RMS voltage | Vrms = √(offset² + amp²/2) | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), Ch. 11 |
| Period | T = 1/freq | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), Ch. 10 |
| Highest voltage | Vmax = offset + amp | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), Ch. 10 |
Quick check
Inputs:
amp: Peak amplitude = 325 V,ampfreq: Frequency = 50 Hz,freqoffset: DC offset = 0 V,offset
Outputs:
vrms: RMS voltage =sqrt(offset^2 + amp^2/2)Vperiod: Period =1/freqsvmax: Highest voltage =offset + ampV
Model logic
- The output is v(t) = offset + amp·sin(2π·freq·t + phase) from t = 0, phase in degrees, so it starts at offset + amp·sin(phase) with no ramp-in.
- It is an ideal voltage branch; rs above 0 adds a series resistor inside the part, on the n side.
- The sine has no breakpoints, so the step control lands on no point of it and the maximum step alone sets how finely it is sampled.
- One fixed frequency and amplitude for the whole run: harmonics, sags and frequency changes are not modelled.
Model
The voltage is v(t) = offset + amp * sin(2 * pi * freq * t + phase), with phase in degrees. amp is the peak value, not the RMS value. With rs set, a resistor rs sits in series inside the part.
Common mistakes
- amp is the peak, so 230 V RMS mains needs about 325 V. Phase is in degrees, and three phases use 0, -120 and -240.
- A maximum step longer than 1/50 of the period samples the sine too coarsely. A run shorter than about six cycles never reaches steady state.
Problems rules: step.too_large, run.short
Datasheet and sources
amp and freq come from the supply specification, such as 50 Hz and the peak of the RMS rating. rs is the source resistance of the grid or generator.
Example
Open the example with the command file.openExample and the name demo:sineVoltageSource.
Generated by cargo xtask reference from the usage texts and parameter specs. Do not edit by hand.