Mathematica: Trouble accurately integrating highly-nonlinear DE

In summary, Jack attempted to numerically solve the IVP around the unit circle, but ran into problems. He corrected an equation for the problem but still experienced issues. He thinks the issue may be due to the presence of a log term in the solution.
  • #1
jackmell
1,807
54
Hi,

I'd like to numerically solve the IVP:

[tex]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[/tex]

around the unit circle, [itex]x=e^{it}[/itex]. 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 [itex]2\pi[/itex] 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 [itex]x(t)=e^{it}[/itex]. 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 [itex]x(t)=re^{it}[/itex], 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: 382
Last edited:
Physics news on Phys.org
  • #2
Afraid I made a mistake differentiating. The equation in t I believe should be:

[tex]-y(y''-iy')+iy'(2y+1+i y')+2y^2-x^2 y^3-y=0[/tex]

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:

FAQ: Mathematica: Trouble accurately integrating highly-nonlinear DE

How does Mathematica handle highly non-linear differential equations?

Mathematica has a powerful built-in function called NDSolve that can accurately integrate highly non-linear differential equations. This function uses advanced numerical methods and algorithms to solve the equations numerically and provide accurate results.

How can I check the accuracy of the integration results in Mathematica?

Mathematica provides various methods for checking the accuracy of integration results. The NDSolve function has an option called AccuracyGoal that allows you to specify the desired level of accuracy. Additionally, you can use the Plot function to visualize the solution and compare it to known solutions or experimental data.

Can Mathematica handle stiff differential equations?

Yes, Mathematica can handle stiff differential equations using the NDSolve function. This function has an option called Method that allows you to specify a specific method for solving stiff equations. Additionally, Mathematica has a built-in function called WhenEvent that can help handle stiffness in differential equations.

Are there any limitations to using Mathematica for integrating highly non-linear DEs?

While Mathematica is a powerful tool for solving differential equations, there are some limitations to consider. The accuracy of the results may depend on the chosen numerical method and the specific problem at hand. Additionally, the integration process may be computationally intensive for highly non-linear equations, which could limit the size of the problem that can be solved.

Is it necessary to have a strong background in mathematics to use Mathematica for integrating DEs?

While a strong background in mathematics can be helpful, it is not necessary to use Mathematica for integrating differential equations. The software has a user-friendly interface and provides helpful documentation and tutorials to guide users through the process. However, a basic understanding of differential equations and their properties is recommended for accurate and meaningful results.

Similar threads

Replies
1
Views
927
Replies
1
Views
734
Replies
1
Views
2K
Replies
1
Views
927
Replies
13
Views
2K
Replies
9
Views
3K
Replies
1
Views
812
Replies
1
Views
1K
Back
Top