Numerical Analysis/ODE in vector form Exercises
All of the standard methods for solving ordinary differential equations are intended for first order equations. When you need to solve a higher order differential equation, you first convert it to a system of first order of equations. Then you rewrite as a vector form and solve this ODE using a standard method. On this page we demonstrate how to convert to a system of equations and then apply standard methods in vector form.
Reduction to a first order system
[edit | edit source](Based on Reduction of Order and Converting a general higher order equation.)
I want to show how to convert higher order differential equation to a system of the first order differential equation. Any differential equation of order n of the form
can be written as a system of n first-order differential equations by defining a new family of unknown functions
The n-dimensional system of first-order coupled differential equations is then
Differentiating both sides yields
We can express this more compactly in vector form
where for and =
Exercise
[edit | edit source]Consider the second order differential equation with initial conditions and . We will use two steps with step size and approximate the values of and
Since the exact solution is we have and .
Exercise 1: Convert this second order differential equation to a system of first order equations.
[edit | edit source]Solution:
We have second order differential equation with initial conditions and .
Let and . Differentiating and gives
- ,
Thus we have a system of first order equation in vector form
Exercise 2: Apply the Euler method twice.
[edit | edit source]Solution:
By the Euler's method, .
I. First apply to get y1
[edit | edit source]- .
Now we convert as a vector form, where and , then we have
2. Second apply to get y2
[edit | edit source]- .
Similarly, we convert as a vector form, where , where and , then we have
Exercise 3: Apply the Backward Euler method twice.
[edit | edit source]Solution:
By the Backward Euler's method,
I. First apply to get y1
[edit | edit source]- .
Now we convert as a vector form, where , where and , then we have
Now we have to solve a system of linear equations
That is,
Set up augmented matrix to solve this system,
Thus, the solution is
Plugging in , then we have
2. Second apply to get y2
[edit | edit source]- .
Similarly, we convert as a vector form, with , where and , then we have
Now we have to solve a system of linear equations
That is,
Set up augmented matrix to solve this system,
Thus, the solution is
Plugging in , then we have
Exercise 4: Apply the Midpoint method twice.
[edit | edit source]Solution:
By the Midpoint method,
I. First apply to get y1
[edit | edit source]Now we convert as a vector form, where and , then we have
Plugging in , then we have
2. Second apply to get y2
[edit | edit source]Now we convert as a vector form, where and , then we have
Plugging in , then we have
Exercise 5: Using the values from the Midpoint method at t = h in exercise3, apply the Two-step Adams-Bashforth method once.
[edit | edit source]Solution:
By the Midpoint method, we found
Now apply the Two-step Adams-Bashforth method when , then by formula
Vector form is following by
Plugging in
Reference
[edit | edit source]http://en.wikipedia.org/wiki/Ordinary_differential_equation