# How to implement a phase-continuous grid frequency step in PLECS?

**URL:** <https://forum.plexim.com/t/how-to-implement-a-phase-continuous-grid-frequency-step-in-plecs/3217>\
**Category:** General\
**Created:** [July 16, 2026, 5:30am UTC](https://forum.plexim.com/t/how-to-implement-a-phase-continuous-grid-frequency-step-in-plecs/3217 "2026-07-16T05:30:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BSL](https://avatars.discourse-cdn.com/v4/letter/b/f07891/32.png) [@BSL](https://forum.plexim.com/u/BSL)\
**Post date:** [July 16, 2026, 5:30am UTC](https://forum.plexim.com/t/how-to-implement-a-phase-continuous-grid-frequency-step-in-plecs/3217/1 "2026-07-16T05:30:55Z")

</div>

I am simulating a three-phase grid-forming inverter. At t = 1 s, I want the grid frequency to change from 50 Hz to 49.9 Hz. However, directly changing the frequency of the built-in three-phase AC voltage source appears to cause a phase jump, because its voltage is calculated as: v(t) = Vm\*sin(w\*t + phi) Changing w directly therefore changes w\*t instantaneously and produces a large artificial power transient. I want the frequency to step while the phase remains continuous. The phase should be calculated as: theta(t) = theta(0) + integral from 0 to t of w(tau) d(tau) What is the recommended way to implement this in PLECS?

---

<div class="post-metadata">

**Author:** ![Oliver\_Schwartz](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/oliver_schwartz/32/6_2.png) [@Oliver\_Schwartz](https://forum.plexim.com/u/Oliver_Schwartz)\
**Post date:** [July 16, 2026, 10:42am UTC](https://forum.plexim.com/t/how-to-implement-a-phase-continuous-grid-frequency-step-in-plecs/3217/2 "2026-07-16T10:42:40Z")

</div>

Use a wrapping integrator with the frequency as input and a sine block:

[SineFrequencyChange.plecs](https://forum.plexim.com/uploads/short-url/tQgIBAMFWpOj6hHB0Wxx7HjL1m.plecs) (8.0 KB)
