0

I am trying to use R to solve the differential equation:

x'' + 5x = 0

x(0) = 0

x(1) = 2

I am using the package deSolve, but just cannot seem to get a grasp on how to set up a system.

Jthorpe
  • 9,756
  • 2
  • 49
  • 64
  • you need to decompose it into a system of two first-order equations (i.e. x'=y; y' =-5*x; with corresponding initial conditions) – Ben Bolker Mar 17 '15 at 21:28
  • At the moment I can't see off the top of my head how to convert your ICs into a pair of ICs with respect to x and x' at time zero (math question, not programming question) – Ben Bolker Mar 17 '15 at 21:40
  • except for the IC issue this seems to be a duplicate of http://stackoverflow.com/questions/15756058/any-r-package-to-solve-variable-coefficients-second-order-linear-ode – Ben Bolker Mar 17 '15 at 21:51

0 Answers0