| |
 |
|
|
Science Forum Index » Math - Numerical Analysis Forum » Rk4 order
Page 1 of 1
|
| Author |
Message |
| Guest |
Posted: Sun Mar 04, 2007 5:46 pm |
|
|
|
|
I'm trying to show that RK4 has local truncation error of order 4.
My book's definition of local truncation error is:
[y_(i+1) - y_i] / h - g(t_i, y_i)
where the method has the form u_(i+1) = u_i + h*g(t_i, u_i)
So for RK4 I have g given. I tried to taylor expand y_(i+1) about
y_i, but I don't get nice cancellation (as you would for Euler's
method). Is this the wrong approach?
I assume I could also write out taylor's method of order 4, and expand
in 2-dimensions, but this seems very painful to expand up to order 4.
If I were to do this, should I expand each of the following f's about
(t_i, u_i)? Or is there another point I should expand about [or
several different points]?
k1 = h*f(t_i, u_i)
k2 = h*f(t_i + h/2, u_i + k1/2)
k3 = h*f(t_i + h/2, u_i + k2/2)
k4 = h*f(t_(i+1), u_i + k3) |
|
|
| Back to top |
|
| Peter Spellucci |
Posted: Mon Mar 05, 2007 4:12 am |
|
|
|
Guest
|
In article <1173044819.937306.100580@i80g2000cwc.googlegroups.com>,
chrizm7@yahoo.com writes:
Quote: I'm trying to show that RK4 has local truncation error of order 4.
My book's definition of local truncation error is:
[y_(i+1) - y_i] / h - g(t_i, y_i)
where the method has the form u_(i+1) = u_i + h*g(t_i, u_i)
So for RK4 I have g given. I tried to taylor expand y_(i+1) about
y_i, but I don't get nice cancellation (as you would for Euler's
method). Is this the wrong approach?
I assume I could also write out taylor's method of order 4, and expand
in 2-dimensions, but this seems very painful to expand up to order 4.
If I were to do this, should I expand each of the following f's about
(t_i, u_i)? Or is there another point I should expand about [or
yes, clearly
several different points]?
k1 = h*f(t_i, u_i)
k2 = h*f(t_i + h/2, u_i + k1/2)
k3 = h*f(t_i + h/2, u_i + k2/2)
k4 = h*f(t_(i+1), u_i + k3)
in principle you are quite on the right track, and yes: it becomes cumbersome
if done too straightforward, as you now try it.
indeed, there has been developed a special technique for writing down the
necessary consistency conditions, the "Butcher trees".
look up for example the book of Hairer, Norsett and Wanner:
solving ordinary differential equations I, nonstiff problems, where this
is described quite readable.
hth
peter |
|
|
| Back to top |
|
| Peter Spellucci |
Posted: Mon Mar 05, 2007 7:40 am |
|
|
|
Guest
|
In article <45ec4ab2$0$90266$14726298@news.sunsite.dk>,
Preben <64bitNONOSPAMno@mailme.dk> writes:
something below confusing linear multistep methods which an
Runge-Kutta method which is highly nonlinear.
the consistency conditions for linear multistep meethods are indeed
much easier.
unfortunately here it is not that easy
hth
peter
Quote: I'm trying to show that RK4 has local truncation error of order 4.
My book's definition of local truncation error is:
[y_(i+1) - y_i] / h - g(t_i, y_i)
where the method has the form u_(i+1) = u_i + h*g(t_i, u_i)
So for RK4 I have g given. I tried to taylor expand y_(i+1) about
y_i, but I don't get nice cancellation (as you would for Euler's
method). Is this the wrong approach?
I assume I could also write out taylor's method of order 4, and expand
in 2-dimensions, but this seems very painful to expand up to order 4.
If I were to do this, should I expand each of the following f's about
(t_i, u_i)? Or is there another point I should expand about [or
several different points]?
k1 = h*f(t_i, u_i)
k2 = h*f(t_i + h/2, u_i + k1/2)
k3 = h*f(t_i + h/2, u_i + k2/2)
k4 = h*f(t_(i+1), u_i + k3)
There should be quite an easier method for showing that.:::
See this method:
Notation
f_n = f(x_n, t_n)
The general k-step method can be written as
x_[n+] = phi(f_[n+1], f_n, ...., f_[n-k+1], x_n, ... x_[n-k+1], h)
K-step methods are linear dependend on f_[n+1], f_n, ...., f_[n-k+1],
x_n, ... x_[n-k+1], and can therefore be written as (rewriting done)
sum_j=0^k (alpha_j * x_[n+j]) = h * sum_j=0^k (beta_j f_[n+j])
Let c_i be given by:
c_0 = sum_j=0^k (alpha_j)
c_1 = sum_j=0^k (j*alpha_j - beta_j)
c_i = sum_j=1^k( 1/(i!) * j^i * alpha_j - 1/((i-1)!) * j^(i-1) * beta_j
Then the order p of the method is given by
c_0 = c_1 = ... = c_p = 0, c_[p+1] != 0
It's a lot easier this way...
Hope I didn't do any typo's... Try it out!
I don't know the name of this method, but it's only valid for linear
k-step methods.
You have to rewrite the method, so you don't have evaluation's in ½
time-steps. This should be possible as far as I can see. |
|
|
| Back to top |
|
| Preben |
Posted: Mon Mar 05, 2007 12:53 pm |
|
|
|
Guest
|
Quote: I'm trying to show that RK4 has local truncation error of order 4.
My book's definition of local truncation error is:
[y_(i+1) - y_i] / h - g(t_i, y_i)
where the method has the form u_(i+1) = u_i + h*g(t_i, u_i)
So for RK4 I have g given. I tried to taylor expand y_(i+1) about
y_i, but I don't get nice cancellation (as you would for Euler's
method). Is this the wrong approach?
I assume I could also write out taylor's method of order 4, and expand
in 2-dimensions, but this seems very painful to expand up to order 4.
If I were to do this, should I expand each of the following f's about
(t_i, u_i)? Or is there another point I should expand about [or
several different points]?
k1 = h*f(t_i, u_i)
k2 = h*f(t_i + h/2, u_i + k1/2)
k3 = h*f(t_i + h/2, u_i + k2/2)
k4 = h*f(t_(i+1), u_i + k3)
There should be quite an easier method for showing that.:::
See this method:
Notation
f_n = f(x_n, t_n)
The general k-step method can be written as
x_[n+] = phi(f_[n+1], f_n, ...., f_[n-k+1], x_n, ... x_[n-k+1], h)
K-step methods are linear dependend on f_[n+1], f_n, ...., f_[n-k+1],
x_n, ... x_[n-k+1], and can therefore be written as (rewriting done)
sum_j=0^k (alpha_j * x_[n+j]) = h * sum_j=0^k (beta_j f_[n+j])
Let c_i be given by:
c_0 = sum_j=0^k (alpha_j)
c_1 = sum_j=0^k (j*alpha_j - beta_j)
c_i = sum_j=1^k( 1/(i!) * j^i * alpha_j - 1/((i-1)!) * j^(i-1) * beta_j
Then the order p of the method is given by
c_0 = c_1 = ... = c_p = 0, c_[p+1] != 0
It's a lot easier this way...
Hope I didn't do any typo's... Try it out!
I don't know the name of this method, but it's only valid for linear
k-step methods.
You have to rewrite the method, so you don't have evaluation's in ½
time-steps. This should be possible as far as I can see. |
|
|
| Back to top |
|
| Preben |
Posted: Mon Mar 05, 2007 3:38 pm |
|
|
|
Guest
|
Peter Spellucci skrev:
Quote: In article <45ec4ab2$0$90266$14726298@news.sunsite.dk>,
Preben <64bitNONOSPAMno@mailme.dk> writes:
something below confusing linear multistep methods which an
Runge-Kutta method which is highly nonlinear.
the consistency conditions for linear multistep meethods are indeed
much easier.
unfortunately here it is not that easy
Yes, you are right.. I was a bit too fast here - didn't really think
that much about it! |
|
|
| Back to top |
|
| Robert Israel |
Posted: Tue Mar 06, 2007 1:05 am |
|
|
|
Guest
|
chrizm7@yahoo.com writes:
Quote: I'm trying to show that RK4 has local truncation error of order 4.
My book's definition of local truncation error is:
[y_(i+1) - y_i] / h - g(t_i, y_i)
where the method has the form u_(i+1) = u_i + h*g(t_i, u_i)
So for RK4 I have g given. I tried to taylor expand y_(i+1) about
y_i, but I don't get nice cancellation (as you would for Euler's
method). Is this the wrong approach?
I assume I could also write out taylor's method of order 4, and expand
in 2-dimensions, but this seems very painful to expand up to order 4.
If I were to do this, should I expand each of the following f's about
(t_i, u_i)? Or is there another point I should expand about [or
several different points]?
k1 = h*f(t_i, u_i)
k2 = h*f(t_i + h/2, u_i + k1/2)
k3 = h*f(t_i + h/2, u_i + k2/2)
k4 = h*f(t_(i+1), u_i + k3)
Here's a derivation using Maple. The DE is
y' = f(t,y)
WLOG we can take t_0 = y_0 = 0.
Quote: Order := 5;
de:= D(y)(t) = f(t,y(t)):
sol:= subs(t=h,dsolve({de,y(0)=0},y(t),series)):
k1 := h*f(0,0):
k2 := series(h*f(h/2,k1/2),h):
k3 := series(h*f(h/2,k2/2),h):
k4 := series(h*f(h,k3),h):
y1 := (k1 + 2*k2 + 2*k3 + k4)/6:
series(y1-rhs(sol),h);
.... and the result is
O(h^5)
--
Robert Israel israel@math.MyUniversitysInitials.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada |
|
|
| Back to top |
|
| |
|
Page 1 of 1
All times are GMT - 5 Hours
The time now is Fri Aug 29, 2008 5:43 pm
|
|