ODEs of order larger than 1

An ODE of order n can be written in the form

y(n)(t) = f(t, y, y',..., y(n-1))

and has initial conditions

First order systems of ODEs

A first order system of ODEs can be written in the form

y1' = g1(t, y1, ..., yn) , ..., yn' = gn(t, y1, ..., yn)

or, equivalently,

y' = g(t, y)

where y, y', g(t, y) are column vectors.

Converting higher oder ODEs to first order systems

You have to do this to solve the ODE numerically with Matlab. Let y1=y, y2=y', ..., yn=y(n). Then the above n-th order IVP becomes the first order system

y1' = y2
...
yn-1' = yn
yn' = f(t, y1, y2,..., yn)

with the initial conditions