MATLAB Answers

RKF method for second order ODE

6 views (last 30 days)
Sreedhar
Sreedhar on 18 Jun 2014
Answered: Meg Noah on 17 Nov 2020
Hi Does anybody know where program in MATLAB for solution of 2nd order diff equation using RKF method is available. I've seen the RKF method for first order ODE in this site (from book by mathews & Fink). Bur is it available for second order ODE?
TIA

Accepted Answer

Star Strider
Star Strider on 18 Jun 2014
You have to create two first-order ODEs from your second order ODE. This is not difficult.
If you have the SymbolicMath Toolbox, it will even do it for you with the odeToVectorField function, then by matlabFunction to create a function from it that the ODE solvers can use.
  3 Comments

Sign in to comment.

More Answers (3)

Sreedhar
Sreedhar on 19 Jun 2014
Edited: Sreedhar on 19 Jun 2014
Star Strider Thanks for the answer. I am able to turn the 2nd order ODE to 2 first order ODE's and solve it using ode45. But there is a problem during running which I feel can be resolved by RKF method as it uses adaptive time step. However, there appears to be no function built into MATLAB that uses RKF method. Any clues (textbook reference or MATLAB examples) on how to do this ?
TIA

Meg Noah
Meg Noah on 17 Nov 2020
Classical Fifth-, Sixth-, Seventh-, and Eighth-Order Runge-Kutta Formulas with Stepsize ControlRunge-Kutta formulas of high order with stepsize control through leading truncation error term
Document ID
19680027281
Document Type
Other - NASA Technical Report (TR)
Authors
Fehlberg, E.(NASA Marshall Space Flight Center Huntsville, AL, United States)
Date Acquired
September 8, 2013
Publication Date
October 1, 1968
Subject Category
MATHEMATICS
Report/Patent Number
NASA-TR-R-287
Distribution Limits
Public
Copyright
Work of the US Gov. Public Use Permitted.

Meg Noah
Meg Noah on 17 Nov 2020
Low-order classical Runge-Kutta formulas with stepsize control and their application to some heat transfer problemsLow order Runge-Kutta formulas with step control for heat transfer problems
Document ID
19690021375
Document Type
Other - NASA Technical Report (TR)
Authors
Fehlberg, E.(NASA Marshall Space Flight Center Huntsville, AL, United States)
Date Acquired
September 2, 2013
Publication Date
July 1, 1969
Subject Category
MATHEMATICS
Report/Patent Number
NASA-TR-R-315
Funding Number(s)
CONTRACT_GRANT: 129-04-03-00-62
Distribution Limits
Public
Copyright
Work of the US Gov. Public Use Permitted.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!