I am trying to solve this exercise and have a few questions.
It is given the initial value problem $y^{\prime \prime \prime} (t) + y^{\prime}(t) = e^{-t}y(t)$ with initial values $ y(0) = y_0 \in \mathbb{R}, y^{\prime}(0) = v_0 \in \mathbb{R} \, \text{and} \, y^{\prime \prime}(0) = w0 \in \mathbb{R}. $
Furthermore, the following Runge-Kutta method as a butcher tableau is given:
$$\begin{array} {c|cccc} 0\\ \frac{1}{2} & \frac{1}{4} &\frac{1}{4}\\ 1& 0& 1& 0\\ \hline & \frac{1}{6} &\frac{2}{3} &\frac{1}{6} \end{array} $$
For the numerical solution of the initial value problem, the step width $h>0$ with $n = 0, 1, 2,\dots ,N = \frac{T}{h}$ should be specified. The time steps $t_n$ are derived from the decomposition of the interval $[0, T]$. Here $y_n$ approximates the solution of the initial value problem at time $t_n$.
(i) Rewrite the Butcher tableau in step form and outline the derivation of the Runge Kutta method using known square formulas
(ii) Convert the initial value problem to a system of ordinary first-order differential equations:
$$ z^{\prime} = A z \, \text{with} \, z := \bigg( \begin{array}{c} y \\ v \\w \end{array} \bigg) = \bigg( \begin{array}{c} y \\ y^{\prime} \\y^{\prime \prime} \end{array} \bigg) \in \mathbb{R^3} $$
The matrix $A:= A (t) \in \mathbb{R}^{3 \times 3}$ depends on the time $t$.
Also write a pseudo-code, which generates the matrix $A (t)$ for the time $t$. The routine should only be receive the parameter $t$ and return the final result $A$.
(iii) Apply the step form of the Runga Kutta method to the differential equation.
My solution/idea to the tasks: i) At first I rewrite the Butcher tableau in step form and I get
$k_1=f(t,y(t)) \\ k_2=f(t+\frac{h}{2}, y+\frac{h}{4} (k_1 + k_2)) \\ k_3=f(t+h, y+hk_2) \\ y_{j+1} = y_{j} + \frac{1}{6}(k_1+4k_2+k_3)$
Now i try to compute this Runge Kutta Method using the Quadrature Formula
$l_i(\alpha) = \prod_{j=1}^{s} \frac{\alpha - \alpha_j}{\alpha_i - \alpha_j} \, \text{with} \, i \neq j \\ \beta_{ij} = \int_{0}^{\alpha_i} l_j(\alpha) d\alpha \, \text{and} \, \gamma_j = \int_{0}^{1} l_j(\alpha) d\alpha$
I calculated the values but i get not the same values for $\beta_{ij}$.
$l_1(\alpha) = \frac{\alpha - 0.5}{0-0.5} \frac{\alpha - 1}{0-1} = (1-2\alpha)(1-\alpha) = (1-3\alpha 2 \alpha^2) \\ l_2(\alpha) = ... = 4\alpha - 4\alpha^2 \\ l_3(\alpha)=...= 2\alpha^2 -\alpha$ Then
$\gamma_1 = \int_{0}^{1} l_1(\alpha) d\alpha = \alpha - 1.5 \alpha^2 + 2/3 \alpha^3 \bigg \vert_{0}^{1} = 1/6 \\ \gamma_2 =...= 2 - 4/3 = 2/3 \\ \gamma_3 =...=4/6 - 3/6 = 1/6$
$\beta_{1j} = \int_{0}^{0} l_j(\alpha) d\alpha = 0 \\ \beta_{21} = \int_{0}{0.5} l_1(\alpha) d\alpha = \alpha - 3/2 \alpha^2 + 2/3 \alpha^3 \bigg \vert_{0}^{0.5}=..= 5/24$
This is not equal to the value in the Butcher Tableau.
ii) Converting to a system of ordinary first order differntial equations yields to:
Define $y_1 := y, y_2 := y^{\prime}, y_3 := y^{\prime \prime} $ with $ y_1(0) = y_0, y_2(0) =v_0, y_3(0)=w_0 $. Then we get:
$ y_{3}^{\prime} = e^{-t}y_1(t) - y_2(t) $ and $y_{1}^{\prime} = y_2, y_{2}^{\prime} =y_3$
$ \bigg( \begin{array}{c} y_{1}^{\prime} \\ y_{2}^{\prime} \\ y_{3}^{\prime} \end{array} \bigg ) = \bigg ( \begin{array}{A} 0 &1 &0 \\ 0 &0 &1 \\ e^{-t} &-1 &0 \end{array} \bigg ) \bigg( \begin{array}{c} y_{1} \\ y_{2} \\ y_{3} \end{array} \bigg )$
I have problems writing Pseudo Code, can someone help me?
iii) At the task I have absolutely no idea what to do. Can someone help me with that?