I wrote a Python code which solves a second degree nonlinear differential equation using the Newton iteration method. The code converges to a 2-cycle within 50 or so iterations.  The cycle only appears in noticable magnitude in the last half dozen grid points (of ~120).I use Central Differencing for solving a 2 boundary conditions second degree nonlinear equation. The number of gridpoints is 100 and there 3 parameters, $\alpha_i$:$u'' + \alpha_1 \cdot u' + {\alpha_2 \cdot u \cdot (u')^{2/3}} + {\alpha_3 \cdot (u')^{2/3}} = 0$The boundary conditions are:$u(x=0) = 0$$du/dx(x=N) = m$The $\alpha$ parameters and m are all calculated from experimental data, and the $\alpha$'s are functions of x.I use the boundary conditions on the Jacobian matrix at the first and the last line.I use also these conditions on the calculation of F vectorif the iteration is:$X = X - J^{-1} \cdot F$I noticed that the last value of F array change between + and - constant values.  I have already tuned the initial iterate to be near the expected final solution (from experimental data as well).  What options do I have to avoid a 2-cycle in the iterates of newton's method when it appears near to the solution I wish to find?Moreover, If the F last value (BC2) or one before the end is 0, then I have a convergence, with the expected u values at the last point or last two gridpoints respectively, but still there is a decrement after the #106 point going near to zero.
Newton Iteration method convergence
python;convergence;boundary conditions;newton method