MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

FindRoot/NDSolve problem in VS5


  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




  • Prev by Date: Re: Rearranging a data array containing calendrical as well as data entries.
  • Next by Date: Mathematica 4.2 and 5 errors
  • Previous by thread: Re: FindRoot/NDSolve problem in VS5
  • Next by thread: Re: FindRoot/NDSolve problem in VS5