Skip to content

[R-sig-dyn-mod] "Special" Euler function with verbose output

2 messages · Daniel Reed, Karline Soetaert

#
Hi all:

I have encountered a problem with the euler() function in the deSolve package that I hoped someone could help me with. A brief example of the issue is included below.

library("deSolve")

Model<-function(t,C,p){
        return(list(-p*C))
}

p<-0.1
C<-1

soln<-euler(y=C,times=seq(0,10,by=0.1),func=Model,parms=p,verbose=T)


After counting through the time steps, I receive the following error message:

--------------------
 return code
--------------------
Error in if (name == "daspk") printididdaspk(idid) else printidid(idid) : 
  argument is of length zero

Nevertheless, if I switch verbose=F then I don't seem to get this error. Is this a bug or due to incorrect use of the function? 

Thanks in advance!
#
Dan,

 it is a bug - we will fix it for the next release. Thanks.

Karline

-----Original Message-----
From: r-sig-dynamic-models-bounces at r-project.org [mailto:r-sig-dynamic-models-bounces at r-project.org] On Behalf Of Daniel Reed
Sent: woensdag 11 juli 2012 18:13
To: Special Interest Group for Dynamic Simulation Models in R
Subject: [R-sig-dyn-mod] "Special" Euler function with verbose output

Hi all:

I have encountered a problem with the euler() function in the deSolve package that I hoped someone could help me with. A brief example of the issue is included below.

library("deSolve")

Model<-function(t,C,p){
        return(list(-p*C))
}

p<-0.1
C<-1

soln<-euler(y=C,times=seq(0,10,by=0.1),func=Model,parms=p,verbose=T)


After counting through the time steps, I receive the following error message:

--------------------
 return code
--------------------
Error in if (name == "daspk") printididdaspk(idid) else printidid(idid) : 
  argument is of length zero

Nevertheless, if I switch verbose=F then I don't seem to get this error. Is this a bug or due to incorrect use of the function? 

Thanks in advance!
_______________________________________________
R-sig-dynamic-models mailing list
R-sig-dynamic-models at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-dynamic-models