Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

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


  • Prev by Date: Re: Sequence@@List
  • Next by Date: Re: FindRoot & NDSolve
  • Previous by thread: Re: FindRoot & NDSolve
  • Next by thread: Re: FindRoot & NDSolve