Euler's method for coupled ODE's

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
gfd43tg
Gold Member
Messages
949
Reaction score
48

Homework Statement


Consider the following pair of coupled first order ODEs

[itex]\dot{y_{1}} = y_{2}[/itex] with ##y_{1}(0) = 1##
[itex]\dot{y_{2}} = -y_{1}[/itex] 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

[itex]\begin{bmatrix}<br /> t_{k}&y_{1}(t_{k})&y_{2}(t_{k})\\<br /> 0 & &\\<br /> 1 & &\\<br /> 2 & &\\<br /> 3 & & -4\\<br /> \end{bmatrix}[/itex]

Homework Equations


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:
Physics news on Phys.org
Maylis said:

Homework Statement


Consider the following pair of coupled first order ODEs

[itex]\dot{y_{1}} = y_{2}[/itex] with ##y_{1}(0) = 1##
[itex]\dot{y_{2}} = -y_{1}[/itex] 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

[itex]\begin{bmatrix}<br /> t_{k}&y_{1}(t_{k})&y_{2}(t_{k})\\<br /> 0 & &\\<br /> 1 & &\\<br /> 2 & &\\<br /> 3 & & -4\\<br /> \end{bmatrix}[/itex]

Homework Equations





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

In this equation:
##y_{k+1} = y_{k} + f(t_{k},y_{k})h##
[itex]y[/itex] can be (and normally is) a vector, and [itex]f[/itex] can be (and normally is) a vector-valued function.
 
How does it look?

[itex]\begin{bmatrix}<br /> t_{k}&y_{1}(t_{k})&y_{2}(t_{k})\\<br /> 0 & 1 &1\\<br /> 1 & 2 &0\\<br /> 2 & 2 & -2\\<br /> 3 & 0 & -4\\<br /> \end{bmatrix}[/itex]

[itex]\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}[/itex]

[itex]\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}[/itex]

[itex]\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}[/itex]
 
Last edited: