Re: FindRoot & NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg64669] Re: FindRoot & NDSolve
- From: bghiggins at ucdavis.edu
- Date: Sun, 26 Feb 2006 05:07:52 -0500 (EST)
- References: <dtp5ei$eke$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Takashi, You need to make sure you pass a numeric number to NDSolve. You can accomplish this by breaking up the problem up into two steps: sol[a_?NumericQ] := (f /. NDSolve[ {D[f[ x], {x, 1}] - 2 x - a == 0, f[0] == 0}, f, {x, -3, 3}]) [[1]][2] FindRoot[sol[a] == 4, {a, -10, 10}] {a -> -7.317156653158504*^-9} Hope this helps, Cheers, Brian