Can someone help me with R code to perform approximations to second order differential equations and systems of first order differential equations using Euler's method and Runge-Kutta? I am not a student and this is not for a test or graded assignment. Examples (unrelated to each other): h = 0.1 1. 3(t^2)y'' - 5ty' + 5y = 0 y(1) = 0, y'(1) = 2/3 2. Lotka-Volterra x' = x(3-y) y' = y(x-3) [[alternative HTML version deleted]]
> On 07 Nov 2016, at 19:26, Tom Mosca <tom at vims.edu> wrote: > > Can someone help me with R code to perform approximations to second order differential equations and systems of first order differential equations using Euler's method and Runge-Kutta? I am not a student and this is not for a test or graded assignment.What is this for?> > Examples (unrelated to each other): > > h = 0.1 > > 1. 3(t^2)y'' - 5ty' + 5y = 0 > y(1) = 0, y'(1) = 2/3 > > 2. Lotka-Volterra > x' = x(3-y) > y' = y(x-3) > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.
Google is your friend "R Runge kutta" [1][2] This actually is not the "do my research for me" list... when you have a specific problem with R, this is a good place to get help by providing a reproducible example. You are expected to have some reasonable familiarity with the theory underlying the task you are working on and with basic R syntax so we can focus on where R is not doing what you want. Why are you interested in Euler AND Runge-Kutta? Why aren't you just interested in solving the DEs to within some uncertainty? [1] https://www.jstatsoft.org/article/view/v033i09/v033i09.pdf [2] https://cran.r-project.org/web/views/DifferentialEquations.html -- Sent from my phone. Please excuse my brevity. On November 7, 2016 9:26:12 AM PST, Tom Mosca <tom at vims.edu> wrote:>Can someone help me with R code to perform approximations to second >order differential equations and systems of first order differential >equations using Euler's method and Runge-Kutta? I am not a student and >this is not for a test or graded assignment. > >Examples (unrelated to each other): > >h = 0.1 > >1. 3(t^2)y'' - 5ty' + 5y = 0 > y(1) = 0, y'(1) = 2/3 > >2. Lotka-Volterra > x' = x(3-y) > y' = y(x-3) > > > > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at 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.
Hello Tom Mosca, Re:> Can someone help me with R code to perform approximations to second order differential equations and systems of first order differential equations using Euler's method and Runge-Kutta? I am not a student and this is not for a test or graded assignment. > > Examples (unrelated to each other): > > h = 0.1 > > 1. 3(t^2)y'' - 5ty' + 5y = 0 > y(1) = 0, y'(1) = 2/3 > > 2. Lotka-Volterra > x' = x(3-y) > y' = y(x-3) >For solving differential equations, the famous "lsoda" solver is best, far better than the simple Euler method, and also better than Runge & Kutta. Angels, or very nice people, implemented solving methods using the lsoda into R. Download the package "deSolve" and the world of numerical solutions is at your feet. Succes, Franklin ----- Franklin Bretschneider Dept of Biology Utrecht University bretschr at xs4all.nl
Am 07.11.2016 um 21:52 schrieb Franklin Bretschneider:> Hello Tom Mosca, > > Re: > >> Can someone help me with R code to perform approximations to second order differential equations and systems of first order differential equations using Euler's method and Runge-Kutta? I am not a student and this is not for a test or graded assignment. >> >> Examples (unrelated to each other): >> >> h = 0.1 >> >> 1. 3(t^2)y'' - 5ty' + 5y = 0 >> y(1) = 0, y'(1) = 2/3 >> >> 2. Lotka-Volterra >> x' = x(3-y) >> y' = y(x-3) >> > > > For solving differential equations, the famous "lsoda" solver is best, far better than the simple Euler method, and also better than Runge & Kutta. > Angels, or very nice people, implemented solving methods using the lsoda into R. Download the package "deSolve" and the world of numerical solutions is at your feet.deSolve contains all of this: Euler, Runge-Kutta, lsoda and more ... and you will find many examples, papers, tutorials and books, and a special mailing list (special interest group) at: http://desolve.r-forge.r-project.org Have fun! Thomas Petzoldt> > Succes, Franklin > -----Thanks, Franklin :)> > > > > Franklin Bretschneider > Dept of Biology > Utrecht University > bretschr at xs4all.nl > > ______________________________________________ > R-help at 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. >