Re: Using FindRoot or interpolation function with symbolic argument

*To*: mathgroup at smc.vnet.net*Subject*: [mg92187] Re: Using FindRoot or interpolation function with symbolic argument*From*: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>*Date*: Mon, 22 Sep 2008 07:09:43 -0400 (EDT)*Organization*: Uni Leipzig*References*: <gb7ob8$nfp$1@smc.vnet.net>*Reply-to*: kuska at informatik.uni-leipzig.de

Hi, a) the Compile[] is pure nonsense, what should be faster when calling the FindRoot[] function. b) you mean f[y_?NumericQ] := x /. FindRoot[ArcTanh[x] == y x, {x, 99/100}] c) your final question "Is there a way to define an NDSolve-digestible equation that calls FindRoot with symbolic arguments?" is just the opposite of that what you like to do .. Regards Jens exoptery at gmail.com wrote: > I'd like to use NDSolve to integrate a pair of ODEs. Expressing > the system as a set of explicit equations, however, requires the > inverse of ArcTanh[x] / x. I thought I'd define a function for this > as follows: > > > f = Compile[{{y, _Real}}, x /. FindRoot[ArcTanh[x] == y x, {x, > 99/100}]]; > > > However, when I set, say, > > > eqn1 = u'[R] == u[R] f[(u[R] (1 + v[R])^2)/(1 + v[R]^2)] > > > Mathematica clearly dislikes the use of symbols instead of a numerical > argument. > > > Is there a way to define an NDSolve-digestible equation that > calls FindRoot with symbolic arguments? > > Thank you for your attention. > > J. >