1
$\begingroup$

I am attempting to get a shooting method set up, but I am having some trouble finding a solution. I originally had the below code

H=-c^2*y[x]/(y[x]^2*(1 - c^2) - 1 + 
    x)*(-(y'[x]^2) + (y'[x]*y[x] + 1/2)^2/(y[x]^2 - 1 + x) + 
   2*(y[x]^2 - 1 + x)/(x^2))

xmin=10^(-3)

s = ParametricNDSolve[{H - y''[x] == 0, y[xmin] == 1, 
    y[1.14] == 0.216}, y, {x, xmin, 1.14}, {c, y1}, 
   Method -> {"Shooting", 
     "StartingInitialConditions" -> {y[1.14] == 0.216, 
       y'[1.14] == y1}}];

f = y[2, -0.891] /. s

ParametricNDSolve::ndsz: At x$3518359 == 1.1399851492199857`, step size is effectively zero; singularity or stiff system suspected. >>

However, it kept yielding that the system might have a singularity, even though I know the solution is near that point. I increased the working precision and the accuracy, but now it simply says that "The precision of the differential equation is less than working precision". I have read up on the warning, but I am not entirely sure how to fix it. Any help would be appreciated.

$\endgroup$
  • $\begingroup$ The error is coming from within the shooting method. This causes the shooting method to fail, and no solution is returned. You need to find better starting ICs. $\endgroup$ – Michael E2 Aug 8 '16 at 16:45
  • $\begingroup$ You won't get the precision warning if you haven't used or set the option WorkingPrecision to something other than MachinePrecision. $\endgroup$ – Michael E2 Aug 8 '16 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.