Higher Order ODEs PDF
Higher Order ODEs PDF
To use MATLAB ODE solvers for equations of orders higher than 1, we must first
write the equation as a system of first order equations. This is easily done as
demonstrated in the following example.
Second Order Example
Consider the following well-known 2nd order ODE with constant coefficients a,b,c
and forcing function f(t)
d2y
dy
b
cy f (t )
dt
dt 2
d2y 1
dy
f (t ) b cy
2
dt
a
dt
Next define two new variables x1 y and x2 y and so this allows us to write
the original ODE as the two equations
dx1
x2
dt
dx2 1
f (t ) bx2 cx1
dt
a
or in matrix form
x2
x1
x 1 f (t ) bx cx
2
1
2 a
This is now a first order matrix ODE and the form is sometimes called the Cauchy
or state variable form. Note that this same scheme can be used for ODEs with
orders higher than two.
To use any of the MATLAB ODE solvers we simply follow the previous coding but
apply it to the array of ODEs.
Consider the specific case with a = c = 1, b = f(t) = 0. This yields the equation
d2y
y0
dt 2
that we have seen before. Recall that the exact solution was given by
2
0
-2
-4
Numerical Solution
Exact Solution
-6
-8
5
t
10