[R] ODE

David Winsemius dw|n@em|u@ @end|ng |rom comc@@t@net
Fri Apr 13 02:56:40 CEST 2018


You cross-posted this to StackOverflow (where there is already a response.) Cross-posting is viewed with scorn on both StackOverflow and Rhelp.


> On Apr 12, 2018, at 1:36 PM, hudeyfa jama <Hjama_96 using hotmail.com> wrote:
> 
> 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)
> 

> 	[[alternative HTML version deleted]]

Rhelp is very "old-school". We use plain-text. Do read the information in the links:

> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law




More information about the R-help mailing list