Loading

   

Demonstration of class ODESolver usage: A linear 2nd order differential system of equations

We present a program to solve by a numerical scheme a system of first-order linear differential equations of the form

                  A2y'' + A1y' + A0y = f
where the matrices A0 and A1 and A2 are
        | 2  -1 |         | -2  0 |       | 2  0 |
   A0 = |       |,   A1 = |       |, A2 = |      |
        | -1  2 |         |  0  1 |       | 0  1 |

and
       |  (2-2π2)sin(πt) - 2πcos(πt) - cos(2πt) |
   f = |                                       |.
       | (2-4π2)cos(2πt) - 2πsin(2πt) - sin(πt) |

With adapted initial conditions, the solution is given by
        y1(t) = sin(πt), y2 = cos(2πt)