0

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$$

Rodrigo de Azevedo
  • 20,693
  • 5
  • 43
  • 100
Conan
  • 13
  • 4
  • Search for "higher order" and "Runge-Kutta" to find previous answers to this type of question, like https://math.stackexchange.com/q/2615672/115115, https://math.stackexchange.com/q/2401569/115115. – Lutz Lehmann Oct 16 '18 at 14:39
  • Like any other high order differential equation. Define auxiliary variables for the derivatives of $f$ and work on vectors of the function and its derivatives. – Ross Millikan Oct 16 '18 at 15:11
  • 1
    Possibly duplicate to [Solve Falkner-Skan Numerically?](https://math.stackexchange.com/q/158604/115115), see also https://en.wikipedia.org/wiki/Falkner%E2%80%93Skan_boundary_layer and for example the paper [Duque-Daza et al.: *Numerical Solution of the Falkner- Skan Equation*](http://www.scielo.br/pdf/jbsmse/v33n4/a01v33n4.pdf) – Lutz Lehmann Oct 16 '18 at 21:34
  • you are the best! thanks soo much! – Conan Oct 17 '18 at 20:33

1 Answers1

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.

Lutz Lehmann
  • 120,198
  • 7
  • 34
  • 103
  • Thanks, The steps of Runge-Kutta for this ecuation are? $$u_1= f (u_0,u_1,u_2) $$ $$u_2= g (u_0,u_1,u_2) $$ $$u'_2= p(u_0,u_1,u_2) $$ and start whit $$k_0= h f((u_0,u_1,u_2)$$ $$k_1= h f((u_0+ \frac{1}{2}h,u_1+\frac{1}{2}k_0,u_2+\frac{1}{2}k_0)$$ $$k_2= h f((u_0+ \frac{1}{2}h,u_1+\frac{1}{2}k_1,u_2+\frac{1}{2}k_1)$$ . . . and $$l_0= h g((u_0,u_1,u_2)$$ $$l_1= h g((u_0+ \frac{1}{2}h,u_1+\frac{1}{2}l_0,u_2+\frac{1}{2}l_0)$$ . . . and $$m_0= h p((u_0,u_1,u_2)$$ $$m_1= h p((u_0+ \frac{1}{2}h,u_1+\frac{1}{2}m_0,u_2+\frac{1}{2}m_0)$$ . . . – Conan Oct 16 '18 at 19:28
  • No, you need to mix the steps as for instance $k_1=hf(u_0+0.5k_0,\, u_1+0.5l_0,\, u_2+0.5m_0)$ etc. This means that for the computation of $k_1$ you need already have computed $l_0$ and $m_0$. – Lutz Lehmann Oct 16 '18 at 20:09
  • ok, I try, but initial conditions only give me zero. – Conan Oct 16 '18 at 20:42
  • Are you sure that it is $f(∞)=1$ and not $f'(∞)=1$? – Lutz Lehmann Oct 16 '18 at 21:13