Message Boards Message Boards

How to sovle the second order ODE numerically?

Posted 3 years ago

enter image description here

I solved as follows:

eqn = {y''[x] == x^(-1/2)*y[x]^(3/2), y[0] == 1,
  y[∞] ==0}; f1 = NDSolveValue[eqn, y, {x, 0.1, 5}]
ListPlot[Table[{x, f1[x]}, {x, 0, 5, 0.1}], PlotLegends -> {"numerically"}]

However, I get nothing. Your help would be highly appreciated!

POSTED BY: Daniel Niu
4 Replies

Looks like this ODE is very hard to numerically integrate.

f = With[{e = 10^-30, INF = 45}, 
  NDSolveValue[{y''[x]*Sqrt[x] == (y[x]^(3/2) // Re), y[e] == 1, 
    y[INF] == 0}, y, {x, 0, INF}, 
   Method -> {"BoundaryValues" -> {"Shooting", 
       "StartingInitialConditions" -> {y[e] == 1, 
         y'[e] == -(186757417/117599387)}}}, MaxSteps -> 10^6, 
   WorkingPrecision -> 20]](*Only Real part*)

Plot[{f[x], f'[x]}, {x, 10^-30, 45}, PlotRange -> All]
POSTED BY: Mariusz Iwaniuk
Posted 3 years ago

Thank you, Mariusz ! The results are extremely helpful.

POSTED BY: Daniel Niu
Posted 3 years ago

Dear Mariusz, Would you mind giving me more explanation how to get y'[e] == -(186757417/117599387) Thank you so much! Best regards!

POSTED BY: Daniel Niu

With trial and error.

POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract