[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing parameters to fsolve function - new syntax?
From: |
Paul Kienzle |
Subject: |
Re: Passing parameters to fsolve function - new syntax? |
Date: |
Wed, 5 Oct 2005 07:50:24 -0400 |
Correction: you can also call the current fsolve with a string
expression.
E.g.,
octave:1> function y=f(x,a,b,c), y = a*x.^2+b*x+c; end
octave:2> fsolve("f(x,1,-2,-3)",0)
ans = -1.0000
- Paul
On Oct 5, 2005, at 6:40 AM, Paul Kienzle wrote:
Looking at the source to src/DLD-FUNCTIONS/fsolve.cc and
src/variables.cc, it looks like extract_function will only look for
functions defined by string name.
On Oct 5, 2005, at 4:27 AM, Aivo Jürgenson wrote:
Hello,
I have a function f(x,a,b,c), which I would like solve for variable
x, so that f(x,a,b,c)=0, where a,b,c are parameters, which are known
at the time of solving.
However, current fsolve function in Octave only supports one-variable
functions. I suppose there is a work-around to declare specific
global variables and then giving values to those variables before
calling the fsolve function, but this doesn't seem to be a clean way
of organizing this.
The fsolve FIX in the octave-forge package seems to expand this
functionality, but I'm not able to compile it. Also, the status of
this FIX seems to be unclear, as in the development mailing list
message
http://sourceforge.net/mailarchive/message.php?msg_id=11922522:
Paul Kienzle, in May, 2005:
I have no interest in maintaining this function. I am removing it
from
the build system for now, and will purge it completely if nobody
steps
forward to update it.
IIRC, the purpose of this function is to pass extra arguments to
fsolve, but we can do this now with the new syntax:
@(x) f(x,a,b,c)
- Paul
Could somebody explain this new syntax? I would be happy to use this
new and official way of passing extra arguments to fsolve, but I'm
not been able to find any examples of doing it.
Aivo Jürgenson, address@hidden
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------