Main Content

Programmable Voltage Source

Single-phase AC voltage source with optional programmable magnitude, frequency, phase shift and DC offset

  • Programmable Voltage Source block

Libraries:
Simscape / Electrical / Sources

Description

The Programmable Voltage Source block models a single-phase AC voltage source with programmable magnitude, frequency, phase shift and DC offset. Choose the external mode to specify these quantities by physical input signals M, F, Phi and DC. Harmonics and noise can be included in the voltage source.

For relevant equations, see the Voltage Source block.

Limitations

Simulating with harmonics enabled slows down simulation. If you include harmonics, choose a sample time such that harmonics are generated only at frequencies of interest, and not higher.

Simulating with noise enabled slows down simulation. If you include noise, choose a sample time such that noise is generated only at frequencies of interest, and not higher.

Variables

To set the priority and initial target values for the block variables before simulation, use the Initial Targets section in the block dialog box or Property Inspector. For more information, see Set Priority and Initial Target for Block Variables.

Nominal values provide a way to specify the expected magnitude of a variable in a model. Using system scaling based on nominal values increases the simulation robustness. You can specify nominal values using different sources, including the Nominal Values section in the block dialog box or Property Inspector. For more information, see System Scaling by Nominal Values.

Ports

Input

expand all

Physical signal input associated with the DC component of the voltage.

Physical signal input associated with the frequency.

Physical signal input associated with the magnitude.

Physical signal input associated with the phase shift.

Conserving

expand all

Electrical conserving port associated with the positive voltage.

Electrical conserving port associated with the negative voltage.

Parameters

expand all

AC Magnitude

Configure the magnitude of the AC component of the voltage.

Dependencies

Selecting Constant, Ramp, Step, or Modulation exposes related parameters.

Selecting External exposes a physical signal input port.

AC voltage peak magnitude.

Dependencies

This parameter is exposed when the AC magnitude configuration parameter is set to Constant, Ramp, Step, or Modulation.

AC voltage rate of change.

Dependencies

This parameter is exposed when the AC magnitude configuration parameter is set to Ramp.

AC voltage step amplitude.

Dependencies

This parameter is exposed when the AC magnitude configuration parameter is set to Step.

AC voltage modulation magnitude.

Dependencies

This parameter is exposed when the AC magnitude configuration parameter is set to Modulation.

AC voltage modulation frequency.

Dependencies

This parameter is exposed when the AC magnitude configuration parameter is set to Modulation.

Simulation time for start of AC voltage.

Dependencies

This parameter is exposed when the AC magnitude configuration parameter is set to Ramp, Step, or Modulation.

Simulation time for stop of AC voltage.

Dependencies

This parameter is exposed when the AC magnitude configuration parameter is set to Ramp, Step, or Modulation.

Frequency

Configure the frequency of the AC component of the voltage.

Dependencies

Selecting Constant, Ramp, Step, or Modulation exposes related parameters.

Selecting External exposes a physical signal input port.

AC voltage frequency.

Dependencies

This parameter is exposed when the AC frequency configuration parameter is set to Constant, Ramp, Step, or Modulation.

AC frequency rate of change.

Dependencies

This parameter is exposed when the AC frequency configuration parameter is set to Ramp.

AC frequency step amplitude.

Dependencies

This parameter is exposed when the AC frequency configuration parameter is set to Step.

AC frequency modulation magnitude.

Dependencies

This parameter is exposed when the AC frequency configuration parameter is set to Modulation.

AC frequency modulation frequency.

Dependencies

This parameter is exposed when the AC frequency configuration parameter is set to Modulation.

Simulation time for starting AC frequency.

Dependencies

This parameter is exposed when the AC frequency configuration parameter is set to Ramp, Step, or Modulation.

Simulation time for stopping AC frequency.

Dependencies

This parameter is exposed when the AC frequency configuration parameter is set to Ramp, Step, or Modulation.

Phase

Configure the phase of the AC component of the voltage.

Dependencies

Selecting Constant, Ramp, Step, or Modulation exposes related parameters.

Selecting External exposes a physical signal input port.

AC voltage phase shift.

Dependencies

This parameter is exposed when the AC phase shift configuration parameter is set to Constant, Ramp, Step, or Modulation.

AC phase shift rate of change.

Dependencies

This parameter is exposed when the AC phase shift configuration parameter is set to Ramp.

AC phase shift step amplitude.

Dependencies

This parameter is exposed when the AC phase shift configuration parameter is set to Step.

AC phase shift modulation magnitude.

Dependencies

This parameter is exposed when the AC phase shift configuration parameter is set to Modulation.

AC phase shift modulation frequency.

Dependencies

This parameter is exposed when the AC phase shift configuration parameter is set to Modulation.

Simulation time for starting AC phase shift.

Dependencies

This parameter is exposed when the AC phase shift configuration parameter is set to Ramp, Step, or Modulation.

Simulation time for stopping AC phase shift.

Dependencies

This parameter is exposed when the AC phase shift configuration parameter is set to Ramp, Step, or Modulation.

DC Voltage

Configure the DC component of the voltage.

Dependencies

Selecting Constant, Ramp, Step, or Modulation exposes related parameters.

Selecting External exposes a physical signal input port.

DC voltage magnitude.

Dependencies

This parameter is exposed when the DC magnitude configuration parameter is set to Constant, Ramp, Step, or Modulation.

DC voltage rate of change.

Dependencies

This parameter is exposed when the DC magnitude configuration parameter is set to Ramp.

DC voltage step amplitude.

Dependencies

This parameter is exposed when the DC magnitude configuration parameter is set to Step.

DC voltage modulation magnitude.

Dependencies

This parameter is exposed when the DC magnitude configuration parameter is set to Modulation.

DC voltage modulation frequency.

Dependencies

This parameter is exposed when the DC magnitude configuration parameter is set to Modulation.

Simulation time for start of DC voltage.

Dependencies

This parameter is exposed when the DC magnitude configuration parameter is set to Ramp, Step, or Modulation.

Simulation time for stop of DC voltage.

Dependencies

This parameter is exposed when the DC magnitude configuration parameter is set to Ramp, Step, or Modulation.

Harmonics

Configure the source harmonics.

Dependencies

Selecting Generate harmonics exposes related parameters.

Harmonic orders.

Dependencies

This parameter is exposed when the Source harmonics parameter is set to Generate harmonics.

Harmonic to base magnitude ratios. Specify the same number of elements as is specified for the Harmonic orders parameter.

Dependencies

This parameter is exposed when the Source harmonics parameter is set to Generate harmonics.

Harmonic phase shifts. Specify the same number of elements as is specified for the Harmonic orders parameter.

Dependencies

This parameter is exposed when the Source harmonics parameter is set to Generate harmonics.

Simulation time for start of source harmonics.

Dependencies

This parameter is exposed when the Source harmonics parameter is set to Generate harmonics.

Simulation time for stop of source harmonics.

Dependencies

This parameter is exposed when the Source harmonics parameter is set to Generate harmonics.

Noise

Noise configuration.

Dependencies

Selecting Enabled exposes related parameters.

Single-sided spectrum noise power. Density function for the square of the voltage, commonly thought of as a power into a 1 ohm load. To avoid unit ambiguity, some datasheets quote noise voltage as a noise density with units of V/√Hz. In this case, enter the square of the noise density quoted in the datasheet as the parameter value.

Selecting Enabled for the Noise mode parameter exposes this parameter.

Dependencies

Selecting Enabled for the Noise mode parameter exposes this parameter.

The random number seed is the number that initializes the random number generator. The seed is 0 or a positive integer. To control the random number seed, set this parameter to:

  • Not repeatable — The seed changes every time you simulate your model. The block resets the random seed using the MATLAB® random number generator command:

    seed = randi(2^32-1);
  • Repeatable — The seed is the same random number at the start of every simulation. The block sets the value using the same MATLAB random number generator command used by the Not repeatable parameter.

    When you add a Force Noise Source block to your model from the Sources library, the block generates and stores a random value for the repeated seed. When you make a copy of the Force Noise Source block from an existing block in a model, the copy generates a new random value for the repeated seed.

  • Specify seed — The seed is a number that you specify using the Seed parameter. The Seed parameter is only available when you choose Specify seed for the Repeatability parameter.

Dependencies

Selecting Enabled for the Noise mode parameter exposes this parameter.

Selecting Repeatable or Specify seed exposes related parameters.

Seed is auto-generated.

Dependencies

Selecting Enabled for the Noise mode parameter and Repeatable for the Repeatability parameter exposes this parameter.

The seed must be 0 or a positive integer. This parameter is only available when you select Specify seed for the Repeatability parameter.

Dependencies

Selecting Enabled for the Noise mode parameter and Specify seed for the Repeatability parameter exposes this parameter.

The values of the time step period and the initial time offset. If you specify a scalar value for step, the block assumes an offset value of 0.To specify a nonzero value for the initial time offset, specify the parameter values using the vector [step, offset]. The offset value must be less than the step value and greater than or equal to zero.

Dependencies

Selecting Enabled for the Noise mode parameter exposes related parameters.

Extended Capabilities

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

Version History

Introduced in R2019a