How can I solve the following differential equation with the 4th order Runge-Kutta method?
$$ f''' + f f'' + 1 - f'^2 = 0, \qquad f(0) = f'(0) = 0, \quad f'(\infty)=1$$
How can I solve the following differential equation with the 4th order Runge-Kutta method?
$$ f''' + f f'' + 1 - f'^2 = 0, \qquad f(0) = f'(0) = 0, \quad f'(\infty)=1$$
You have to transform the equation into a system of first order, as most numerical methods are designed for systems of first order. Usually this is done by taking the lower derivatives as state vector $(u_0(x),u_1(x),u_2(x))=(f(x), f'(x), f''(x))$. Then \begin{align} u_0'&=f'&&=u_1\\ u_1'&=f''&&=u_2\\ u_2'&=f'''=-ff''-1+f'^2&&=-u_0u_2-1+u_1^2 \end{align} Now apply the steps of the Runge-Kutta method to this as vector-valued function.
With the added boundary conditions with one boundary at infinity you get a different problem which is not an ordinary boundary value problem (BVP). You would need to find a suitable reformulation to get a BVP on a finite interval and then employ a BVP solver. There the Runge-Kutta method or similar is the trivial part of the solver.