Using FindRoot with free parameters
- To: mathgroup at smc.vnet.net
- Subject: [mg132565] Using FindRoot with free parameters
- From: steviep2 <ssplotkin at gmail.com>
- Date: Sat, 12 Apr 2014 05:15:39 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
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
- Follow-Ups:
- Re: Using FindRoot with free parameters
- From: Bob Hanlon <hanlonr357@gmail.com>
- Re: Using FindRoot with free parameters