State discontinuity after switching

Hi,

The parameters for the triangular wave generator are a frequency of 50kHz and a sample time of 1e-6 sec with 0 degree phase. Maybe you can run the basicVR.m first before running the model because most of the variables are declared there. The .xml files are as attached. Thank you very much for taking the time to help me.

E3M0065090D.xml (7.33 KB)

E3M0065090D_bodydiode.xml (2.54 KB)

C2M0045170D_bodydiode.xml (2.37 KB)