help-octave
[Top][All Lists]
Advanced

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

LSODE questions


From: John W. Eaton
Subject: LSODE questions
Date: Thu, 8 Nov 2001 23:31:34 -0600

On 23-Oct-2001, Douglas Eck <address@hidden> wrote:

| Probably for John Eaton, but maybe someone else gets the idea. I know I don't.
| These are all specific questions about how lsode is implemented in octave 
2.1.34
| 
| In /usr/src/octave-2.1.34/src/DLD-FUNCTIONS/lsode.cc
| at line 279 I see this:
| 
|        Matrix output (nsteps, nstates + 1);
|        if (crit_times_set)
|       output = ode.integrate (out_times, crit_times);
|        else
|       output = ode.integrate (out_times);
| 
| 
| Q1: Why is output initialized to columns=nstates+1. When I call
| ode.integrate(), output always has columns=nstates after
| integration.
|
| Q2: More basically, why initialize it at all? Why not just a
| "Matrix output;" declaration?

Seems unnecesary.  I've removed the sizing.

| Q3: Is there a way to set the timepoints to compute without
| having to initialize a new ode(...)?  I'm using the solver in conjunction
| with data acquisition and am computing only a few slices at a time. Each
| time I pick up where i left off before. What I'd like to do is this:
| 
| initialize solver
| while (computing)  {
|     set timepoints of solver [tCurrent:.001:tCurrent+k]
|     integrate
|     grab last value from integration to use as initial value in next 
integration
|     tCurrent+=tCurrent+k;
| }

Do the virtual integrate methods declared in base-de.h not do what you
want?  Something like

  LSODE my_ode (...);
  Columnvector x0 = ...;
  double t0 = ...;
  while (computing)
    {
      ColumVector output_times = ...;
      Matrix result = my_ode.integrate (x0, t0, output_times);
      x0 = result.row (result.rows () - 1) . transpose ();
      t0 = output_times (output_times.length () - 1);
    }

?

jwe



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