[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trouble with fsolve
From: |
Adam C Powell IV |
Subject: |
Re: Trouble with fsolve |
Date: |
Thu, 27 Oct 2005 08:59:17 -0400 |
On Tue, 2005-10-18 at 17:17 +0200, David Bateman wrote:
> Adam C Powell IV wrote:
>
> >Greetings,
> >
> >I'm trying to solve a system with a function of more than one parameter:
> >
> >[x,fval] = fsolve(@hello_calc,x_guess,options,z3,Param);
> >
> >where hello_calc is declared later in the same file:
> >
> >function [fval]=hello_calc(x,z3,Param)
> >
> >This works just fine in MATLAB, but in octave I get:
> >
> >error: evaluating for command near line 40, column 1
> >error: called from `hello' in file `hello.m'
> >
> >Can octave fsolve not deal with functions of more than one parameter?
> >That seems to be suggested by the "man page" for fsolve which comes up
> >after the error is displayed...
> >
> >Thanks,
> >-Adam
> >
> >
>
> The syntax with function handles is not supported in the CVS. I wrote a
> patch to support it which was a huge hack, which you can find at
>
> http://www.octave.org/mailing-lists/octave-maintainers/2004/627
>
> together with the explanation of why this is the wrong way to go.. Note
> that the changes to "quad" were made. However daspk, dasrt, dassl,
> fsolve, lsode and odessa weren't converted as the resulting code is an
> ugly hack. The only real solution is to completely dump the existing
> mess for these functions and reimplement it removing the underlying
> fortran code.... So a workaround with global variables is the only way
> this can be done at the moment in octave..
First, thanks for letting me know the state of octave in this regard.
I'm having trouble working around this though. How do I declare global
variables? Octave seems to be ignoring them, e.g. in the attached code.
If I try to declare it above the function (commented), octave throws a
different error...
Thanks,
-Adam
--
GPG fingerprint: D54D 1AEE B11C CE9B A02B C5DD 526F 01E8 564E E4B6
Welcome to the best software in the world today cafe!
http://www.take6.com/albums/greatesthits.html
mysolver.m
Description: Text Data