Ngô Quốc Anh

June 20, 2009

How to apply the Runge–Kutta 4 method to the system of 1st order ODEs?

In numerical analysis, the Runge–Kutta methods are an important family of implicit and explicit iterative methods for the approximation of solutions of ordinary differential equations.

The common fourth-order Runge–Kutta method

One member of the family of Runge–Kutta methods is so commonly used that it is often referred to as “RK4” or simply as “the Runge–Kutta method”. Let an initial value problem be specified as follows.

y' = f(t, y), a \leq t \leq b with y(a) = y_0.

We equally split the interval [a,b] into N subintervals by the following interior points

a = t_0 <t_1<...<t_{N-1}<t_N = b.

Of course, t_i = a + i\frac{b-a}{N}. The number \frac{b-a}{N}, which will be denoted by h, is called the step size. The value of y at step i is usually denoted by y_i, that is, y_i = y(t_i). Therefore, the initial value problem can be rewritten as y' = f(t, y), where a \leq t \leq b and with y(t_0) = y_0. The Runge–Kutta 4 method tells us that, having the value of y at t_i, we can compute the value of y at t_{i+1} by using the following scheme

\begin{gathered}   {K^1} = hf\left( {{t_i},{y_i}} \right) \hfill \\   {K^2} = hf\left( {{t_i} + \frac{h} {2},{y_i} + \frac{1}...

Thus, for each step, we need to compute all four K^i, i =\overline{1,4}, constants.

The Runge–Kutta 4 method for a system of ODEs

Now we investigate the question in the title of this entry. An mth-order system of 1st initial value problems has the form

\begin{gathered}   {{y'}_1}\left( t \right) = {f_1}\left( {t,{y_1},...,{y_m}} \right), \hfill \\   {{y'}_2}\left( t \right) =...

for a \leq t \leq b, with the initial conditions

y_1(a)=\alpha_1, y_2(a)=\alpha_2,…,y_m(a)=\alpha_m.

Let t_i be a+i\frac{b-a}{N}. We denote by y_{i,j} the following number

{y_{i,j}} = {y_i}\left( {{t_j}} \right), \quad i = \overline {1,m} , \quad j = \overline {0,N} .

At each step j+1, having all y_{i,j} we can compute y_{i,j+1} for all i=\overline{1,m}. To do this, for each i, we need to compute all K^k, k=\overline{1,4}. More precisely, we need to compute

\begin{gathered}   K_{i,j}^1 = h{f_i}\left( {{t_j},{y_{1,j}},{y_{2,j}},...,{y_{m,j}}} \right), \hfill \\   K_{i,j}^2 = h{f_i}...

As can be seen, at step j and for each k=\overline{1,3}, all the values K_{i,j}^k, with i=\overline{1,m} must be computed before any of the expressions K_{i,j}^{k+1}.

Example

We now consider the following example

\begin{gathered}   u'\left( t \right) = f\left( {t,u,v} \right), \hfill \\   v'\left( t \right) = g\left( {t,u,v} \right). \h...

Therefore, at the step j+1, we can compute u(t_{j+1}) and v(t_{j+1}) by using the following scheme

\begin{gathered}   {K^1} = hf\left( {{t_j},{u_j},{v_j}} \right), \hfill \\   {\overline K ^1} = hg\left( {{t_j},{u_j},{v_j}} ...

5 Comments »

  1. Độ chính xác được đánh giá ntn NQA nhỉ ?

    Comment by viettran — June 24, 2009 @ 8:43

    • Cảm ơn viettran, bạn có thể tham khảo Định lý 4.4 trang 60 sách “Numerical Initial Value Problems in Ordinary Differential Equations (Prentice-Hall Series in Automatic Computation)” của C.W. Gear. Kết quả không có gì khác so với trường hợp 1 phương trình quen biết.

      Comment by Ngô Quốc Anh — June 24, 2009 @ 23:04

  2. mình không có cuốn sách ấy. Nếu được NQA gửi cho cái link download thì thật tuyệt.

    Nhưng liệu tình hình có gì khác khi ta biết y(c) = y_0, c \in (a,b) (thay vì y(a) = y_0) ?

    Comment by viettran — June 25, 2009 @ 13:14

    • Sách trên có bản điện tử. Thế thì viettran cần xem lại thế nào là “initial value problem”.

      Comment by Ngô Quốc Anh — June 25, 2009 @ 13:21

  3. tức là viettran muốn mở vấn đề thoát ra khỏi cái khung “initial” đó NQA. Khi mô rảnh NQA post cái tốc độ hội tụ của PP trên cho viettran coi ké cái nha😀
    thanks !

    Comment by viettran — June 25, 2009 @ 17:37


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: