Processing math: 100%

Systems of nonlinear algebraic equations

Implicit time discretization methods for a system of ODEs, or a PDE, lead to systems of nonlinear algebraic equations, written compactly as

F(u)=0,

where u is a vector of unknowns u=(u0,,uN), and F is a vector function: F=(F0,,FN). Sometimes the equation system has a special structure because of the underlying problem, e.g.,

A(u)u=b(u),

with A(u) as an (N+1)×(N+1) matrix function of u and b as a vector function: b=(b0,,bN).

We shall next explain how Picard iteration and Newton’s method can be applied to systems like F(u)=0 and A(u)u=b(u). The exposition has a focus on ideas and practical computations. More theoretical considerations, including quite general results on convergence properties of these methods, can be found in Kelley [Ref1].

Picard iteration (2)

We cannot apply Picard iteration to nonlinear equations unless there is some special structure. For the commonly arising case A(u)u=b(u) we can linearize the product A(u)u to A(u)u and b(u) as b(u). That is, we use the most previously computed approximation in A and b to arrive at a linear system for u:

A(u)u=b(u).

A relaxed iteration takes the form

A(u)u=b(u),u=ωu+(1ω)u.

In other words, we solve a system of nonlinear algebraic equations as a sequence of linear systems.

Algorithm for relaxed Picard iteration

Given A(u)u=b(u) and an initial guess u, iterate until convergence:

  1. solve A(u)u=b(u) with respect to u
  2. u=ωu+(1ω)u
  3. u  u

Newton’s method (2)

The natural starting point for Newton’s method is the general nonlinear vector equation F(u)=0. As for a scalar equation, the idea is to approximate F around a known value u by a linear function ˆF, calculated from the first two terms of a Taylor expansion of F. In the multi-variate case these two terms become

F(u)+J(u)(uu),

where J is the Jacobian of F, defined by

Ji,j=Fiuj.

So, the original nonlinear system is approximated by

ˆF(u)=F(u)+J(u)(uu)=0,

which is linear in u and can be solved in a two-step procedure: first solve Jδu=F(u) with respect to the vector δu and then update u=u+δu. A relaxation parameter can easily be incorporated:

u=ω(u+δu)+(1ω)u=ω+ωδu.

Algorithm for Newton’s method

Given F(u)=0 and an initial guess u, iterate until convergence:

  1. solve Jδu=F(u) with respect to δu
  2. u=u+ω)δu
  3. u  u

For the special system with structure A(u)u=b(u),

Fi=kAi,k(u)ukbi(u),

and

Ji,j=kAi,kujuk+Ai,jbiuj.

We realize that the Jacobian needed in Newton’s method consists of A(u) as in the Picard iteration plus two additional terms arising from the differentiation. Using the notation A(u) for A/u (a quantity with three indices: Ai,k/uj), and b(u) for b/u (a quantity with two indices: bi/uj), we can write the linear system to be solved as

(A+Au+b)δu=Au+b,

or

(A(u)+A(u)u+b(ui))δu=A(u)u+b(u).

Rearranging the terms demonstrates the difference from the system solved in each Picard iteration:

A(u)(u+δu)b(u)Picard system+γ(A(u)u+b(ui))δu=0.

Here we have inserted a parameter γ such that γ=0 gives the Picard system and γ=1 gives the Newton system. Such a parameter can be handy in software to easily switch between the methods.

Stopping criteria (2)

Let |||| be the standard Eucledian vector norm. Four termination criteria are much in use:

  • Absolute change in solution: ||uu||ϵu
  • Relative change in solution: ||uu||ϵu||u0||, where u0 denotes the start value of u in the iteration
  • Absolute residual: ||F(u)||ϵr
  • Relative residual: ||F(u)||ϵr||F(u0)||

To prevent divergent iterations to run forever, one terminates the iterations when the current number of iterations k exceeds a maximum value kmax.

The relative criteria are most used since they are not sensitive to the characteristic size of u. Nevertheless, the relative criteria can be misleading when the initial start value for the iteration is very close to the solution, since an unnecessary reduction in the error measure is enforced. In such cases the absolute criteria work better. It is common to combine the absolute and relative measures of the size of the residual, as in

||F(u)||ϵrr||F(u0)||+ϵra,

where ϵrr is the tolerance in the relative criterion and ϵra is the tolerance in the absolute criterion. With a very good initial guess for the iteration (typically the solution of a differential equation at the previous time level), the term ||F(u0)|| is small and ϵra is the dominating tolerance. Otherwise, ϵrr||F(u0)|| and the relative criterion dominates.

With the change in solution as criterion we can formulate and combined absolute and relative measure of the change in the solution:

||δu||ϵur||u0||+ϵua,

The ultimate termination criterion, combining the residual and the change in solution tests with a test on the maximum number of iterations allow, can be expressed as

||F(u)||ϵrr||F(u0)||+ϵra or ||δu||ϵur||u0||+ϵua or k>kmax.

Example: A nonlinear ODE model from epidemiology

The simplest model spreading of a disease, such as a flu, takes the form of a 2×2 ODE system

S=βSI,
I=βSIνI,

where S(t) is the number of people who can get ill (susceptibles) and I(t) is the number of people who are ill (infected). The constants β>0 and ν>0 must be given along with initial conditions S(0) and I(0).

Implicit time discretization

A Crank-Nicolson scheme leads to a 2×2 system of nonlinear algebraic equations in the unknowns Sn+1 and In+1:

Sn+1SnΔt=β[SI]n+12β2(SnIn+Sn+1In+1),
In+1InΔt=β[SI]n+12νIn+12β2(SnIn+Sn+1In+1)ν2(In+In+1).

Introducing S for Sn+1, S1 for Sn, I for In+1, I1 for In, we can rewrite the system as

(1)FS(S,I)=SS1+12Δtβ(S1I1+SI)=0,
(2)FI(S,I)=II112Δtβ(S1I1+SI)12Δtν(I1+I)=0.

A Picard iteration

We assume that we have approximations S and I to S and I. A way of linearizing the only nonlinear term SI is to write IS in the FS=0 equation and SI in the FI=0 equation, which also decouples the equations. Solving the resulting linear equations with respect to the unknowns S and I gives

S=S112ΔtβS1I11+12ΔtβI,I=I1+12ΔtβS1I1112ΔtβS+ν.

The solutions S and I are stored in S and I and a new iteration is carried out.

Newton’s method (3)

The nonlinear system (1)-(2) can be written as F(u)=0 with F=(FS,FI) and u=(S,I). The Jacobian becomes

2J=(SFSIFSSFIIFI)=(1+12ΔtβI12Δtβ12ΔtβS112ΔtβI12Δtν).TheNewtonsystemtobesolvedineachiterationisthen!bt1.5(1+12ΔtβI12ΔtβS12ΔtβS112ΔtβI12Δtν)(δSδI)=(SS1+12Δtβ(S1I1+SI)II112Δtβ(S1I1+SI)12Δtν(I1+I))

Remark. For this particular system explicit time integration methods work very well. The 4-th order Runge-Kutta method is an excellent balance between high accuracy, high efficiency, and simplicity.