[R-sig-dyn-mod] Difference between ode.2D and lsodes
Thomas Petzoldt
thomas.petzoldt at tu-dresden.de
Mon Oct 2 11:17:04 CEST 2017
Hi,
1) please note that lower case letters are required for the method
argument, i.e. method="lsodes".
2) then the Details section of the help page ?ode.2D tells us:
"This is the method of choice for 2-dimensional models, that are only
subjected to transport between adjacent layers.
Based on the dimension of the problem, and if lsodes is used as the
integrator, the method first calculates the sparsity pattern of the
Jacobian, under the assumption that transport is only occurring between
adjacent layers. Then lsodes is called to solve the problem."
In short: ode.2D calculates the sparsity pattern for the special case of
typical 2D problems and then calls lsodes.
More can be seen from the R source code of ode.2D:
[...]
bandwidth <- 1
out <- lsodes(y = y, times = times, func = func, parms,
sparsetype = "2D", nnz = c(nspec, rev(dimens), rev(Bnd),
bandwidth), ...)
[...]
Hope it helps,
Thomas
On 30.09.2017 08:23, amiller at math.utah.edu wrote:
> Hello,
> I have been solving a system of PDEs using method of lines and because my
> system is stiff, I have been using LSODES for the ode solver. However,
> today I tried ode.2D choosing method="LSODES" and found that it is able to
> handle larger systems of ODEs than if I just used LSODES. I was wondering
> what the difference is between the two solvers?
> Thank you,
> Anna
More information about the R-sig-dynamic-models
mailing list