How to solve differential equations in R

Please forgive me if I'm setting you off on a wild goose chase; it's been over 50 years since I had DE.

Take a look at the function signature for ode in the deSolve::ode help page.

parms is a required argument, which consists of the arguments to func. In your case that is equation2, which takes three arguments, x, y, parameters. But with the parms argument set to FALSE, it doesn't get them. In addition, there is no default value for the method argument, so you have to supply one or select one of the options, such as euler.

One of the greatest obstacles to learning R is the discipline required carefully to read the help pages, understand the required and optional arguments and work the examples.

Good luck!

1 Like