title: How to solve this differential equation in Python?
body: <pre class="lang-none prettyprint-override"><code>y''' + yy&quot; + (1 - y'^2)= 0 y(0)=0, y'(0)=0, y'(+∞)=1
  </code></pre>
  <p><em>(The <code>+∞</code> can be replaced with 4).</em></p>
  <hr />
  <p>The above is a Falkner-Skan equation. I want to get the numerical solution from 0 to 4.</p>
  <p>Actually, I have read the book <em>Numerical Methods in Engineering with Python 3</em>, and used the methods in the book, but I cannot get the answer. Perhaps there are some errors in the book.</p>
  <p>Here is my code:</p>
  <pre><code>&quot;&quot;&quot;
  solve the differential equation
  y''' + yy&quot; + (1 - y'^2)= 0  y(0) = 0 y'(0) = 0,y'(+inf) = 0
  &quot;&quot;&quot;
  import numpy as np
  from scipy.integrate import odeint
  from printSoln import *
  start = time.clock()
  def F(x,y):   # First-order differential equations
      y = np.zeros(3)
      F0 = y[0]
      F1 = y[2]
      F2 = y[2]
      F3 = -y[0]*y[2] - (1 - y[1]*y[1])
      return [F1,F2,F3]
  
  def init(u):
      return np.array([0,0,u])
  X = np.linspace(0, 5, 50)
  u = 0
  for i in range(1):
      u += 1
      Y = odeint(F, init(u), X)
      print(Y)
      if abs(Y[len(Y)-1,1] - 1) &lt; 0.001:
          print(i,'times iterations')
          printSoln(X,Y,freq=2)
          print(&quot;y'(inf)) = &quot;, Y[len(Y)-1,1])
          print('y&quot;(0) =',u)
          break
  end = time.clock()
  
  print('duration =',end - start)
  </code></pre>