Skip to content
Back to formatted view

Raw Message

Message-ID: <CAH=5_TWz1thk44Ovb2jX9c-xAZ2O_uxtBTJYxpH-eHe18HJWCA@mail.gmail.com>
Date: 2012-07-18T01:59:36Z
From: TJUN KIAT TEO
Subject: Defining a variable outside of optim or differential equation solver.

This is applicable to either using optim  or the differential equation
solver or any similar solver

Suppose I want to use the differential equation solver and this is my code

d<-y[2]

vdpol<-function(t,y)
{
list(c(1,
       d,
       3,
       4
      )
}


stiff<-ode(y=rep(0,4),times=c(0,1),func=dvdpol,parms=1)


The thing is I want d to be composed of one of state variables in the
differential function vdopl. Can it be done ?

tjun kiat