FindRoot/NDSolve problem in VS5

*To*: mathgroup at smc.vnet.net*Subject*: [mg54841] FindRoot/NDSolve problem in VS5*From*: "Dr A.H. Harker" <a.harker at ucl.ac.uk>*Date*: Fri, 4 Mar 2005 05:07:38 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

Apologies: the second version also fails under V5. Can anybody explain why the following simple illustration of a multiple shooting solution works under Mathematica V4, but fails under V5.0? deq = y''[x] - x^2 y[x] == x + x^3; eqsol[s_] := NDSolve[{deq, y[-1] == 0, y'[-1] == s}, y[x], {x, -1, 1}] y[x] /. eqsol[1][[1]] /. x -> 1; ss = FindRoot[((y[x] /. eqsol[s][[1]] ) /. x -> 1) == 0, {s, 0, 10}] ysol[x_] = y[x] /. eqsol[s /. ss][[1]] This is also fine under V4, fails under V50.0. ch[k_] = y''[x] - k Sqrt[1 + y'[x]^2] == 0 guess[s_] := NDSolve[{ch[.35], y[0] == 0, y'[0] == s}, y[x], {x, 0, 10}] ssol = FindRoot[((y[x] /. guess[s][[1]]) /. x -> 10) == 0, {s, -1, -10}] soln[x_] = y[x] /. guess[s /. ssol][[1]] Tony Harker Department of Physics and Astronomy University College London Gower Street LONDON WC1E 6BT (44)(0)207 679 3404 a.harker at ucl.ac.uk