# State Discontinuity after Switching (Traction Motor Drive)

**URL:** <https://forum.plexim.com/t/state-discontinuity-after-switching-traction-motor-drive/1588>\
**Category:** PLECS\
**Tags:** plecs\
**Created:** [December 5, 2024, 7:44am UTC](https://forum.plexim.com/t/state-discontinuity-after-switching-traction-motor-drive/1588 "2024-12-05T07:44:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hassan\_Ali\_Soomro](https://avatars.discourse-cdn.com/v4/letter/h/4bbf92/32.png) [@Hassan\_Ali\_Soomro](https://forum.plexim.com/u/Hassan_Ali_Soomro)\
**Post date:** [December 5, 2024, 7:44am UTC](https://forum.plexim.com/t/state-discontinuity-after-switching-traction-motor-drive/1588/1 "2024-12-05T07:44:52Z")

</div>

Hello everyone,  
I have developed motor drive model in PLECS standalone, I have same model in MATLAB and tried to duplicate into PELCS standalone.  
The model is not perfect not is it tuned, but I want to see if it is atleast working or not. I have provided a step speed function, and after one second, the error shows " **The current through inductor [3-phase inverter/Perm.-Magnet SM/Electrical model/Voltage behind reactance/L:1](component:G:/Hassan Msc Research Files One Drive/PLECS/3-phase inverter.plecs/Perm.-Magnet SM/Electrical model/Voltage behind reactance/L) is forced to jump from 0.0288608 to 0**."

How do I solve this issue to get on with other requirements, i had same issue with MATLAB blockset but couldn’t follow up.

Thank you in advance for your help

 ![Control](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/2X/4/4b7a9613355186cf643e61bf7bf574f43185feea.png)  
 ![Inverter model](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/2X/a/a3067bc7cf90ee0f77b439c38f5ffc4069d152af.png)  
 ![issue](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/2X/a/ace7aff00d675e1a41fedf72c93721a93f59bf67.png)

---

<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:** [December 5, 2024, 3:04pm UTC](https://forum.plexim.com/t/state-discontinuity-after-switching-traction-motor-drive/1588/2 "2024-12-05T15:04:13Z")

</div>

There are a few resources on this error message including several other forum posts and an [FAQ on the Plexim website](https://www.plexim.com/support/solutions/165).

Normally state discontinuities with large errors (e.g. inductor current from 10A → 0A) point to the issues described in the FAQ on the website. However, state discontinuities with small errors - as is the case in your model - can be due to solver accuracy.

If the state value is not close to zero, then the “Relative Tolerance” setting is the value I would typically adjust. If the state value is very close to zero (as is the case in your model) then I would change the “Absolute Tolerance” from “auto” to a small value (e.g. 1e-3, but depends on the minimum reasonable state value) and adjust this setting from there.

Lastly, your IGBTs do not have any parallel diodes and so you if you have dead-time in your PWM signals you will likely get state-discontinuity errors. You may also want to ensure the “Model” parameter for the PMSM is configured as “Voltage Behind Reactance” model when you have dead-time.
