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


Groups > comp.soft-sys.math.mathematica > #16785

Using FindRoot with free parameters

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border4.nntp.dca.giganews.com!backlog4.nntp.dca3.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newspump.sol.net!post2.nntp.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail
From steviep2 <ssplotkin@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Using FindRoot with free parameters
Date Sat, 12 Apr 2014 09:16:12 +0000 (UTC)
Sender steve@smc.vnet.net
Approved Steven M. Christensen <steve@smc.vnet.net>, Moderator
Message-ID <lib08s$i6f$1@smc.vnet.net> (permalink)
Lines 15
Organization Time-Warner Telecom
NNTP-Posting-Date 12 Apr 2014 09:22:12 GMT
NNTP-Posting-Host 75864d0a.news.twtelecom.net
X-Trace DXC=E7Qa;48kTg79g9ZDEYmh=8C_A=>8kQj6=;[h;PUXBgb4`9@n`L<iRV<EFiONJ7[Go60g8[`[Q_[N?
X-Complaints-To abuse@twtelecom.net
X-Original-Bytes 1422
Xref csiph.com comp.soft-sys.math.mathematica:16785

Show key headers only | View raw


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


Thread

Using FindRoot with free parameters steviep2 <ssplotkin@gmail.com> - 2014-04-12 09:16 +0000

csiph-web