Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6366 > unrolled thread

Re: nested findroot

Started byBob Hanlon <hanlonr357@gmail.com>
First post2011-11-11 09:59 +0000
Last post2011-11-11 09:59 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re:  nested findroot Bob Hanlon <hanlonr357@gmail.com> - 2011-11-11 09:59 +0000

#6366 — Re: nested findroot

FromBob Hanlon <hanlonr357@gmail.com>
Date2011-11-11 09:59 +0000
SubjectRe: nested findroot
Message-ID<j9irm4$8ej$1@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@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
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web