I've come across a problem that requires me to solve a differential equation of the form $$ (x'(s)+iy'(s))^3 = F(x(s),y(s)) $$ for a given starting point $(x(0),y(0))=(x_0,y_0)$, where $F$ is a complex-valued function of the (complex) plane (not necessarily analytical), and I would like to know if there are good ways to convince NSolve to solve it.
Now: yes, I know, this is an ugly system, and yes, I know, there's multiple values of the derivative consistent with that equation at any given point, but it's still perfectly possible to ask for curves that are continuously differentiable and which obey it, and that rules out any kinks in the curve outside of the zeroes of $F(x,y)$. And yes, I know that, even then, there's still three valid starting values of the velocity at the initial point - I want all of them, either one by one or, ideally, in one go.
The first thing I thought to try with this one was to just take the cubic root of both sides and hope for the best, via e.g.
Block[{x0, y0, eqns, soln}, x0 = -1; y0 = 1; eqns = Join[ Thread[{x'[s], y'[s]} == ({Re[#], Im[#]}/Abs[#])&[((x[s] - I y[s])^2)^(1/3)]], Thread[{x[0], y[0]} == {x0, y0}] ]; soln = First@NDSolve[eqns, {x, y}, {s, 0, 3}]; ParametricPlot[ {x[s], y[s]} /. soln , {s, 0, 3} , Frame -> True ] ] (where $F(x,y) = (x-iy)^2$ is quite representative, with more general $F(x,y)=(x\pm i y)^n$ also interesting), but this runs into trouble with the cube-root's branch cut:

That is, when the curve reaches the $y$ axis, and therefore $F(x,y)$ reaches the negative real axis from below, the cube root $\sqrt[3]{F(x,y)}$ crosses its branch cut, swaps to another root, and the solution switches to another track that it shouldn't be on.
My main goal is to solve this branch-choosing problem in a way that is as quick, simple, clean, built-in, and efficient as possible. (I'll be doing a lot of these solves once I have this sorted.) Some approaches I've tried:
- If pressed, I can build an Euler's-method integrator where the branch cut is explicitly chosen based on the current value of the velocity. However, I would rather not re-implement stuff that NDSolve is meant to be taking care of for me.
- So far, NDSolve hasn't much liked it when I try and force the right-hand-side to have conditionals (or otherwise, e.g. powers of $x'+iy'$ inside the cube root cancelled by powers outside it) that depend on the velocity on the right-hand side. For all of the stuff I've tried, NDSolve just flat-out refuses to take it.
- I also tried feeding the equation itself, $(x'(s)+iy'(s))^3 = F(x(s),y(s))$ with the cubed velocity and all, into NDSolve, but it wasn't particularly keen on that, either. It does do some of the solving, but it throws a rather wide variety of numerical errors and warnings, it is liable to just plain stop (or even worse, backtrack and re-track and backtrack and re-track over the same bit of trajectory), and it just doesn't seem to be a fan of the form.
So: how can I get Mathematica to integrate equations of this form with as minimal an amount of pain as possible?




Surdmight be helpful. $\endgroup$