MATLAB: RKF method for second order ODE

2nd order oderkf

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

Best Answer

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.
Related Question