# Mathematica: Trouble accurately integrating highly-nonlinear DE

• Mathematica
Hi,

I'd like to numerically solve the IVP:

$$x^2 y y''+2x y y'+2 y^2+xy'-x^2 y^3-(x y')^2-y=0,\quad y(x_0)=1,y'(x_0)=0$$

around the unit circle, $x=e^{it}$. When I attempt to solve it around the entire circle, I think the integration is veering of course. I believe the solution is single-valued which means it should return to the starting point after a $2\pi$ route or at least be closer than in the figure below which shows the imaginary solution. And I'm pretty sure the large dip in the plot below is reflecting a loss of accuracy along the route. I've tried decreasing the step size and increasing working precision, trying a different method, but cannot get the the start and end points closer. I was wondering if someone here could suggest perhaps a better method to use or other NDSolve parameters that might help. Also, the code below reflects the change in variable $x(t)=e^{it}$. There is always the possibility that the path is near a singular point and that would be causing the problem. However, even if I change the radius by letting $x(t)=re^{it}$, for any radius, I still run into the same problem.

Thanks,
Jack

Here's the code I'm using:

Code:
x = Exp[I t];

reim = Im;

tstart = 0;

tend = tstart + 2 \[Pi];

myeqn5 = -I x y[t] y''[t] - x y[t] y'[t] -
I y'[t] (2 y[t] + 1 + I y'[t]) + 2 y[t]^2 - x^2 y[t]^3 - y[t] == 0;
mysol5 = NDSolve[{myeqn5, y[tstart] == 1 , y'[tstart] == 0},
y, {t, tstart, tend}, WorkingPrecision -> 45, MaxStepSize -> 0.001,
MaxSteps -> 100000, AccuracyGoal -> 30, PrecisionGoal -> 30];

p1 = ParametricPlot3D[{Re[z], Im[z], reim[y[t] /. mysol5]} /.
z -> r Exp[I t], {t, tstart, tend}, BoxRatios -> {1, 1, 1},PlotRange->All]

#### Attachments

• 14.6 KB Views: 307
Last edited:

## Answers and Replies

Afraid I made a mistake differentiating. The equation in t I believe should be:

$$-y(y''-iy')+iy'(2y+1+i y')+2y^2-x^2 y^3-y=0$$

However, I seem to be getting the same problem even with this corrected equation.

Sorry for the mistake and the second post. Wasn't sure the best way to edit the post. Think I'll take a step back and check everything out and try some more.

Last edit I hope: After studying the numeric solution and trying to improve the accuracy of the results, I have reached the conclusion that there is nothing wrong with the integration but rather my hypothesis that the solution was either single-valued or n-sheeted is flawed: If the solution contains a log term either explicitly or implicitly such as inverse trig functions, then the numeric solution around a circle would never return to the starting point because of the geometry of the complex log function. It appears this may be the case.

My apologies if anyone has spent time looking or working on this problem.

Last edited: