# Problem with step fixed-variable

**URL:** <https://forum.plexim.com/t/problem-with-step-fixed-variable/787>\
**Category:** PLECS\
**Tags:** solver\
**Created:** [June 19, 2020, 11:28am UTC](https://forum.plexim.com/t/problem-with-step-fixed-variable/787 "2020-06-19T11:28:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matias\_L](https://avatars.discourse-cdn.com/v4/letter/m/b5ac83/32.png) [@Matias\_L](https://forum.plexim.com/u/Matias_L)\
**Post date:** [June 19, 2020, 11:28am UTC](https://forum.plexim.com/t/problem-with-step-fixed-variable/787/1 "2020-06-19T11:28:27Z")

</div>

Hi everyone.

I’m i’m having a problem with my simulation, at this point, i was using Fixed-step with 1e-8 step size to make my simulations, but i have the following problem:

 ![189](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/1X/334329dcbd92335fa211667bdca6f41c2e155b4f.jpeg)

If i change to variable-step, i get the correct result:

 ![189](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/1X/b2943c7580e0eb694b832f2c50c7ac3846bc0693.jpeg)I’m using a couple of ZOH to discretize signals, then, i feed a c-script with this signals to make the control of the converter (the sample time of C-Script is 1/50k [s]). My problem is, when i finish this simulation, i need to program the control and everything in a microcontroller, so, how i can fix the fixed-step simulation???

i’m think is something about the plecs fixed-step solver, but i can change it.

---

<div class="post-metadata">

**Author:** ![Bryan\_Lieblick](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/bryan_lieblick/32/10_2.png) [@Bryan\_Lieblick](https://forum.plexim.com/u/Bryan_Lieblick)\
**Post date:** [June 24, 2020, 10:34am UTC](https://forum.plexim.com/t/problem-with-step-fixed-variable/787/2 "2020-06-24T10:34:36Z")

</div>

Matias, you should be using the variable step solver in this instance. The variable-step solver supports mixing of fixed rate tasks (your digital controller running at 50 kHz) along with accurate modeling of continuous systems (your power stage).
