# How to use sub-cycle average model in offline simulations?

**URL:** <https://forum.plexim.com/t/how-to-use-sub-cycle-average-model-in-offline-simulations/782>\
**Category:** PLECS\
**Created:** [June 16, 2020, 1:33am UTC](https://forum.plexim.com/t/how-to-use-sub-cycle-average-model-in-offline-simulations/782 "2020-06-16T01:33:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shunM2](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@shunM2](https://forum.plexim.com/u/shunM2)\
**Post date:** [June 16, 2020, 1:33am UTC](https://forum.plexim.com/t/how-to-use-sub-cycle-average-model-in-offline-simulations/782/1 "2020-06-16T01:33:06Z")

</div>

Hello!

I want to use sub-cycle average model in offline simulations not in real-time simulations.

In help and IEEE trans. about sub-cycle, it assumes real-time simulations with FPGA.

Does it mean that we cannot gat time average values without oversampling by FPGA?

Sincerely

---

<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 16, 2020, 1:07pm UTC](https://forum.plexim.com/t/how-to-use-sub-cycle-average-model-in-offline-simulations/782/2 "2020-06-16T13:07:43Z")

</div>

Please refer to the demo models included in the RT Box target support package. There you will notice that both the offline and real-time models use the PWM Capture block and sub-cycle averaged switches. If you run the offline model and inspect the output of the PWM Capture component, you will notice it is a value on the range of 0 to 1.

In offline simulations the PWM Capture block averages the input signal over the “Averaging interval (offline only)” parameter. This parameter is typically set equal to the discretization step size of the subsystem and models the FPGA oversampling and averaging behavior.
