Using NDSolve on the Painlevé equations

In an earlier question of mine, I was looking for a way to handle certain kinds of singularities (poles) when using NDSolve. Michael E2's answer, which relied on projective geometry was the most upvoted answer.

I have tried generalizing his method to systems of second order \begin{align*} u'&=f(u,v,t), \\ v'&=g(u,v,t), \\ u(t_0)&=u_0, \\ v(t_0)&=v_0,\end{align*} by considering the pair of dependent variables $$(u,v)$$ as an element of $$\mathbb{P}^1 \times \mathbb{P}^1$$, that is \begin{align*}u=\frac{u_1}{u_2}, \\ v=\frac{v_1}{v_2}.\end{align*} This transforms the system to \begin{align*}u_1' u_2-u_1 u_2'&=u_2^2 f \left( \frac{u_1}{u_2}, \frac{v_1}{v_2},t \right), \\ v_1' v_2-v_1 v_2'&=v_2^2 g \left( \frac{u_1}{u_2},\frac{v_1}{v_2},t \right). \end{align*} In order to handle the under-determined nature of these equations, we add the constraints \begin{align*}\frac{\mathrm{d}}{\mathrm{d} t} \left( u_1^2+u_2^2 \right)&\equiv 2u_1 u_1'+2u_2 u_2'=0, \\ \frac{\mathrm{d}}{\mathrm{d} t} \left( v_1^2+v_2^2 \right)&\equiv 2v_1 v_1'+2v_2 v_2'=0. \end{align*}

As a test, here is the code to solve the $$\sec$$-$$\tan$$ system \begin{align*}u'&=uv \\ v'&=u^2, \\ u(0)&=1, \\ v(0)&=0. \end{align*}

sol = NDSolve[{u1'[t] u2[t] - u1[t] u2'[t] ==
u2[t]^2 *u1[t]/u2[t]*v1[t]/v2[t],
v1'[t] v2[t] - v1[t] v2'[t] == v2[t]^2* u1[t]^2/u2[t]^2,
u1[t] u1'[t] + u2[t] u2'[t] == 0, v1[t] v1'[t] + v2[t] v2'[t] == 0,
u1[0] == 1, u2[0] == 1, v1[0] == 0, v2[0] == 1}, {u1[t], u2[t],
v1[t], v2[t]}, {t, -4, 4}, WorkingPrecision -> 30,
MaxSteps -> Infinity]


This works like a charm, in the sense that the quotients $$u_1/u_2$$ and $$v_1/v_2$$ behave like $$\sec$$ and $$\tan$$. However, when I tried handling more complex problems, such as the first Painlevé equation \begin{align*}u'&=v, \\ v'&=6u^2+t,\end{align*} NDSolve couldn't integrate beyond the poles (with the error: NDSolve::ndsz: At t == -1.25774722466261350439119698118, step size is effectively zero; singularity or stiff system suspected.). Here is my (failed) attempt at doing this:

sol = NDSolve[{u1'[t] u2[t] - u1[t] u2'[t] == u2[t]^2*v1[t]/v2[t],
v1'[t] v2[t] - v1[t] v2'[t] == v2[t]^2*(6 u1[t]^2/u2[t]^2 + t),
u1[t] u1'[t] + u2[t] u2'[t] == 0, v1[t] v1'[t] + v2[t] v2'[t] == 0,
u1[0] == 1, u2[0] == 1, v1[0] == 0, v2[0] == 1}, {u1[t], u2[t],
v1[t], v2[t]}, {t, -4, 4}, WorkingPrecision -> 30,
MaxSteps -> Infinity]


My question:

Is there any way to adapt Michael E2's method in order to produce a numerical integrator for the first Painlevé equation that can integrate beyond poles?

Thank you!

• The solution is to integrate around the poles. I wish there were a suboption to NDSolve's RungeKutta such as IntegrationContour to manually specify how to reach the end point... May 30 '18 at 1:22
• I think trying a different constraint may help. Jun 7 '18 at 3:10
• One approach I have used when I was investigating the Painlevé equations was to construct the (nonlinear!) ODE for the associated tau functions, which are analytic. As I recall, the problem was that they also had considerable exponential behavior that made the approach usable only for moderately-sized arguments. Jul 25 '19 at 13:52