# Euler's method

Discussion in 'Math' started by boks, Dec 11, 2008.

1. ### boks Thread Starter Active Member

Oct 10, 2008
218
0
x'' - 2x' + x = 4t, x(0) = 1, x'(0)=1

Introducing $y_1 = x$ and $y_2 = x'$

we have the system

$y_1 ' = y_2$

$y_2 ' = 2y_2 - y_1 + 4t$

right?

Using Euler's method with step size h=0.1, we get

$y_{1, n+1} = y_{1, n} + 0.1y_{2,n}$

$y_{2,n + 1} + 0.1(2y_{2,n} - y_{1,n} + 4t)$

It's easy to see that $y_{1, 1} = 1 + 0.1 \cdot 1 = 1.1$, but what is $y_{2,1}$?

Last edited: Dec 11, 2008
2. ### blazedaces Active Member

Jul 24, 2008
130
0
What issues do you have with euler's method? What don't you understand? Why are you asking us to do simple problems for you?

-blazed

3. ### boks Thread Starter Active Member

Oct 10, 2008
218
0
Updated first post.

Last edited: Dec 11, 2008
4. ### blazedaces Active Member

Jul 24, 2008
130
0
I don't see what the issue is here man...

Well, first of all, I'm going to see that by:

You actually meant:

$y_{2,n + 1} = 0.1(2y_{2,n} - y_{1,n} + 4t)$

In which case

$y_{2,1} = 0.1(2y_{2,0} - y_{1,0} + 4t)$

You have y_{2,0} and you have y_{1,0}.

Proceed. Good luck.

-blazed

Edit: Your t should be $t_n$ where $t_{n+1} = t_n + h$

5. ### steveb Senior Member

Jul 3, 2008
2,433
469
Actually, this is a good question and this issue can be a point of confusion when first learning. One often hears of Forward Euler and Backward Euler methods. The forward method is probably what you are using since it is more common and I think BlazedAces' answer is correct for that approach. However, in the backward Euler method the time value would be t(n+1) instead of t(n).

Anyway, I thought I'd mention that since what appears to be a simple problem can often have little points of confusion.

This simple Forward Euler method is generally not used for numerical analysis since the accuracy is much poorer than higher order methods. However, it is often used in real-time micorprocessor based control systems since the calculations can be perfomed quickly and with minimal delay.

6. ### boks Thread Starter Active Member

Oct 10, 2008
218
0
Yeah, it's the forward method. Then I use t(n)