MatCont deals with systems of smooth ODEs, so you cannot "just" include piecewise functions as it might lead to numerical issues.
What you could do instead is to approximate your piecewise function, say you have a Heaviside, then H(x)=(1+tanh(ax))/2 is a smooth approximation. The higher value of the parameter a the steeper this sigmoidal approximation.
You should still check if the results match what you expect.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Is it possible to solve equations containing piecewise functions? If so, how can it be done?
Thank you!
MatCont deals with systems of smooth ODEs, so you cannot "just" include piecewise functions as it might lead to numerical issues.
What you could do instead is to approximate your piecewise function, say you have a Heaviside, then H(x)=(1+tanh(ax))/2 is a smooth approximation. The higher value of the parameter a the steeper this sigmoidal approximation.
You should still check if the results match what you expect.