# Simulation speed reduction due to Control / Discrete blocks

**URL:** https://forum.plexim.com/t/simulation-speed-reduction-due-to-control-discrete-blocks/729
**Category:** PLECS
**Tags:** performance, simulation-time, plecs-standalone
**Created:** [January 7, 2020, 6:04am UTC](https://forum.plexim.com/t/simulation-speed-reduction-due-to-control-discrete-blocks/729 "2020-01-07T06:04:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![tinivella](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@tinivella](https://forum.plexim.com/u/tinivella)
#### Post date: [January 7, 2020, 6:04am UTC](https://forum.plexim.com/t/simulation-speed-reduction-due-to-control-discrete-blocks/729/1 "2020-01-07T06:04:27Z")

</div>

Dear all,

I noticed that the same simulation pass from 2s simulation to 25sec when I let PLECS calculate the Discrete mean value and the discrete RMS, is it possible that?

How can I improve it?

Attached the files

[bst\_UV2W\_IPmod\_noBlocks.plecs](https://forum.plexim.com/uploads/short-url/dmrQa8Oaw3AYuQpR9NlhbXaxOz.plecs) (86.8 KB)

[bst\_UV2W\_IPmod\_mitBlocks.plecs](https://forum.plexim.com/uploads/short-url/lzXBEQBY7fvxXYPkSPQJaBV38Sc.plecs) (88.8 KB)

---

<div class="post-metadata">

### Author: ![malepatisankar](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@malepatisankar](https://forum.plexim.com/u/malepatisankar)
#### Post date: [January 7, 2020, 6:19am UTC](https://forum.plexim.com/t/simulation-speed-reduction-due-to-control-discrete-blocks/729/2 "2020-01-07T06:19:27Z")

</div>

Hi.

The blocks mentioned do consume a lot of time for computation when “sample time” is too low and/or “Number of samples” is too high. Try adjusting them and I feel that it is the compromise between “accuracy” and “time”.

Bhavani.

---

<div class="post-metadata">

### Author: ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)
#### Post date: [January 14, 2020, 3:15pm UTC](https://forum.plexim.com/t/simulation-speed-reduction-due-to-control-discrete-blocks/729/3 "2020-01-14T15:15:57Z")

</div>

Hello,

The additional discrete states can slow down the simulation. We are addressing this in our next release with variable step/continuous RMS and THD blocks that will not cause the simulation speed issue.

Thank you,

Kris

---

<div class="post-metadata">

### Author: ![tinivella](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@tinivella](https://forum.plexim.com/u/tinivella)
#### Post date: [January 15, 2020, 3:09am UTC](https://forum.plexim.com/t/simulation-speed-reduction-due-to-control-discrete-blocks/729/4 "2020-01-15T03:09:23Z")

</div>

thanks for the answer and for the support of @lino\_capponi

---

<div class="post-metadata">

### Author: ![tinivella](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@tinivella](https://forum.plexim.com/u/tinivella)
#### Post date: [February 12, 2020, 4:24pm UTC](https://forum.plexim.com/t/simulation-speed-reduction-due-to-control-discrete-blocks/729/5 "2020-02-12T16:24:20Z")

</div>

there is a bug in the RMS block you sent to me, the reason is not clear be seems something with the initial buffer

---

<div class="post-metadata">

### Author: ![Kris\_Eberle](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/kris_eberle/32/6_2.png) [@Kris\_Eberle](https://forum.plexim.com/u/Kris_Eberle)
#### Post date: [February 12, 2020, 5:39pm UTC](https://forum.plexim.com/t/simulation-speed-reduction-due-to-control-discrete-blocks/729/6 "2020-02-12T17:39:36Z")

</div>

Hello, can you please continue your email discussion with Lino about this?

Thank you,

Kris
