[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is there a parametric version of fsolve?
From: |
John W. Eaton |
Subject: |
Is there a parametric version of fsolve? |
Date: |
Sun, 2 Mar 1997 15:52:01 -0600 |
On 2-Mar-1997, Craig Earls <address@hidden> wrote:
| I have a multivariable function:
|
| x=foo(r,s,t)
|
| give r and s how can I can find t such that x=0. The order of the
| arguments is not important, but I need to vary the other parameters so
| hard coding them in and using fsolve is very inconvenient. Ideally what
| I would like is something like fsolve, but with extraparameters:
|
| fsolve("foo",r,3,5)
|
| where 3 and 5 get passed throught to foo, and r is varied to find zero.
| I am starting to hack fsolve.cc to do this but that looks like a steep
| climb for a short project, is ther a better way already extant?
Global variables?
function foo (r, s, t)
...
endfunction
global s = 3;
global t = 5;
function fsolve_foo (x)
global s;
global t;
foo (x, s, t);
endfunction
fsolve ("fsolve_foo", r0)
jwe