Skip to article frontmatterSkip to article content

Nonlinearity and boundary conditions

Collocation for nonlinear differential equations operates on the same principle as for linear problems: replace functions by vectors and replace derivatives by differentiation matrices. But because the differential equation is nonlinear, the resulting algebraic equations are as well. We will therefore need to use a quasi-Newton or similar method as part of the solution process.

We consider the TPBVP (10.1.1), reproduced here:

u(x)=ϕ(x,u,u),axb,g1(u(a),u(a))=0,g2(u(b),u(b))=0.\begin{split} u''(x) &= \phi(x,u,u'), \qquad a \le x \le b,\\ g_1(u(a),u'(a)) &= 0,\\ g_2(u(b),u'(b)) &= 0. \end{split}

As in Collocation for linear problems, the function u(x)u(x) is replaced by a vector u\mathbf{u} of its approximated values at nodes x0,x1,,xnx_0,x_1,\ldots,x_n (see Equation (10.4.2)). We define derivatives of the sampled function as in (10.4.3) and (10.4.4), using suitable differentiation matrices Dx\mathbf{D}_x and Dxx\mathbf{D}_{xx}.

The collocation equations, ignoring boundary conditions for now, are

Dxxur(u)=0,\mathbf{D}_{xx} \mathbf{u} - \mathbf{r}(\mathbf{u}) = \boldsymbol{0},

where

ri(u)=ϕ(xi,ui,ui),i=0,,n.r_i(\mathbf{u}) = \phi(x_i,u_i,u_i'), \qquad i=0,\ldots,n.

and u=Dxu\mathbf{u}'=\mathbf{D}_x\mathbf{u}.

We impose the boundary conditions in much the same way as in Collocation for linear problems. Again define the rectangular boundary removal matrix E\mathbf{E} as in (10.4.8), and replace the equations in those two rows by the boundary conditions:

f(u)=[E(Dxxur(u))g1(u0,u0)g2(un,un)]=0.\mathbf{f}(\mathbf{u}) = \begin{bmatrix} \mathbf{E} \bigl( \mathbf{D}_{xx}\mathbf{u} - \mathbf{r}(\mathbf{u}) \bigr) \\[1mm] g_1(u_0,u_0') \\[1mm] g_2(u_n,u_n') \end{bmatrix} = \boldsymbol{0}.

The left-hand side of (10.5.4) is a nonlinear function of the unknowns in the vector u\mathbf{u}, so (10.5.4) is an (n+1)×1(n+1)\times 1 set of nonlinear equations, amenable to solution by the techniques of Chapter 4.

10.5.1Implementation

Our implementation using second-order finite differences is Function 10.5.1. It’s surprisingly short, considering how general it is, because we have laid a lot of groundwork already.

In order to solve a particular problem, we must write a function that computes ϕ for vector-valued inputs x\mathbf{x}, u\mathbf{u}, and u\mathbf{u}', and functions for the boundary conditions. We also have to supply init, which is an estimate of the solution used to initialize the quasi-Newton iteration. Since this argument is a vector of length n+1n+1, it sets the value of nn in the discretization.

The initial solution estimate can strongly influence how quickly a solution is found, or whether the quasi-Newton iteration converges at all. In situations where multiple solutions exist, the initialization can determine which is found.

10.5.2Parameter continuation

Sometimes the best way to get a useful initialization is to use the solution of a related easier problem, a technique known as parameter continuation. In this approach, one solves the problem at an easy parameter value, and gradually changes the parameter value to the desired value. After each change, the most recent solution is used to initialize the iteration at the new parameter value.

10.5.3Exercises

References
  1. Ascher, U. M., & Petzold, L. R. (1998). Computer Methods for Ordinary Differential Equations and Differential-Algebraic Equations. Society for Industrial and Applied Mathematics. 10.1137/1.9781611971392
  2. Carrier, G. F. (1970). Singular Perturbation Theory and Geophysics. SIAM Review, 12(2), 175–193. 10.1137/1012041