[R-sig-dyn-mod] Jacobian and lsodes()

Thomas Petzoldt thomas.petzoldt at tu-dresden.de
Thu Mar 12 08:06:00 CET 2015


Dear Daniel,

many thanks for your report and especially for careful testing! We will 
fix it asap during the next days.

Thomas

Am 3/11/2015 um 10:53 PM schrieb Daniel Kaschek:
> Hi everybody,
>
> I use lsodes() with compiled code and set sparsetype = "sparseusr" in
> combination with "inz". (I had a case where the ODE solution based on
> the automatic computation of the jacobian structure was just wrong). The
> issue is indeed solved by supplying the correct matrix "inz".
>
> However, there might by a minor bug in deSolve v1.11. The code complains
> that "inz" should be orderd by the row number (first column, according
> to the help page). Instead, "inz" should be ordered by the second
> column, i.e. by column number. Furthermore, the length of the real work
> array "lrw" is generally estimated too small by the code. The following
> formula, taken from the documentation of the FORTRAN code of lsodes
> works for me:
>
> 20 + (2 + 1./lenrat)*nnz + (11 + 9./lenrat)*neq
>
> with lanrat = 1, nnz = number of non-zero elements = dim(inz)[1] and neq
> = number of equations.
>
> Cheers,
> Daniel
>
> _______________________________________________
> R-sig-dynamic-models mailing list
> R-sig-dynamic-models at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-dynamic-models
>


-- 
Dr. Thomas Petzoldt
Technische Universitaet Dresden
Faculty of Environmental Sciences
Institute of Hydrobiology
01062 Dresden, Germany

E-Mail: thomas.petzoldt at tu-dresden.de
http://tu-dresden.de/Members/thomas.petzoldt



More information about the R-sig-dynamic-models mailing list