Got a question about applying Improved Eulers method to systems of differential equations. if given the differential system:
$\frac{dy}{dt} = t + y^2$
$\frac{dx}{dt} = x + 2y$
The question asked to use 1 step of improved eulers method to estimate $x(1)$ and $y(1)$. What i am having trouble with is figuring out how to apply the equations of improved eulers method to x and y to figure this out, I know that for one equation:
$y_{n+1} = y_n + \frac{h}{2}(m_1 + m_2)$
with
$m_1 = f(t_n, y_n)$
$m_2 = f(t_{n+1}, y_n +hf(t_n,y_n))$
Im just strugging to appply these general equations in to two space.
Rewrite your ODE system in its vector form, i.e., $$ \frac{{\rm d}\mathbf{x}}{{\rm d}t}=\mathbf{f}(t,\mathbf{x}), $$ where $$ \mathbf{x}=\left( \begin{array}{c} x\\ y \end{array} \right)\quad\text{and}\quad\mathbf{f}(t,\mathbf{x})=\left( \begin{array}{c} x+2y\\ t+y^2 \end{array} \right). $$ The improved Euler method, or a second-order Runge-Kutta method, then reads \begin{align} \mathbf{x}_{n+1}&=\mathbf{x}_n+\frac{h}{2}\left(\mathbf{m}_1+\mathbf{m}_2\right),\\ \mathbf{m}_1&=\mathbf{f}(t_n,\mathbf{x}_n),\\ \mathbf{m}_2&=\mathbf{f}(t_{n+1},\mathbf{x}_n+h\mathbf{f}(t_n,\mathbf{x}_n)). \end{align}