Displaying 20 results from an estimated 1000 matches similar to: "lsoda( linking to GMP for big numbers from C code)"
2008 Sep 16
0
FW: odesolve dynload example
HI R Gurus,
> This is my first foray into using c-code with R, so ...
> I had a look at the archives and did not find anything on this, so
> hopefully I am not doubling up.
>
I have previously used the following approach where I needed some very
small numbers/large (using Brobdingnag):
surfacewithdiff <- function(t, y, p)
{
const=p["const"]
kay
2008 May 28
1
indexing lists, using brobdingnagian
Dear R-Gurus,
I have ended up with a calculation problem where I need to use brobs.
I have to work my way through a vector with a for loop to act on each
element in a calculation (refering to the previous
value in the new vector of results -- so as far as I know I can't use
"apply") -- this produces a list of brobs.
My problem is, how do I act on, plot this list, or do vector
2004 Jun 10
0
lsoda with arbitrary zero thresholds (with psuedo-solution)
Dear Hank,
Last question first: really, only you can say for sure if 4e-281 and
5e-11 are small enough; it depends on the units you measure your state
variables in. However, this strategy cannot get the state variables to
exactly 0. Obviously, you could get closer to 0.0 faster by setting the
derivatives even larger in absolute value. You may run into problems
with the solver when the
2007 Aug 30
7
Behaviour of very large numbers
Dear all,
I am struggling to understand this.
What happens when you raise a negative value to a power and the result
is a very large number?
B
[1] 47.73092
> -51^B
[1] -3.190824e+81
# seems fine
# now this:
> x <- seq(-51,-49,length=100)
> x^B
[1] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN <snip>
> is.numeric(x^B)
[1] TRUE
> is.real(x^B)
[1]
2008 Jun 03
1
nlm behaviour and error
Hi R-Gurus,
I've been cutting along quite nicely with nlm, until
I threw in the following condition in the function that nlm is
minimising:
if (((term*bexp) < 0.0001)) {
#warning(term*bexp, "=term*bexp",psi,"=psi")
theta<-2000
}
Now when I run this function anywhere else, there is no problem, whether
or the if's condition is met.
When
2007 Jan 12
0
Dummy's guide to S4 methods: package Brobdingnag
Hello List.
please find uploaded to CRAN a new package, Brobdingnag.
This package does two things:
(1) allows computation of very large numbers using a logarithmic
representation.
(2) provides a "Hello, World" example of S4 methods in use: there are
two classes of object
(brob and glub) and one virtual class (swift). The package
includes a vignette that is a
2006 Nov 29
2
How to solve differential equations with a delay (time lag)?
Hi,
I would like to solve a system of coupled ordinary differential equations,
where there is a delay (time lag) term. I would like to use the "lsoda"
function "odesolve" package. However, I am not sure how to specify the
delay term using the syntax allowed by odesolve.
Here is an example of the kind of problem that I am trying to solve:
> library(odesolve)
2006 Oct 31
1
Compiling R packages on Ubuntu
I am unable to compile R packages from source on Ubuntu
dapper/edgy. Does anybody have an experience?
When I do install.packages("nlme",depend=TRUE), I get following error messages. Can someone help?
I get similar messages for any package I try to compile.
VR
-------------
* Installing *source* package 'nlme' ...
** libs
gcc -I/usr/share/R/include -I/usr/share/R/include
2004 Jun 14
1
olesolve: stepsize
Hi,
I am doing a project on the simulation of glucose metabolism based on a
pharmacokinetic modeling in which we have 4 differential equations. I did
this in R by using the odesolve package. It works very well, but I have two
questions:
Here is the odemodel function
_________________________________________________
Ogtt.Odemodel <- function(t, y, p) {
absx <- c(-60, -45, -30,
2006 Oct 31
1
setReplaceMethod
Hi
If x <- 1:10 then x[5] <- 1i will promote
x to be a complex vector.
Suppose I have an S4 class "brob", and have functions
is.brob(), as.brob(), as.numeric() and so forth (minimal self-contained
code below).
If x is numeric (1:10, say) and y is a brob, what
is the best way to make
x[5] <- y
promote x to a brob in the same way as the complex example?
Or is
2006 Sep 15
1
setMethod() woes
Hello everybody
R version 2.4.0 alpha (2006-09-15 r39323), MacOSX 10.4.7
Next S4 problem.
I have "brob" objects that are large real numbers, and now I want "glub"
numbers that are to be a pair of glubs that represent complex numbers.
I want to define binary operator "+" so that if either the left or right
argument are glubs, it uses .ArithGlub.
If either
2006 Aug 30
1
setMethod() and log()
Hi
I am having difficulty with setMethod(). I have a "brob" class of
objects whose
representation has two slots: "x" and "positive". Slot "x" (double)
holds the log
of a number and slot "positive" (logical) its sign. The idea is
that large numbers
can be handled.
I'm trying to implement a log() method using an analogue of the
2006 Sep 04
1
setMethod("Summary")
Hi everyone and thanks for being patient. I've used "!.foo"() et
seq pro tem.
Next problem: how to define "Summary" methods for brobs.
?max says
'max' and 'min' are generic functions: methods can be defined for
them individually or via the 'Summary' group generic. For this to
work properly, the arguments '...' should be
2011 Aug 03
1
NAMESPACE problems
Hi.
I am having difficulty following section 1.6.6 of the R-extensions manual.
I am trying to update the Brobdingnag package to include a NAMESPACE file (the
untb package requires the Brobdingnag package).
Without the NAMESPACE file, the package passes R CMD check cleanly.
However, if I include a NAMESPACE file, even an empty one, R CMD check
gives the following error in 00install.out:
2006 Sep 01
1
setMethod("Logic", ...)
Hi
In V&R the "polynomial" class is explicitly specified to have no
logical operators:
setMethod("Logic", signature(e1="polynomial"), function(e1,e2){stop
("...")})
I too have a class of objects for which I want to
specify that Logic operators do not work, but executing
setClass("brob",
representation = representation
2010 Oct 08
2
Error message in as.brob Usage
I am getting the following error message while using the as.brob function in
some computations:
Error in out.x[ss] <- pmax(x1[ss], x2[ss]) + log1p(+exp(-abs(x1[ss] - :
NAs are not allowed in subscripted assignments
Is there any obvious mistake I am making here that can resolve the above
error message?
Thanks for your help.
Chow
--
View this message in context:
2004 Sep 06
1
A naive lsoda question....
Hello,
I am an R newbie, trying to use lsoda to solve standard
Lotka-Volterra competition equations. My question is: how do I
pass a parameter that varies with time, like say, phix <- 0.7 +
runif(tmax) in the example below.
# defining function
lotvol <- function(t,n,p){
x <- n[1]; y <- n[2]
rx <- p["rx"]; ry <- p["ry"]
Kx <-
2008 Nov 21
1
lsoda warning "too much accuracy requested"
Dear list -
Does anyone have any ideas / comments about why I am receiving the following
warning when I run lsoda:
1: lsoda-- at t (=r1), too much accuracy requested in: lsoda(start, times,
model, parms)
2: for precision of machine.. see tolsf (=r2) in: lsoda(start, times,
model, parms)
I have tried changing both rtol and atol but without success. I saw the
thread in the
2005 Nov 06
1
Problem defining a system of odes as a C library with lsoda
I have been trying to make use of the odesolve library on my
university's Linux grid - currently R version 2.0.1 is installed and
the system runs 64-bit Scientific Linux based on Redhat. I cannot seem
to get lsoda working when I define the model as a shared C library. For
example, the following snippet uses the mymod.c example bundled with
the package:
### START
rm(list=ls())
2005 Oct 25
2
solving ODE's in matrix form with lsoda()
Hello there,
Suppose you want to solve the following system of ODE's (a simple
Lotka-Volterra predator prey model)
dP/dt = beta*P*V - mu*P
dV/dt = r*V - beta*P*V
where P and V are the numbers of predators and prey. Now, this is
easy to do, but suppose you have a system of equations like this,
dP1/dt = beta1*P1*V1 - mu1*P1
dP2/dt = beta2*P2*V2 - mu2*P2
dV1/dt = r1*V1 - beta1*P1*V1