       Re: nested findroot

• To: mathgroup at smc.vnet.net
• Subject: [mg122812] Re: [mg122787] nested findroot
• From: Bob Hanlon <hanlonr357 at gmail.com>
• Date: Fri, 11 Nov 2011 04:54:54 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <201111101155.GAA25353@smc.vnet.net>

```Since the definitions of f and g use numerical techniques (FindRoot)
these definitions should be restricted to numeric arguments.

psimax[k_] = ArcCos[1 - k^2/2];

m[k_] = (1 - Cos[psimax[k]])/2;

arg[theta_, k_] =
ArcSin[Sqrt[(1 - Cos[theta])/(1 - Cos[psimax[k]])]];

y[theta_, k_] =
- EllipticF[arg[theta, k], m[k]] + 2 EllipticE[arg[theta, k], m[k]];

f[w_?NumericQ] :=
Chop[x /. FindRoot[2 y[psimax[x], x] - y[Pi/2, x] == w/2, {x, 1.7}]]

g[w_?NumericQ] :=
Chop[x /. FindRoot[y[Pi/2, x] == w/2, {x, 1}]]

Plot[g[w] - 9 f[w], {w, .1, .2}]

FindRoot[g[soln] - 9 f[soln] == 0, {soln, .13}]

{soln -> 0.131216}

Bob Hanlon

On Thu, Nov 10, 2011 at 6:55 AM, Anna McCuan <anna.mccuan at gmail.com> wrote:
> I'm getting an error finding a root using functions which are defined
> using findroot.  This happens in spite of the fact that I can graph
> the function and see clearly that there is an easy to find root.  Does
> anyone know how to execute this root search successfully?
>
> The file is posted publicly at http://www.math.gatech.edu/~mccuan/temp/pr=
oblem.nb
>

```

• Prev by Date: How to specify the data-range with Import
• Next by Date: Re: Re: problem seeing, getting, marking, copying coordinates
• Previous by thread: nested findroot
• Next by thread: Re: nested findroot