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:

  1. $u(x=0) = 0$
  2. $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 vector if 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.

  • 1
    $\begingroup$ Could you please provide more information as to the equation you are solving and your discretization scheme? Issues such as stability and accuracy could greatly depend on the specifics of your problem. $\endgroup$ Apr 28 '13 at 3:14
  • 1
    $\begingroup$ Thank you for the additional information. Your description sounds like either an instability, or an error inhandling the right BC. Are you using a phantom point to evaluate the end derivative? Also, have you considered the shooting method? Usually for 1-D BVP's, it can do reasonably well. $\endgroup$ Apr 28 '13 at 19:08
  • $\begingroup$ I tried the shooting method, it does not work. What you mean "phantom point" ? The end of derivative is being calculated on the main script. Anything I change, even to put out the boundary condition on F, the "trend" remain the same. Only if I decrease the number of gridpoints (cut the 30%) converges, but the last value is too high. Does the initial guess need boundary condition ? I feel that the problem caused by the initial guess. Does need the same BC that the G has on the last gridpoint ? On the other hand, any change of the initial guess the problem at the end remain the same... $\endgroup$ May 3 '13 at 23:20
  • $\begingroup$ There are several ways to impose neumann BCs. One is to use a multiple point, biased scheme on the interior of the mesh, another is to use a phantom point, where you add a point outside your standard mesh, which then allows you to use a centered difference method for the BC. It is not required that your initial guess satisfy your BCs. Since Newton's method is not globally convergent, it's hard to rule out your initial guess if you don't have a guess of the final solution. Is there any possibility that you could post a plot of one of your solutions? $\endgroup$ May 3 '13 at 23:27
  • $\begingroup$ Please, why I need a fantom point, when I use the newton iteration method and I have two boundary boundary conditions ( for u, x=0, for u' x=Xmax) ? I know more or less the final solution. I have also measured data about it. (How I could post the graph ?) $\endgroup$ May 4 '13 at 1:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.