Since you only provide pseudo-code I will give a guess as to the source of
the problem.
It is easy to get "burned" by use of the ifelse statement. Its results have
the same "shape" as the first argument.
My suggestion is to try replacing ifelse by a standard
if ( ) {
} else {
}
HTH,
Eric
Dear all,
I am using the DeSolve Package to simulate a system dynamics model. At the
problematic point in the model, I basically want to decide how many products
shall be produced to be sold. In order to determine the amount a basic
forecasting model of using the average of the last 12 time pe
Dear Andre,
some people would be happy to assist you, but your code fragment is
incomplete, so diagnosing your problem was impossible. Please read the
posting guide and provide a minimum reproducible example.
Furthermore I wonder why you use dede and not ode, and why sum() with
empty parenth
It is likely the "p" variable is not defined in your R environment.
Inside your function model.LIDR, the variable "p" is used before being
initialized
in any of the environments reachable by the search path, included the model.LIDR
function environment.
The remedy is to define and initiali
I have the following differential equations and return list:
dCgd.dt = -kad*y[1]-kgd*y[1] # PK model equation gut d
dCld.dt= kad*y[1]-rhyd-rmetd #pk model equation liver d
dCgl.dt = -kal*y2[1]-kgl*y2[1] # PK model equation gut l
dCll.dt= kal*y2[1]-rhyl-rmetl #pk model
On May 20, 2015, at 6:45 AM, walke554 wrote:
> Hello,
>
> I am working on a simple ODE problem with the deSolve package, and I was
> hoping that someone could answer a question about how the deSolve package
> does integration.
>
> Here is my program:
>
> #The function
> STDMod<-function(t,y,
Hello,
I am working on a simple ODE problem with the deSolve package, and I was
hoping that someone could answer a question about how the deSolve package
does integration.
Here is my program:
#The function
STDMod<-function(t,y,p){
IH = y[1];
IL = y[2];
with(as.list(p),
We have been able to reproduce the reported issue on another Linux
system: Fedora 19, and the solution was quite simple:
The deSolve package must always to be loaded *before* loading the shared
library of the compiled model.
Thomas
__
R-help@r-project
On 11/6/2013 6:50 PM, Adam Clark wrote:> Addendum:
unloading and reloading deSolve.so does indeed fix the problem:
library.dynam.unload("deSolve", libpath=paste(.libPaths()[1],
"//deSolve", sep=""))
library.dynam("deSolve", package="deSolve", lib.loc=.libPaths()[1])
However, this is a little cl
Addendum:
unloading and reloading deSolve.so does indeed fix the problem:
library.dynam.unload("deSolve", libpath=paste(.libPaths()[1], "//deSolve",
sep=""))
library.dynam("deSolve", package="deSolve", lib.loc=.libPaths()[1])
However, this is a little clunky, and seems like overkill. Does anybody
On 06/11/2013 17:20, Adam Clark wrote:
I'm having trouble running the "ode" function from the "deSolve" package.
I am running RStudio under Ubuntu 13.1
I am running ode() on compiled code that returns delta values using the .C
convention. While I can include an example of the code, I suspect th
I'm having trouble running the "ode" function from the "deSolve" package.
I am running RStudio under Ubuntu 13.1
I am running ode() on compiled code that returns delta values using the .C
convention. While I can include an example of the code, I suspect that it
will not be helpful, since the prob
, Chippenham, Wiltshire , SN14 OGB UK
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Andras Farkas
Sent: 19 June 2013 00:46
To: r-help@r-project.org; r-sig-dynamic-mod...@r-project.org
Subject: [R] deSolve question
Dear All
Dear All
wonder if you could provide some insights on the following: currently I have
this code which produces the expected results:
require(deSolve)
pars <- list(k = 0.08,v=15)
intimes <- c(0,0.5,12)
input <- c(800,0,0)
forc <- approxfun(intimes, input, method="constant", rule=2)
derivs <-
Berend Hasselman xs4all.nl> writes:
>
>
> On 22-03-2012, at 18:37, mhimanshu wrote:
> > How to find best parameter values for deSolve function??
> >
>
> I assume you mean the deSolve package which has many options.
>
> I would suggest predicting which way the wind will blow the
> day after
On 22-03-2012, at 18:37, mhimanshu wrote:
> Hello all,
>
> How to find best parameter values for deSolve function??
>
I assume you mean the deSolve package which has many options.
I would suggest predicting which way the wind will blow the day after tomorrow.
Berend
Hello all,
How to find best parameter values for deSolve function??
Thanks in Advance,
--
View this message in context:
http://r.789695.n4.nabble.com/deSolve-tp4496292p4496292.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@
Hi everyone.
Can anyone please tell me how do i used optim or nlm function after solving
a ode bx desolve package?
I have a set of two differential equation, first i solved them with deSolve
package and now i want to optimize my two parameter values for the same twoo
differential equation?
pleas
ere is a special R-mailinglist that deals with this type
of problems:
r-sig-dynamic-mod...@r-project.org
Hope this helps,
Karline
-
Original message:
Date: Sat, 1 Oct 2011 20:20:10 -0700 (PDT)
From: Vince
To: r-help@r-project.org
Subject: [R] deSolve - Function daspk on
I'm getting this error on the attached code and breaking my head but can't
figure it out. Any help is much appreciated. Thanks, Vince
CODE:
library(deSolve)
Res_DAE=function(t, y, dy, pars) {
with(as.list(c(y, dy, pars)), {
res1 = -dS -dES-k2*ES
res2 = -dP + k2*ES
eq1 = Eo-E -ES
jamaas wrote:
>
> I'm just getting to grips with using ode function and have used the
> examples and vignettes to produce a small model of a one-pool,
> michaelis-menten, enzyme kinetic reaction. The rate of flux of substrate
> into pool A is constant (fluxoa) however the rate of flux out of p
I'm just getting to grips with using ode function and have used the
examples and vignettes to produce a small model of a one-pool,
michaelis-menten, enzyme kinetic reaction. The rate of flux of substrate
into pool A is constant (fluxoa) however the rate of flux out of pool A
is controlled by th
Hi,
Try with the following ODE function. This should give you an extra
column with the derivative of G in your THAAC matrix.
degradation = function (t, state, parameters) {
with(as.list(c(state, parameters)),
{dG = (-a*(t+i)^b)*(G)
list(c(dG),dG=dG)
})
}
Any additional variables that y
Hi,
I've solved a simple differential equation describing the degradation of
amino acid carbon (THAA-C) using deSolve.
Code is a follows:
# Input of model parameters, a and b describes form of curve, i is apparent
initial age of Org. C.
parameters <- c(a = a, b = b, i=i)
# Initial val
Dear Albert2002,
there is no problem with deSolve and, of course, no problem with R's
modulo operator, but there are at least two errors in your model
formulation:
1.) The order of the returned derivatives must be exactly the same as
specified in the state variables. This is documented in th
I have a problem integrating the 'standard map' (
http://en.wikipedia.org/wiki/Standard_map
http://en.wikipedia.org/wiki/Standard_map ) with deSolve:
By using the modulo-operator '%%' with 2*pi in the ODEs (standardmap1), the
resulting values of P and Theta, should not be greater than 2pi. Becaus
On 6/8/2010 2:03 PM, Ben Bolker wrote:
yahoo.com> writes:
Hi,
I have used DeSolve package for my ODE problem regarding
infectious disease transmission and currently am
trying to pass lots (roughly a thousand) of model parameters
to the C compiled model (I have to use C
compiled code inst
yahoo.com> writes:
>
> Hi,
>
> I have used DeSolve package for my ODE problem regarding
> infectious disease transmission and currently am
> trying to pass lots (roughly a thousand) of model parameters
> to the C compiled model (I have to use C
> compiled code instead of R code purely because
Hi,
I have used DeSolve package for my ODE problem regarding infectious disease
transmission and currently am trying to pass lots (roughly a thousand) of model
parameters to the C compiled model (I have to use C compiled code instead of R
code purely because of the speed).
I can't go define it
In-Sun,
It is very simple. You define your state variables in the following order:
y <- c(Agi = 0,Alu = 0, Abr = 0, Ah = 0, Ali = 0, Ak = 0, Am = 0, Ask =
0, Aad = 0, Apa = 0, Asp = 0, Aar = 0, Ave = 0)
and your rates of change in another order:
dy = c(dAar, dAve, dAlu, dAli, dAbr,
insun nam wrote:
Dear All,
I like to simulate a physiologically based pharmacokinetics model using R
but am having a problem with the daspk routine.
The same problem has been implemented in Berkeley madonna and Winbugs so
that I know that it is working. However, with daspk it is not, and the
nu
Dear In-Sun:
I have not seen a reply, so I will offer some suggestions, hoping
I can help without understanding all the details.
1. Have you run that code with "options(warn=2)"? It
produced over 50 warnings for me, and "options(warn=2)" will convert the
warnings to erro
Dear All,
I like to simulate a physiologically based pharmacokinetics model using R
but am having a problem with the daspk routine.
The same problem has been implemented in Berkeley madonna and Winbugs so
that I know that it is working. However, with daspk it is not, and the
numbers are everywher
33 matches
Mail list logo