The eight equations derived above, together with the three
equations
(
), are the
necessary and sufficient conditions for the RK4 method to have
a 5th order error term
. As there are more parameters
than constraining equations, there exist multiple sets of such
parameters, which can be found by solving the eight simultaneous
nonlinear equations. To do so, we can treat
,
,
and
as parameters and solve the equation system for the
rest of the parameters as the variables (
,
,
,
,
,
,
,
, and
).
Specifically, we first solve equations 2, 3, and 4
for the three variables
and get
![$\displaystyle b_2=\frac{6c_3c_4-4(c_3+c_4)+3}{12c_2(c_3-c_2)(c_4-c_2)},\;\;\;
b...
...-c_3)(c_4-c_3)},\;\;\;
b_4=\frac{6c_2c_3-4(c_2+c_3)+3}{12c_4(c_2-c_4)(c_3-c_4)}$](img884.svg) |
(291) |
We then solve the next three equations 5, 6, and 7 for the three
variables defined as
,
, and
:
and get
![$\displaystyle u=b_3a_{32}=\frac{3-4c_4}{24c_2(c_3-c_4)},\;\;\;
v=b_4a_{42}=\fra...
...2c_4}{24c_2(c_2-c_3)(c_3-c_4)},\;\;\;
w=b_4a_{43}=\frac{2c_2-1}{12c_3(c_2-c_3)}$](img889.svg) |
(292) |
Now the last equation becomes
![$\displaystyle b_4a_{43}a_{32}c_2=wa_{32}c_2=\frac{1}{24}$](img890.svg) |
(293) |
solving which for
we get
![$\displaystyle a_{32}=\frac{1}{24c_2w}=\frac{c_3(c_2-c_3)}{2c_2(2c_2-1)}$](img891.svg) |
(294) |
and
![$\displaystyle a_{31}=c_3-a_{32}$](img892.svg) |
(295) |
Also, as
, we have:
![$\displaystyle b_3=\frac{u}{a_{32}}=\frac{3-4c_4}{24c_2(c_3-c_4)}\;\frac{2c_2(2c_2-1)}{c_3(c_2-c_3)}
=\frac{(4c_4-3)(2c_2-1)}{12c_3(c_2-c_3)(c_4-c_3)}$](img893.svg) |
(296) |
Equating this to the expression for
obtained above, we get
![$\displaystyle (4c_4-3)(2c_2-1)=6c_2c_4-4(c_2+c_4)+3,\;\;\;\;i.e.\;\;\;\;\;\;\;2c_2(c_4-1)=0$](img894.svg) |
(297) |
As
(due to Equation 8), we must have
.
We can now rewrite
,
, and
as
![$\displaystyle b_2=\frac{2c_3-1}{12c_2(c_3-c_2)(1-c_2)},\;\;\;
b_3=\frac{2c_2-1}{12c_3(c_2-c_3)(1-c_3)},\;\;\;
b_4=\frac{6c_2c_3-4(c_2+c_3)+3}{12(1-c_2)(1-c_3)}$](img897.svg) |
(298) |
and rewrite
,
, and
as:
![$\displaystyle u=b_3a_{32}=\frac{1}{24c_2(1-c_3)},\;\;\;
v=b_4a_{42}=\frac{4c_3^...
...-c_2+2}{24c_2(c_2-c_3)(1-c_3)},\;\;\;
w=b_4a_{43}=\frac{2c_2-1}{12c_3(c_2-c_3)}$](img901.svg) |
(299) |
Now we get
![$\displaystyle a_{42}=\frac{v}{b_4}=\frac{4c_3^2-5c_3-c_2+2}{24c_2(c_2-c_3)(1-c_...
...c_3)+3}
=\frac{(4c_3^2-5c_3-c_2+2)(1-c_2)}{2c_2(c_2-c_3)(6c_2c_3-4(c_2+c_3)+3)}$](img902.svg) |
(300) |
![$\displaystyle a_{43}=\frac{w}{b_4}=\frac{2c_2-1}{12c_3(c_2-c_3)}\times\frac{12(...
...(c_2+c_3)+3}
=\frac{(2c_2-1)(1-c_2)(1-c_3)}{c_3(c_2-c_3)(6c_2c_3-4(c_2+c_3)+3)}$](img903.svg) |
(301) |
and
![$\displaystyle a_{41}=c_4-a_{42}-a_{43}=1-a_{42}-a_{43}$](img904.svg) |
(302) |
In summary, we can freely choose
and
(with
),
and then obtain all other parameters by expressions derived above.
Example 2 Let
and
, and we have
![$\displaystyle a_{32}=\frac{c_3(c_2-c_3)}{2c_2(2c_2-1)}=1,
\;\;\;\;\;a_{31}=c_3-a_{32}=-\frac{1}{3}$](img908.svg) |
(303) |
![$\displaystyle a_{42}=\frac{(4c_3^2-5c_3-c_2+2)(1-c_2)}{2c_2(c_2-c_3)(6c_2c_3-4(...
...(1-c_3)}{c_3(c_2-c_3)(6c_2c_3-4(c_2+c_3)+3)}
=1,\;\;\;
a_{41}=1-a_{42}-a_{43}=1$](img909.svg) |
(304) |
and
![$\displaystyle b_2=\frac{2c_3-1}{12c_2(c_3-c_2)(1-c_2)}=\frac{3}{8},\;\;\;
b_3=\...
...frac{3}{8},\;\;\;
b_4=\frac{6c_2c_3-4(c_2+c_3)+3}{12(1-c_2)(1-c_3)}=\frac{1}{8}$](img910.svg) |
(305) |
with
. This is the 3/8-rule RK4.
Example Let
and
, then we have
![$\displaystyle a_{32}=\frac{c_3(c_2-c_3)}{2c_2(2c_2-1)}=\frac{1}{4},
\;\;\;\;\;a_{31}=c_3-a_{32}=-\frac{1}{12}$](img914.svg) |
(306) |
![$\displaystyle a_{42}=\frac{(4c_3^2-5c_3-c_2+2)(1-c_2)}{2c_2(c_2-c_3)(6c_2c_3-4(...
...3(c_2-c_3)(6c_2c_3-4(c_2+c_3)+3)}
=2,\;\;\;
a_{41}=1-a_{42}-a_{43}=-\frac{5}{4}$](img915.svg) |
(307) |
and
![$\displaystyle b_2=\frac{2c_3-1}{12c_2(c_3-c_2)(1-c_2)}=\frac{3}{8},\;\;\;
b_3=\...
...frac{3}{8},\;\;\;
b_4=\frac{6c_2c_3-4(c_2+c_3)+3}{12(1-c_2)(1-c_3)}=\frac{1}{8}$](img910.svg) |
(308) |
with
. This is a different version of the
3/8-rule of RK4:
![\begin{displaymath}\begin{array}{l\vert llll}
c_1=0 &&&& \\
c_2=2/3 & a_{21}=2/...
... \hline
& b_1=1/8 & b_2=3/8 & b_3=3/8 & b_4=1/8 \\
\end{array}\end{displaymath}](img916.svg) |
(309) |
We also need to consider the special case in which
, and the
results derived above are no longer valid due to the factor
in the denominators of the expressions of many of the parameters derived
above. We need to redevelop the expressions of these parameters. To do so,
we let
, and recall
, and rewrite equations 2, 3, and
4 as
![$\displaystyle \left\{\begin{array}{l}
cb_2+cb_3+b_4=1/2\\
c^2b_2+c^2b_3+b_4=1/3\\
c^3b_2+c^3b_3+b_4=1/4
\end{array}\right.$](img920.svg) |
(310) |
Subtracting the second equation from the first, and then the third one
from the second, we get these two equations:
![$\displaystyle c(1-c)(b_2+b_3)=1/6,\;\;\;\;c^2(1-c)(b_2+b_3)=1/12$](img921.svg) |
(311) |
from which we get
, i.e.,
is the only value
allowed if they are the same. We now get
![$\displaystyle b_2+b_3=\frac{2}{3},\;\;\;\;\;\;b_4=\frac{1}{6}$](img924.svg) |
(312) |
Next, equations 5, 6, and 7 can be written as:
i.e.![$\displaystyle \;\;\;\;\;
\left\{\begin{array}{l}
u+v+w=1/3\\
u+2v+2w=1/2\\
\end{array}\right.$](img926.svg) |
(313) |
Solving these equations we get
![$\displaystyle u=b_3a_{32}=\frac{1}{6},\;\;\;v+w=b_4a_{42}+b_4a_{43}
=(a_{42}+a_{43})b_4=\frac{1}{6}$](img927.svg) |
(314) |
i.e.,
![$\displaystyle a_{32}=\frac{1}{6b_3},\;\;\;\;\;a_{42}+a_{43}=\frac{1}{6b_4}=1;$](img928.svg) |
(315) |
We therefore get
. As we also have
i.e.,![$\displaystyle \;\;\;\;\;\;a_{43}=3b_3$](img931.svg) |
(316) |
We can now arbitrarily choose any
, and then find
,
,
,
,
,
,
, and
.
Example Let
, then
,
,
,
,
, which are the parameters
of the classical RK4 discussed before. However, if we let
or
, then we get
either of the following two RK4 methods:
![\begin{displaymath}\begin{array}{l\vert llll}
c_1=0 &&&& \\
c_2=1/2 & a_{21}=1/...
... \hline
& b_1=1/6 & b_2=1/2 & b_3=1/6 & b_4=1/6 \\
\end{array}\end{displaymath}](img946.svg) |
(317) |