# Buliding an integrator with wrapped state

**URL:** <https://scilab.discourse.group/t/buliding-an-integrator-with-wrapped-state/320>\
**Category:** General usage\
**Created:** [January 6, 2024, 12:06pm UTC](https://scilab.discourse.group/t/buliding-an-integrator-with-wrapped-state/320 "2024-01-06T12:06:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neo1](https://avatars.discourse-cdn.com/v4/letter/n/b9bd4f/32.png) [@Neo1](https://scilab.discourse.group/u/Neo1)\
**Post date:** [January 6, 2024, 12:06pm UTC](https://scilab.discourse.group/t/buliding-an-integrator-with-wrapped-state/320/1 "2024-01-06T12:06:34Z")

</div>

Hello,  
I want to create a system in Xcos where the output integrates until it reaches an upper limit, at which point it resets to a lower limit and continues integration.

 ![image](https://global.discourse-cdn.com/free1/uploads/utc/original/1X/61fe6d2cd43c43696085d2030df68e2c23aae816.png)

Could someone help me with my problem?

Thank you.

Best regards,  
Neo1

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [January 8, 2024, 2:07pm UTC](https://scilab.discourse.group/t/buliding-an-integrator-with-wrapped-state/320/3 "2024-01-08T14:07:59Z")

</div>

Hello,

Where does your screenshot comes from? To me, the easiest way should be to use a modulo block on the output of the integrator:

 ![Screenshot 2024-01-08 at 16.59.50](https://global.discourse-cdn.com/free1/uploads/utc/original/1X/b28be48d9784b9c97aea90ba56a3fd6f468368e3.png)  
[Untitled.zcos](https://scilab.discourse.group/uploads/short-url/2w4zH0SUCHrbQ9bYOp0osh5l7RZ.zcos) (3.0 KB)

S.
