help-octave
[Top][All Lists]
Advanced

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

lsode for matrix DGLs?


From: John W. Eaton
Subject: lsode for matrix DGLs?
Date: Fri, 22 Jun 2007 10:11:10 -0400

On 22-Jun-2007, Matthias Brennwald wrote:

| I'd like to integrate a differential equation where dx/dt is a matrix, i.e.:
| 
| dx/dt = f(x,t)
| 
| where:
|    x is a three dimensional array of size m x n x p
|      (i.e. p matrices of size m x n stacked onto each other)
|    t is a vector of length p
|    f is a matrix of size m x n
| 
| The help information on lsode indicates that lsode only works for
| matrix-sized x and vector-sized f. I'd be glad for any pointers, ideas or
| even examples on how to integrate a matrix equation.

I'm pretty sure LSODE requires X to have the same number of elements
as the vector returned by F, and T must be a scalar.  Other than that,
the shape should not really matter, or if Octave is forcing Nx1
vectors on you, then you can always flatten things out when you call
lsode, then reshape to recover the dimensions you prefer to work with
(or fix the interface to lsode so that it doesn't care about the
shape if that has not already been done).

jwe


reply via email to

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