0
$\begingroup$

I am trying to solve a discontinuous ODE using the lsode solver. I tried setting the t_crit parameter to specify the time where the discontinuity is present, but it didn't help.

The analytical solution of the ODE looks like the following, where the discontinuity appears at $t = -0.433$, which is the value I set to the t_crit parameter of lsode. Is there any strategy to tackle this kind of situations with lsode?

enter image description here

Please note that I am restricted to using lsode as the solver.

$\endgroup$
0

1 Answer 1

2
$\begingroup$

If you speak of discontinuous ODE, one would think of a discontinuous right side function. If the discontinuity is only a jump, and only depends on time, then using the t_crit parameter will divide the integration into two pieces there, each piece a well-defined integration task.

What you have here is a singularity in the ODE. One strategy to integrate over the end of the solution is to divide the ODE into a system for the parts of the fraction $y=\frac{u}{v}$, where the system for $(u,v)$ is not singular.

Example: The model Riccati equation $y'=x^2+y^2$. Inserting the fraction gives $$ u'v-uv'=x^2v^2+u^2\\ \iff (u'-x^2v)v=u(v'+u) $$ The non-trivial (and only) case is for the linear system $$ u'=x^2v\\ v'=-u $$ This has continuous coefficients, can thus be integrated without bounds. The singularity of the original equations occurs at the roots of $v$.

$\endgroup$
2
  • $\begingroup$ Thank you Lutz for your answer! I'm still processing the strategy you suggest and I wonder if y = u/v is just a change of variable? Or something I should come up with? $\endgroup$
    – Bruno
    Oct 30, 2022 at 14:00
  • 1
    $\begingroup$ If and how you can use such a de-singularization idea depends on the differential equation. For some, for instance Riccati type DE, it will be natural, for others it may not work at all. $\endgroup$ Oct 30, 2022 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.