Jump to content

Backward Euler Method for 2x2 systems

Featured Replies

Hi!!!
I want to write a code in Matlab for the Backward Euler Method for 2x2 systems, using the fixed point iteration to find the yn+1.
y1n+1=y1n+h*f(tn+1,y1n+1,y2n+1) (1)
y2n+1=y2n+h*g(tn+1,y1n+1,y2n+1) (2)
Could you tell how I use the fixed point iteration??
At (1) the fixed point iteration will calculate y1n+1, y2n+1 will be calculated at (2) but it is already used in the equation (1) ...sad.png

You need an initial guess. One approach is to use forward Euler for that first guess.

 

With this you obtain the simplest of the predictor/corrector class of integration techniques.

  • Author

Do you mean that at the equation (1) I use the fixed point iteration for the y1n+1 and that I replace y2n+1 with the value of forward Euler???

No. You should treat those as simultaneous equations. That means you need an initial guess for [imath]y_1(n+1)[/imath] and for [imath]y_2(n+1)[/imath]. It also means that once you have a [imath]y_1(n+1), y_2(n+1)[/imath] pair you use that pair simultaneously to obtain the next iteration on [imath]y_1(n+1), y_2(n+1)[/imath].

 

Since forward Euler depends on initial value rather than end values, you can use forward Euler to obtain those initial guesses for the final values. Once you have those initial estimates for the end values, iterate with backward Euler until [imath]y_1(n+1), y_2(n+1)[/imath] have both converged to a stationary value.

Addendum to my last post:

 

Even simpler than using forward Euler for that initial guess is to simply use the initial state.

  • Author

For the initial value problem y'(t)=f(t,y(t)), y(t0)=y0, the code is:

for n=1:N
t(n+1)=t(n)+h;
y(n+1)=y(n)+h*f(t(n+1),stage(y(n),h,t(n)));
end

where stage is a function that appreciates the fixed point iteration...

so for 2x2 systems, is the code:
for n=1:N
t(n+1)=t(n)+h;
[latex]y_{1}[/latex](n+1)=[latex]y_{1}[/latex](n)+h*f(t(n+1),stage([latex]y_{1}[/latex](n),h,t(n)),[latex]y_{2}[/latex](n+1)); (1)

[latex]y_{2}[/latex](n+1)=[latex]y_{2}[/latex](n)+h*f(t(n+1),[latex]y_{1}[/latex](n+1),stage([latex]y_{2}[/latex](n),h,t(n))); (2)
end

where at at the equation (1) I replace [latex]y_{2}[/latex](n+1) and at (2) the [latex]y_{1}[/latex] with the initail state???

Edited by mathmari

No. You aren't doing fixed point iteration here, and you aren't touching y2.

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.