Thread: MATLAB and using the script for RK4 method

1. MATLAB and using the script for RK4 method

Hi,

I have a script for Runge-Kutta 4th order method, but i'm not sure how to use it.

Matlab Source Code Examples

scroll to the middle where it says initial value ODE solutions and click on rk4ode2.m

So once I have that, how do i adapt it to fit my specific second order ode? I need to plot some graphs - y v. x, y' v. x, etc.

thanks!

2. Originally Posted by gsds
Hi,

I have a script for Runge-Kutta 4th order method, but i'm not sure how to use it.

Matlab Source Code Examples

scroll to the middle where it says initial value ODE solutions and click on rk4ode2.m

So once I have that, how do i adapt it to fit my specific second order ode? I need to plot some graphs - y v. x, y' v. x, etc.

thanks!
Read the comments, get a right hand side example function as suggested.

If necessary modify the given rhs function.

CB