Mathematica: Trouble accurately integrating highly-nonlinear DE

  • Context: Mathematica 
  • Thread starter Thread starter jackmell
  • Start date Start date
  • Tags Tags
    Integrating Mathematica
Click For Summary
SUMMARY

The discussion revolves around numerically solving the initial value problem (IVP) defined by the nonlinear differential equation x^2 y y'' + 2x y y' + 2 y^2 + xy' - x^2 y^3 - (x y')^2 - y = 0 using Mathematica's NDSolve function. The user, Jack, encounters difficulties in achieving accurate integration around the unit circle, specifically with the path returning to the starting point after a 2π route. Despite attempts to adjust parameters such as step size and working precision, the solution diverges, leading to the conclusion that the hypothesis regarding the solution's single-valued nature may be incorrect due to the potential presence of logarithmic terms affecting the integration.

PREREQUISITES
  • Familiarity with nonlinear differential equations
  • Understanding of numerical methods, specifically NDSolve in Mathematica
  • Knowledge of complex analysis, particularly the behavior of complex logarithms
  • Experience with Mathematica programming and syntax
NEXT STEPS
  • Investigate the implications of logarithmic terms in complex differential equations
  • Explore advanced NDSolve parameters in Mathematica for improved accuracy
  • Learn about the behavior of solutions to nonlinear differential equations on complex domains
  • Study the effects of singular points on numerical integration methods
USEFUL FOR

Mathematics researchers, applied mathematicians, and anyone involved in numerical analysis of differential equations, particularly those using Mathematica for complex variable problems.

jackmell
Messages
1,806
Reaction score
54
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

  • de solution.jpg
    de solution.jpg
    14.6 KB · Views: 432
Last edited:
Physics news on Phys.org
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:

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K