External constant frequency in Programmable Voltage Source (Three-Phase) produces current, internal constant does not

Hi everyone,
I am using the Simscape Electrical Programmable Voltage Source (Three-Phase) block and noticed a behavior that I cannot fully explain and didnt find anything in the documentation.
When I configure the block as follows:
  • Frequency configuration: External
  • Frequency input: Constant = 50 Hz
  • Phase shift = 0°
my system shows a grid current of about +3 A, although there should ideally be 0 A, since the inverter reference is synchronized to the grid.
However, when I configure the block internally:
  • Frequency configuration: Constant
  • Frequency = 50 Hz
  • Phase shift = 0°
the current in the system is exactly 0 A, which is the expected behavior.
So it seems that an external constant frequency of 50 Hz does not behave identically to the internal constant frequency parameter, even though the value is the same.
My concern is that I will later need to apply a variable frequency signal, so I need to use the external frequency port. Before doing that, I want to understand why a constant external input behaves differently from the internal constant parameter.
Has anyone encountered this behavior before or knows how the block internally handles the external frequency input?
Thanks in advance!

 Accepted Answer

Hello,
When you use internal frequency = 50Hz, the block treats it as a constant parameter, so Simscape can initialize the sinusoid with perfect phase alignment at t=0.
When you use external frequency = 50Hz, the value is treated as a timevarying physical signal. Simscape then integrates the signal to generate the phase, and during initialization even a tiny phase offset (from units, timing, or discretization) appears, this small phase error causes a a small magnitude of grid current.
The External Frequency introduces tiny initialization/phase differences because the block must compute phase from the input, while Internal Frequency uses a fixed analytic phase. Thats why you see ~3A even with a constant 50Hz input.
If needed, drive phase (Φ) externally instead of frequency for perfect synchronization.
Hope this helps.

More Answers (0)

Products

Release

R2025b

Asked:

on 16 Mar 2026 at 0:08

Answered:

on 18 Mar 2026 at 9:34

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!