Main Content

AC Voltage Source

R2026b

Ideal constant voltage source

  • AC Voltage Source block

Libraries:
Simscape / Foundation Library / Electrical / Electrical Sources

Description

The AC Voltage Source block represents an ideal voltage source that maintains sinusoidal voltage across its output terminals, independent of the current flowing through the source.

The output voltage is defined by the following equation:

V=V0⋅sin(2π⋅f⋅t+φ)

where:

  • V is voltage.

  • V0 is peak amplitude.

  • f is frequency.

  • φ is phase shift.

  • t is time.

Connections + and - are conserving electrical ports corresponding to the positive and negative terminals of the voltage source, respectively. The current is positive if it flows from positive to negative, and the voltage across the source is equal to the difference between the voltage at the positive and the negative terminal, V(+) – V(-).

Examples

Ports

Conserving

expand all

Electrical conserving port associated with the source positive terminal.

Programmatic Use

Port: p

Electrical conserving port associated with the source negative terminal.

Programmatic Use

Port: n

Parameters

expand all

Peak voltage amplitude.

Programmatic Use

Parameter: amp

Phase shift in angular units.

Programmatic Use

Parameter: shift

Voltage frequency, specified in Hz or units directly convertible to Hz (where Hz is defined as 1/s). For example, kHz and MHz are valid units, but rad/s is not.

Programmatic Use

Parameter: frequency

Programmatic Use: Add Block

To add the block programmatically, use the add_block function with one of these library block paths as the source.

"fl_lib/Electrical/Electrical Sources/AC Voltage Source"

Example: add_block("fl_lib/Electrical/Electrical Sources/AC Voltage Source","myModel/myBlock",MakeNameUnique="on")

For information about programmatic access to individual block parameters, see the Programmatic Use section of parameter descriptions on this page.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2007a