help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: passing parameters to a funcion with lsode


From: David Bateman
Subject: Re: passing parameters to a funcion with lsode
Date: Mon, 18 Oct 2004 12:10:50 +0200
User-agent: Mutt/1.4.1i

Reading lsode.cc

 if (nargin > 2 && nargin < 5 && nargout < 4)
    {
 <snip>
    }
  else
    print_usage ("lsode");

There is no other way to pass the args to the function. The function itself
is called by the the fortran function lsode that has an inflexible interface
and so what you want can't be done... 

D.


According to roger baig viñas <address@hidden> (on 10/18/04):
> Geordie,
> 
> That's the way I though it could be solved, but I don't like the idea of 
> using global variables, basically for two reasons: first because then 
> functions can't be reused if I don't use the same name for that 
> variables defined as global, and second, because I've alway been thougth 
> that global vars must be avoid (basically due to the first argument, I 
> think).
> 
> Any other solution to pass parameters to a function called by lsode.
> 
> P.S. thanks any way. If I don't fine any other way to do it I'll use 
> your suggestion.
> 
> En/na Geordie McBain ha escrit:
> >This can be done quite easily with global variables.  Declare the
> >parameters global at the top level and inside the function.  Set them at
> >the top level before the function is called.  Then your function can be
> >unary, as required by lsode.
> >
> >See 'Variables/Global variables' in the manual for further details.
> >
> >On Mon, 2004-10-18 at 04:17, roger baig viñas wrote:
> >
> >>I would like to know if it is possible to pass parameters to the 
> >>function that is called from lsode, and if it is, how can i do it.
> >>
> >>I should use lsode like follows:
> >>
> >>Xd=lsode("dxdt_tancDoble_mf",x_0,t)
> >>
> >>with dxdt_tancDoble_mf function that has a header like:
> >>
> >>function dxdt=dxdt_tancDoble_mf(t,x,u,param)
> >>
> >>
> >>Thank you very much
> >>
> >>
> >>
> >>-------------------------------------------------------------
> >>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
> -------------------------------------------------------------

-- 
David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]