I have a 1st order ODE system. One of the equations is piecewise function of 2 of the dependent variables. I try to solve it in Python environment.
\begin{align}\dot x_1 &= x_2 - x_3\\ \dot x_2 &= x_1 + x_4\\ \dot x_3 &= \left\{ \begin{array}{ll} (x_2-x_{4})^{(0.5)} & x_2\ge x_{4}\\ 0, & x_2\lt x_{4} \end{array} \right.\\ \dot x_4 &= x_3 - x_1\end{align}
(Actually this is not my real ODE system. I just fabricate it to sketch my problem. Here is my real ODE system
I have read carefully the book A Primer of Scientific Programming with Python. In that book it is stated that we must write ODEs like that : \begin{align}\dot u &= f(u,t)\end{align} For scalar ODEs u and f correspond to float objects, and to arrays for system of ODEs. But didn't mention if the right hand side is piecewise function of unknown variables.