Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6366
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: nested findroot |
| Date | 2011-11-11 09:59 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j9irm4$8ej$1@smc.vnet.net> (permalink) |
| 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@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
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: nested findroot Bob Hanlon <hanlonr357@gmail.com> - 2011-11-11 09:59 +0000
csiph-web