help-octave
[Top][All Lists]
Advanced

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

Re: Progress feedback from lsode?


From: soren
Subject: Re: Progress feedback from lsode?
Date: Mon, 21 Jul 2008 11:42:43 +0200
User-agent: Internet Messaging Program (IMP) H3 (4.2-RC2)

Quoting Matthias Brennwald <address@hidden>:
I'm using lsode for problems that may need a lot of time to be solved.
Every few seconds I'd like to see some feedback on the progress of the
solution. Is this possible? How?

I don't think I've ever used 'lsode', so this advice might be really useless :-) But, what I'd do so to change the function you want to integrate, such that it contains a persistent variable that counts the number of times the function is evaluted. Then you can use that to print some progress once in a while, i.e.

function retval = myfun (varargin)
  persistent num_evals = 0;
  num_evals ++;
  if (mod (num_evals, 10))
    printf ("#");
  endif

  ## Insert your current function body here...
endfunction

I guess something like that should do the trick although I haven't tried it.

Søren




reply via email to

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