       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[] /. x -> 1;
ss = FindRoot[((y[x] /. eqsol[s][] ) /. x -> 1) == 0, {s, 0, 10}]
ysol[x_] = y[x] /. eqsol[s /. ss][]

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, y' == s}, y[x], {x, 0, 10}]
ssol = FindRoot[((y[x] /. guess[s][]) /. x -> 10) == 0, {s, -1, -10}]
soln[x_] = y[x] /. guess[s /. ssol][]

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