| 1 |
\name{diagnostics.deSolve} |
| 2 |
\alias{diagnostics.deSolve} |
| 3 |
\title{Print Diagnostic Characteristics of ODE and DAE Solvers} |
| 4 |
\description{ |
| 5 |
Prints several diagnostics of the simulation to the screen, e.g. |
| 6 |
number of steps taken, the last step size, ... |
| 7 |
} |
| 8 |
\usage{ |
| 9 |
\method{diagnostics}{deSolve}(obj, Full = FALSE, ...) |
| 10 |
} |
| 11 |
\arguments{ |
| 12 |
\item{obj}{is the output matrix as produced by one of the |
| 13 |
integration routines. |
| 14 |
} |
| 15 |
\item{Full}{when \code{TRUE} then all messages will be printed, including |
| 16 |
the ones that are not relevant for the solver. If \code{FALSE}, then only |
| 17 |
the relevant messages will be printed. |
| 18 |
} |
| 19 |
\item{...}{optional arguments allowing to extend \code{diagnostics} |
| 20 |
as a generic function. |
| 21 |
} |
| 22 |
} |
| 23 |
\value{ |
| 24 |
The integer and real vector with diagnostic values; for function \code{lsodar} |
| 25 |
also the root information. |
| 26 |
|
| 27 |
See tables 2 and 3 in vignette("deSolve") for what these vectors contain. |
| 28 |
|
| 29 |
Note: the number of function evaluations are *without* the extra calls |
| 30 |
performed to generate the ordinary output variables (if present). |
| 31 |
|
| 32 |
} |
| 33 |
\details{ |
| 34 |
When the integration output is saved as a \code{data.frame}, then the required |
| 35 |
attributes are lost and method \code{diagnostics} will not work anymore. |
| 36 |
} |
| 37 |
\examples{ |
| 38 |
## The famous Lorenz equations: chaos in the earth's atmosphere |
| 39 |
## Lorenz 1963. J. Atmos. Sci. 20, 130-141. |
| 40 |
|
| 41 |
chaos <- function(t, state, parameters) { |
| 42 |
with(as.list(c(state)), { |
| 43 |
|
| 44 |
dx <- -8/3 * x + y * z |
| 45 |
dy <- -10 * (y - z) |
| 46 |
dz <- -x * y + 28 * y - z |
| 47 |
|
| 48 |
list(c(dx, dy, dz)) |
| 49 |
}) |
| 50 |
} |
| 51 |
|
| 52 |
state <- c(x = 1, y = 1, z = 1) |
| 53 |
times <- seq(0, 50, 0.01) |
| 54 |
out <- vode(state, times, chaos, 0) |
| 55 |
pairs(out, pch = ".") |
| 56 |
diagnostics(out) |
| 57 |
} |
| 58 |
\keyword{ utilities } |