## Backward Euler Method

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

mathmari
Posts: 81
Joined: Sat Apr 27, 2013 11:58 pm UTC

### Backward Euler Method

Hi!!!
I want to write a Matlab code for Backward Euler Method yn+1=yn+hf(tn+1,yn+1).
Which method is better to use to determine yn+1???
Last edited by mathmari on Sun Apr 28, 2013 9:55 am UTC, edited 1 time in total.

gmalivuk
GNU Terry Pratchett
Posts: 26767
Joined: Wed Feb 28, 2007 6:02 pm UTC
Location: Here and There
Contact:

### Re: Backward Euler Method

What have you done so far? Have you done other examples of this method in your class? Where are you getting stuck?

(In other words, give us more to go on. We're not here to do your homework for you.)
Unless stated otherwise, I do not care whether a statement, by itself, constitutes a persuasive political argument. I care whether it's true.
---
If this post has math that doesn't work for you, use TeX the World for Firefox or Chrome

(he/him/his)

mathmari
Posts: 81
Joined: Sat Apr 27, 2013 11:58 pm UTC

### Re: Backward Euler Method

I have written a code using fixed point iteration. Is this a good method for this problem, or is, for example, Newton's method better???

Voekoevaka
Posts: 42
Joined: Wed Apr 10, 2013 10:29 am UTC
Location: Over nine thousand.

### Re: Backward Euler Method

You can write yn+1 in terms of yn and tn+1 (which is already known), but it works only with particular cases of f.
I'm a dozenalist and a believer in Tau !

mathmari
Posts: 81
Joined: Sat Apr 27, 2013 11:58 pm UTC

### Re: Backward Euler Method

Ok...Thank you...!!!

PM 2Ring
Posts: 3713
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Sydney, Australia

### Re: Backward Euler Method

mathmari wrote:I have written a code using fixed point iteration. Is this a good method for this problem, or is, for example, Newton's method better???

It depends on the function. When you put the equation into a form to do fixed point iteration it may diverge instead of converging. Sometimes when that happens you can invert the equation into a form that will converge, but not always. Newton's method isn't guaranteed to converge for all values, either, but when it does it generally converges faster than fixed point iteration. OTOH, you need to know the derivative of your function to use Newton's method.

mathmari
Posts: 81
Joined: Sat Apr 27, 2013 11:58 pm UTC

### Re: Backward Euler Method

PM 2Ring wrote:
mathmari wrote:I have written a code using fixed point iteration. Is this a good method for this problem, or is, for example, Newton's method better???

It depends on the function. When you put the equation into a form to do fixed point iteration it may diverge instead of converging. Sometimes when that happens you can invert the equation into a form that will converge, but not always. Newton's method isn't guaranteed to converge for all values, either, but when it does it generally converges faster than fixed point iteration. OTOH, you need to know the derivative of your function to use Newton's method.

Thank you very much!!!!!!!

dwarduk2
Posts: 31
Joined: Thu Mar 08, 2012 1:17 am UTC

### Re: Backward Euler Method

You can in many cases try using an approximation for the derivative instead of the exact derivative if you want to use Newton's method. I tend to use [f(x+h)-f(x-h)]/2h as my approximation. iirc, the error is O(h^2), so you should make h a small number for best results. It won't generally work for quickly oscillating functions around x or within h of a cusp, though.

mathmari
Posts: 81
Joined: Sat Apr 27, 2013 11:58 pm UTC

### Re: Backward Euler Method

Ok...Thank you very much!!!

MostlyHarmless
Posts: 154
Joined: Sun Oct 22, 2006 4:29 am UTC

### Re: Backward Euler Method

dwarduk2 wrote:or within h of a cusp, though.

Or within h of a corner.