# Homework Help: Euler's method for coupled ODE's

1. Aug 14, 2014

### Maylis

1. The problem statement, all variables and given/known data
Consider the following pair of coupled first order ODEs

$\dot{y_{1}} = y_{2}$ with $y_{1}(0) = 1$
$\dot{y_{2}} = -y_{1}$ with $y_{2}(0) = 1$

Use the Euler integration method with a step-size $h = 1$ and fill out the entries in the table below

$\begin{bmatrix} t_{k}&y_{1}(t_{k})&y_{2}(t_{k})\\ 0 & &\\ 1 & &\\ 2 & &\\ 3 & & -4\\ \end{bmatrix}$

2. Relevant equations

3. The attempt at a solution
Normally I understand how to do Euler's method, but of course now it's a coupled ODE so I am very confused how to do it. I know in general you do

$y_{k+1} = y_{k} + f(t_{k},y_{k})h$

But with the coupled ODE I am lost

Last edited: Aug 14, 2014
2. Aug 14, 2014

### pasmith

In this equation:
$y$ can be (and normally is) a vector, and $f$ can be (and normally is) a vector-valued function.

3. Aug 14, 2014

### Maylis

How does it look?

$\begin{bmatrix} t_{k}&y_{1}(t_{k})&y_{2}(t_{k})\\ 0 & 1 &1\\ 1 & 2 &0\\ 2 & 2 & -2\\ 3 & 0 & -4\\ \end{bmatrix}$

$\begin{bmatrix} y_{{1},t_{k}=1} \\ y_{{2},t_{k}=1}\\ \end{bmatrix} = \begin{bmatrix} 1 \\ 1 \\ \end{bmatrix} + \begin{bmatrix}1\\-1\\ \end{bmatrix}*1 = \begin{bmatrix} 2 \\ 0 \\ \end{bmatrix}$

$\begin{bmatrix} y_{{1},t_{k}=2} \\ y_{{2},t_{k}=2}\\ \end{bmatrix} = \begin{bmatrix} 2 \\ 0 \\ \end{bmatrix} + \begin{bmatrix}0\\-2\\ \end{bmatrix}*1 = \begin{bmatrix} 2\\ -2 \\ \end{bmatrix}$

$\begin{bmatrix} y_{{1},t_{k}=3} \\ y_{{2},t_{k}=3}\\ \end{bmatrix} = \begin{bmatrix} 2 \\ -2 \\ \end{bmatrix} + \begin{bmatrix}-2\\-2\\ \end{bmatrix}*1 = \begin{bmatrix} 0\\ -4 \\ \end{bmatrix}$

Last edited: Aug 14, 2014