Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #16785
| From | steviep2 <ssplotkin@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Using FindRoot with free parameters |
| Date | 2014-04-12 09:16 +0000 |
| Message-ID | <lib08s$i6f$1@smc.vnet.net> (permalink) |
| Organization | Time-Warner Telecom |
Hi,
I want to define a function of 2 parameters that uses FindRoot. I.e. I have a known but complicated function f[n_,x_] = "complicated function of (n,x)". I want to find the value of x where f[n,x] == alpha, and I want to call this a function xf[alpha_,n_].
So my attempts (this is non-working code) looks something like this:
xf[alpha_, n_] = Function[{x}, x /. FindRoot[f[n,x] - alpha, {x, 2}]]
or
xf[alpha_, n_] = Function[x /. FindRoot[f[n, x] - alpha, {x, 2}]][alpha, n]
It seems this is a pretty simple question-- basically using FindRoot but holding off on substituting in the parameters until later. Is there a simple solution?
Thanks,
StevieP
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar
Using FindRoot with free parameters steviep2 <ssplotkin@gmail.com> - 2014-04-12 09:16 +0000
csiph-web