[R] ODE

hudeyfa jama Hj@m@_96 @ending from hotm@il@com
Thu Apr 12 22:36:12 CEST 2018


Hello All,


I'm struggling to solve this ODE using R,


vdpol <- function (h, v, t) (
          list(c (
            -0.1*v/(pi*(2*10*h-h^2)),
              (v = (-0.1*v/(pi*(2*10*h-h^2))^2) + 2*9.81*h))

                  ))
          library(deSolve)
          yini <- (c(h = 20, v=0))
          nonstiff <- ode(y = yini, func = vdpol,
                          times= seq(0, 30, by = 0.01),
                                     parms = 1)

It says that


 The number of derivatives returned by func() (4) must equal the length of the initial conditions vector (2)


I'm not sure how when i only have two derivates in the equation. I have little to no knowledge of R and I'm following guidance of the internet so any help is appreciated.


Kind Regards,


H



	[[alternative HTML version deleted]]




More information about the R-help mailing list