Finding a value using Runge-Kutta 4th order

321 Views Asked by At

I'm having trouble comprehending the following question.

Using Runge-Kutta 4th order method and a step size of 0.1, find the value of y=0.4

$$y\frac{dy}{dx}-y^{2}+x=0, y(0)=2$$

I am stuck in understanding what is supposed to mean by $y = 0.4$. Suppose that I make it $x(2)=0$ so that I am now looking for the value of $x(0.4)=0$. It still doesn't make sense for me since $y$ is initially $2$, unless a negative step size is valid.

What is your understanding of the problem? Should a negative step size be considered? Does the question actually mean $x = 0.4$?

1

There are 1 best solutions below

2
On

In the equation you presented, we are looking for a function $y(x)$ satisfying the differential equation and the initial condition $y(0)=2$. I believe there is a typo in the question and you are just being asked to provide an estimate of $y(0.4)$, using RK4. If you were meant yo find a value $x = x^*$ such that $y(x^*)=0.4$, the question would have surely been written in a different way.

Regarding the application of the Runge-Kutta method, you just need to look up the formula use it instead of the "$\cdots$" below \begin{align*} y(0) &= 2\\ y(0.1) &\approx y_1 = \cdots\\ y(0.2) &\approx y_2 = \cdots\\ y(0.3) &\approx y_4 = \cdots\\ y(0.4) &\approx y_4 = \cdots\\ \end{align*}