Having a bit of difficulty with this question:
Convert the initial value problem,
$$\frac{d^2y}{dx^2}-\frac{dy}{dx}+2y=x+1$$ where $$y(0)=2,\ \frac{dy}{dx}(0)=-1,$$
into a set of two coupled first-order initial value problems.
Firstly I let $$\frac{dy}{dx}=z$$ giving me the equation:
$$\frac{dz}{dx}=z-2y+x+1$$ where $$y(0)=2,\ z(0)=-1,\ x(0)=0$$
Use a step length h = 0.1 to find numerical approximations to y at x = 0.2 using generalizations to two coupled equations of the following numerical schemes:
- Trapezoidal method using the explicit Euler method as a predictor and one iteration of the corrector.
for this method I'm really confused and don't know where to start so any help would be great.
- the third-order Runge-Kutta scheme: $$k_1 = hf (x_n, y_n)\\ k_2=hf(x_n+\frac{h}{2},y_n+\frac{k_1}{2})\\ k_3=hf(x_n+h,y_n-k_1+2k_2)\\ y_{n+1}=y_n+\frac{1}{6}(k_1+4k_2+k_3) $$
for this method I'm a little confused I don't know where to start because of the 3 different variables z,y,x I tried starting by doing $$k_1=hz_0$$ and then $$l_1=hf(x_0,y_0)$$ but I found it difficult because of the 3 variables, any help is appreciated thanks.