-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path8_nonlinear_problems.html
More file actions
389 lines (375 loc) · 29 KB
/
Copy path8_nonlinear_problems.html
File metadata and controls
389 lines (375 loc) · 29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>8. Nonlinear problems — Finite element course 2026.0 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="_static/fenics.css?v=7793b76c" />
<link rel="stylesheet" type="text/css" href="_static/proof.css" />
<link rel="stylesheet" type="text/css" href="_static/sphinx-design.min.css?v=95c83b7e" />
<script src="_static/documentation_options.js?v=9c5a5fc5"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/proof.js"></script>
<script src="_static/design-tabs.js?v=36754332"></script>
<script async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="9. Mixed problems" href="9_mixed_problems.html" />
<link rel="prev" title="7. Dirichlet boundary conditions" href="7_boundary_conditions.html" />
<!--[if lte IE 6]>
<link rel="stylesheet" href="_static/ie6.css" type="text/css" media="screen" charset="utf-8" />
<![endif]-->
<link rel="stylesheet" href="_static/featured.css">
<link rel="shortcut icon" href="_static/icon.ico" />
</head><body>
<div class="wrapper">
<a href="index.html"><img src="_static/banner.svg" width="900px" alt="FInAT Project Banner" /></a>
<div id="access">
<div class="menu">
<ul>
<li class="page_item"><a href="https://github.com/finite-element/finite-element-course" title="GitHub">GitHub</a></li>
</ul>
</div><!-- .menu -->
</div><!-- #access -->
</div><!-- #wrapper -->
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="nonlinear-problems">
<h1><span class="section-number">8. </span>Nonlinear problems<a class="headerlink" href="#nonlinear-problems" title="Link to this heading">¶</a></h1>
<p>The finite element method may also be employed to numerically solve
<em>nonlinear</em> PDEs. In order to do this, we can apply the classical
technique for solving nonlinear systems: we employ an iterative scheme
such as Newton’s method to create a sequence of linear problems whose
solutions converge to the correct solution to the
nonlinear problem.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This chapter formed the content of the mastery material in some years, but
does not currently do so. It is presented for reference only.</p>
</div>
<section id="a-model-problem">
<h2><span class="section-number">8.1. </span>A model problem<a class="headerlink" href="#a-model-problem" title="Link to this heading">¶</a></h2>
<p>As a simple case of a non-linear PDE, we can consider a steady
non-linear diffusion equation. This is similar to the Poisson problem,
except that the diffusion rate now depends on the value of the
solution:</p>
<div class="math notranslate nohighlight" id="equation-diffusion">
<span class="eqno">(8.1)<a class="headerlink" href="#equation-diffusion" title="Link to this equation">¶</a></span>\[ \begin{align}\begin{aligned}-\nabla\cdot\left((u+1)\nabla u\right) = g\\u = b \textrm{ on } \Gamma\end{aligned}\end{align} \]</div>
<p>where <span class="math notranslate nohighlight">\(g\)</span> and <span class="math notranslate nohighlight">\(b\)</span> are given functions defined over <span class="math notranslate nohighlight">\(\Omega\)</span> and
<span class="math notranslate nohighlight">\(\Gamma\)</span> respectively.</p>
<p>We can create the weak form of <a class="reference internal" href="#equation-diffusion">(8.1)</a> by integrating by parts
and taking the boundary conditions into account. The problem becomes,
find <span class="math notranslate nohighlight">\(u\in V\)</span> such that:</p>
<div class="math notranslate nohighlight" id="equation-weakdiffusion">
<span class="eqno">(8.2)<a class="headerlink" href="#equation-weakdiffusion" title="Link to this equation">¶</a></span>\[ \begin{align}\begin{aligned}\int_\Omega \nabla v_0 \cdot (u + 1) \nabla u \, \mathrm{d} x = \int_\Omega v_0g \, \mathrm{d} x \qquad \forall v_0 \in V_0\\u_\Gamma = b.\end{aligned}\end{align} \]</div>
<p>Once more, <span class="math notranslate nohighlight">\(V_0\)</span> is the subspace of <span class="math notranslate nohighlight">\(V\)</span> spanned by basis functions which
vanish on the boundary, <span class="math notranslate nohighlight">\(V = V_0 \oplus V_\Gamma\)</span>, and <span class="math notranslate nohighlight">\(u = u_0 + u_\Gamma\)</span>
with <span class="math notranslate nohighlight">\(u_0\in V_0\)</span> and <span class="math notranslate nohighlight">\(u_\Gamma\in V_\Gamma\)</span>. This is
corresponds directly with the weak form of the Poisson equation we
already met. However, <a class="reference internal" href="#equation-weakdiffusion">(8.2)</a> is still nonlinear in <span class="math notranslate nohighlight">\(u\)</span> so
we cannot simply substitute <span class="math notranslate nohighlight">\(u = u_i\phi_i\)</span> in order to obtain a
linear matrix system to solve.</p>
</section>
<section id="residual-form">
<h2><span class="section-number">8.2. </span>Residual form<a class="headerlink" href="#residual-form" title="Link to this heading">¶</a></h2>
<p>The general weak form of a non-linear problem is, find <span class="math notranslate nohighlight">\(u\in V\)</span> such that:</p>
<div class="math notranslate nohighlight" id="equation-8-nonlinear-problems-0">
<span class="eqno">(8.3)<a class="headerlink" href="#equation-8-nonlinear-problems-0" title="Link to this equation">¶</a></span>\[f(u; v) = 0 \qquad \forall v \in V\]</div>
<p>The use of a semicolon is a common convention to indicate that <span class="math notranslate nohighlight">\(f\)</span> is
assumed to be linear in the arguments after the semicolon, but might
be nonlinear in the arguments before the semicolon. In this case,
we observe that <span class="math notranslate nohighlight">\(f\)</span> may be nonlinear in <span class="math notranslate nohighlight">\(u\)</span> but is (by
construction) linear in <span class="math notranslate nohighlight">\(v\)</span>.</p>
<p>The function <span class="math notranslate nohighlight">\(f\)</span> is called the <em>residual</em> of the nonlinear system. In
essence, <span class="math notranslate nohighlight">\(f(u; v) = 0 \ \forall v\in V\)</span> if and only if <span class="math notranslate nohighlight">\(u\)</span> is a weak
solution to the PDE. Since the residual is linear in <span class="math notranslate nohighlight">\(v\)</span>, it suffices
to define the residual for each <span class="math notranslate nohighlight">\(\phi_i\)</span> in the basis of <span class="math notranslate nohighlight">\(V\)</span>. For
<span class="math notranslate nohighlight">\(\phi_i\in V_0\)</span>, the residual is just the weak form of the equation,
but what do we do for the boundary? The simple answer is that we need
a linear functional which is zero if the boundary condition is
satisfied at this test function, and nonzero otherwise. The simplest
example of such a functional is:</p>
<div class="math notranslate nohighlight" id="equation-8-nonlinear-problems-1">
<span class="eqno">(8.4)<a class="headerlink" href="#equation-8-nonlinear-problems-1" title="Link to this equation">¶</a></span>\[f(u; \phi_i) = \phi^*_i(u) - \phi^*_i(b)\]</div>
<p>where <span class="math notranslate nohighlight">\(\phi^*_i\)</span> is the node associated with basis function <span class="math notranslate nohighlight">\(\phi_i\)</span>. For
point evaluation nodes, <span class="math notranslate nohighlight">\(\phi^*_i(u)\)</span> is the value of the proposed solution
at node point <span class="math notranslate nohighlight">\(i\)</span> and <span class="math notranslate nohighlight">\(\phi^*_i(b)\)</span> is just the boundary condition
evaluated at that same point.</p>
<p>So for our model problem, we now have a full statement of the residual in terms of a basis function <span class="math notranslate nohighlight">\(\phi_i\)</span>:</p>
<div class="math notranslate nohighlight" id="equation-residual">
<span class="eqno">(8.5)<a class="headerlink" href="#equation-residual" title="Link to this equation">¶</a></span>\[\begin{split}f(u; \phi_i) = \begin{cases}
\displaystyle\int_\Omega \nabla \phi_i \cdot \left((u + 1) \nabla u\right) - \phi_i g \, \mathrm{d} x & \phi_i\in V_0\\
\phi^*_i(u) - \phi^*_i(b) & \phi_i\in V_\Gamma
\end{cases}\end{split}\]</div>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>Evaluating the residual requires that the boundary condition be
evaluated at the boundary nodes. A simple (if slightly inefficient)
way to achieve this is to interpolate the boundary condition onto a
function <span class="math notranslate nohighlight">\(\hat{b}\in V\)</span>.</p>
</div>
</section>
<section id="linearisation-and-gateaux-derivatives">
<h2><span class="section-number">8.3. </span>Linearisation and Gâteaux Derivatives<a class="headerlink" href="#linearisation-and-gateaux-derivatives" title="Link to this heading">¶</a></h2>
<p>Having stated our PDE in residual form, we now need to linearise the
problem and thereby employ a technique such as Newton’s method. In
order to linearise the residual, we need to differentiate it with
respect to <span class="math notranslate nohighlight">\(u\)</span>. Since <span class="math notranslate nohighlight">\(u\)</span> is not a scalar real variable, but is
instead a function in <span class="math notranslate nohighlight">\(V\)</span>, the appropriate form of differentiation is
the Gâteaux Derivative, given by:</p>
<div class="math notranslate nohighlight" id="equation-8-nonlinear-problems-2">
<span class="eqno">(8.6)<a class="headerlink" href="#equation-8-nonlinear-problems-2" title="Link to this equation">¶</a></span>\[J(u; v, \hat{u}) = \lim_{\epsilon\rightarrow 0}\frac{f(u+\epsilon\hat{u}; v)-f(u; v)}{\epsilon}.\]</div>
<p>Here, the new argument <span class="math notranslate nohighlight">\(\hat{u}\in V\)</span> indicates the “direction” in
which the derivative is to be taken. Let’s work through the Gâteaux
Derivative for the residual of our model problem. Assume first that
<span class="math notranslate nohighlight">\(v\in V_0\)</span>. Then:</p>
<div class="math notranslate nohighlight" id="equation-8-nonlinear-problems-3">
<span class="eqno">(8.7)<a class="headerlink" href="#equation-8-nonlinear-problems-3" title="Link to this equation">¶</a></span>\[\begin{split}\begin{split}
J(u; v, \hat{u}) &= \lim_{\epsilon\rightarrow 0}\frac{\displaystyle\int_\Omega \nabla v \cdot \left((u +\epsilon\hat{u} + 1) \nabla (u + \epsilon\hat{u})\right) - vg \, \mathrm{d} x - \displaystyle\int_\Omega \nabla v \cdot \left((u + 1) \nabla u\right) - vg \, \mathrm{d} x}{\epsilon}\\
&= \lim_{\epsilon\rightarrow 0}\frac{\displaystyle\int_\Omega \nabla v \cdot \left(\epsilon\hat{u} \nabla u + (u + 1) \nabla (\epsilon\hat{u}) + \epsilon\hat{u} \nabla (\epsilon\hat{u})\right) \, \mathrm{d} x}{\epsilon}\\
&= \int_\Omega \nabla v \cdot \left(\hat{u} \nabla u + (u + 1) \nabla \hat{u} \right) \, \mathrm{d} x.\\
\end{split}\end{split}\]</div>
<p>Note that, as expected, <span class="math notranslate nohighlight">\(J\)</span> is linear in <span class="math notranslate nohighlight">\(\hat{u}\)</span>.</p>
<p>Next, we can work out the boundary case by assuming <span class="math notranslate nohighlight">\(v=\phi_i\)</span>, one of the basis functions of <span class="math notranslate nohighlight">\(V_\Gamma\)</span>:</p>
<div class="math notranslate nohighlight" id="equation-8-nonlinear-problems-4">
<span class="eqno">(8.8)<a class="headerlink" href="#equation-8-nonlinear-problems-4" title="Link to this equation">¶</a></span>\[\begin{split}\begin{split}
J(u; \phi_i, \hat{u}) &= \lim_{\epsilon\rightarrow 0}\frac{\phi^*_i(u+\epsilon\hat{u}) - \phi^*_i(b) - \left(\phi^*_i(u) - \phi^*_i(b)\right)}{\epsilon}\\
&= \phi^*_i(\hat{u}) \qquad \textrm{since } \phi^*_i(\cdot) \textrm{ is linear.}
\end{split}\end{split}\]</div>
<p>Once again, we can observe that <span class="math notranslate nohighlight">\(J\)</span> is linear in <span class="math notranslate nohighlight">\(\hat{u}\)</span>. Indeed, if
we choose <span class="math notranslate nohighlight">\(\hat{u} = \phi_j\)</span> for some <span class="math notranslate nohighlight">\(\phi_j\)</span> in the basis if <span class="math notranslate nohighlight">\(V\)</span>
then the definition of a nodal basis gives us:</p>
<div class="math notranslate nohighlight" id="equation-8-nonlinear-problems-5">
<span class="eqno">(8.9)<a class="headerlink" href="#equation-8-nonlinear-problems-5" title="Link to this equation">¶</a></span>\[J(u; \phi_i, \phi_j) = \delta_{ij}\]</div>
</section>
<section id="a-taylor-expansion-and-newton-s-method">
<h2><span class="section-number">8.4. </span>A Taylor expansion and Newton’s method<a class="headerlink" href="#a-taylor-expansion-and-newton-s-method" title="Link to this heading">¶</a></h2>
<p>Since we now have the derivative of the residual with respect to a
perturbation to the prospective solution <span class="math notranslate nohighlight">\(u\)</span>, we can write the first
terms of a Taylor series approximation for the value of the residual at a perturbed solution <span class="math notranslate nohighlight">\(u+\hat{u}\)</span>:</p>
<div class="math notranslate nohighlight" id="equation-8-nonlinear-problems-6">
<span class="eqno">(8.10)<a class="headerlink" href="#equation-8-nonlinear-problems-6" title="Link to this equation">¶</a></span>\[f(u+\hat{u}; v) = f(u; v) + J(u; v, \hat{u}) +\ldots \qquad \forall v\in V.\]</div>
<p>Now, just as in the scalar case, Newton’s method consists of
approximating the function (the residual) by the first two terms and
solving for the update that will set these terms to zero. In other
words:</p>
<div class="math notranslate nohighlight" id="equation-8-nonlinear-problems-7">
<span class="eqno">(8.11)<a class="headerlink" href="#equation-8-nonlinear-problems-7" title="Link to this equation">¶</a></span>\[u^{n+1} = u^n + \hat{u}\]</div>
<p>where <span class="math notranslate nohighlight">\(\hat{u} \in V\)</span> is the solution to:</p>
<div class="math notranslate nohighlight" id="equation-newton-update">
<span class="eqno">(8.12)<a class="headerlink" href="#equation-newton-update" title="Link to this equation">¶</a></span>\[J(u^n; v, \hat{u}) = - f(u^n; v) \qquad \forall v \in V.\]</div>
<p>In fact, <a class="reference internal" href="#equation-newton-update">(8.12)</a> is simply a linear finite element
problem! To make this explicit, we can expand <span class="math notranslate nohighlight">\(v\)</span> and <span class="math notranslate nohighlight">\(\hat{u}\)</span> in
terms of basis functions <span class="math notranslate nohighlight">\(\{\phi_i\}_{i=0}^{n-1} \in V\)</span> such that
<span class="math notranslate nohighlight">\(v = \sum_{i}v_i\phi_i\)</span> and <span class="math notranslate nohighlight">\(\hat{u} = \sum_{j}\hat{u}_j\phi_j\)</span>. We
note, as previously, that we we can drop the coefficients <span class="math notranslate nohighlight">\(v_i\)</span> giving:</p>
<div class="math notranslate nohighlight" id="equation-8-nonlinear-problems-8">
<span class="eqno">(8.13)<a class="headerlink" href="#equation-8-nonlinear-problems-8" title="Link to this equation">¶</a></span>\[\sum_{j} J(u^n; \phi_i, \phi_j) \hat{u}_j = - f(u^n; \phi_i) \qquad \forall\, 0\leq i < n .\]</div>
<p>For our nonlinear diffusion problem, the matrix <span class="math notranslate nohighlight">\(J\)</span> is given by:</p>
<div class="math notranslate nohighlight" id="equation-8-nonlinear-problems-9">
<span class="eqno">(8.14)<a class="headerlink" href="#equation-8-nonlinear-problems-9" title="Link to this equation">¶</a></span>\[\begin{split}J_{ij} =
J(u^n; \phi_i, \phi_j) =
\begin{cases}
\displaystyle\int_\Omega \nabla \phi_i \cdot \left(\phi_j \nabla u^n + (u^n + 1) \nabla \phi_j \right) \, \mathrm{d} x & \phi_i\in V_0\\
\delta_{ij} & \phi_i \in V_\Gamma,
\end{cases}\end{split}\]</div>
<p>and the right hand side vector <span class="math notranslate nohighlight">\(f\)</span> is given by <a class="reference internal" href="#equation-residual">(8.5)</a>. This
matrix, <span class="math notranslate nohighlight">\(J\)</span>, is termed the <em>Jacobian matrix</em> of <span class="math notranslate nohighlight">\(f\)</span>.</p>
<section id="stopping-criteria-for-newton-s-method">
<h3><span class="section-number">8.4.1. </span>Stopping criteria for Newton’s method<a class="headerlink" href="#stopping-criteria-for-newton-s-method" title="Link to this heading">¶</a></h3>
<p>Since Newton’s method is an iterative algorithm, it creates a
(hopefully convergent) sequence of approximations to the correct
solution to the original nonlinear problem. How do we know when to
accept the solution and terminate the algorithm?</p>
<p>The answer is that the update, <span class="math notranslate nohighlight">\(\hat{u}\)</span> which is calculated at each
step of Newton’s method is itself an approximation to the error in the
solution. It is therefore appropriate to stop Newton’s method when
this error estimate becomes sufficiently small in the <span class="math notranslate nohighlight">\(L^2\)</span> norm.</p>
<p>The observant reader will observe that <span class="math notranslate nohighlight">\(\hat{u}\)</span> is in fact
an estimate of the error in the <em>previous</em> step. This is indeed true:
the Newton step is both an estimate of the previous error and a
correction to that error. However, having calculated the error
estimate, it is utterly unreasonable to not apply the corresponding
correction.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Note!</p>
<p>Another commonly employed stopping mechanism is to consider the
size of the residual <span class="math notranslate nohighlight">\(f\)</span>. However, the residual is not actually a
function in <span class="math notranslate nohighlight">\(V\)</span>, but is actually a linear operator in <span class="math notranslate nohighlight">\(V^*\)</span>. Common
practice would be to identify <span class="math notranslate nohighlight">\(f\)</span> with a function in <span class="math notranslate nohighlight">\(V\)</span> by simply
taking the function whose coefficients match those of <span class="math notranslate nohighlight">\(f\)</span>. The
<span class="math notranslate nohighlight">\(L^2\)</span> or <span class="math notranslate nohighlight">\(l^2\)</span> norm is then taken of this function and this value
is used to determine when convergence has occured.</p>
<p>This approach effectively assumes that the Riesz map on <span class="math notranslate nohighlight">\(V\)</span> is the
trivial operator which identifies the basis function
coefficients. This would be legitimate were the inner product on
<span class="math notranslate nohighlight">\(V\)</span> the <span class="math notranslate nohighlight">\(l^2\)</span> dot product. However, since the inner product on <span class="math notranslate nohighlight">\(V\)</span>
is defined by an integral, the mesh resolution is effectively
encoded into <span class="math notranslate nohighlight">\(f\)</span>. This means that this approach produces
convergence rates which depend on the level of mesh refinement.</p>
<p>Avoiding this mesh dependency requires the evaluation of an
operator norm or, equivalently, the solution of a linear system in
order to find the Riesz representer of <span class="math notranslate nohighlight">\(f\)</span> in <span class="math notranslate nohighlight">\(V\)</span>. However, since
the error-estimator approach given above is both an actual estimate
of the error in the solution, and requires no additional linear
solves, it should be regarded as a preferable approach. For a full
treatment of Newton methods, see <span id="id1">[<a class="reference internal" href="zbibliography.html#id5" title="Peter Deuflhard. Newton Methods for Nonlinear Problems. Springer, 2011. doi:10.1007/978-3-642-23899-4.">Deu11</a>]</span>.</p>
</div>
</section>
<section id="stopping-threshold-values">
<h3><span class="section-number">8.4.2. </span>Stopping threshold values<a class="headerlink" href="#stopping-threshold-values" title="Link to this heading">¶</a></h3>
<p>What, then, qualifies as a sufficiently small value of our error
estimate? There are two usual approaches:</p>
<dl class="simple">
<dt>relative tolerance</dt><dd><p>Convergence is deemed to occur when the estimate
becomes sufficiently small compared with the first error estimate
calculated. This is generally the more defensible approach since
it takes into account the overall scale of the solution. <span class="math notranslate nohighlight">\(10^{-6}\)</span>
would be a reasonably common relative tolerance.</p>
</dd>
<dt>absolute tolerance</dt><dd><p>Computers employ finite precision arithmetic, so there is a limit
to the accuracy which can ever be achieved. This is a difficult
value to estimate, since it depends on the number and nature of
operations undertaken in the algorithm. A common approach is to set
this to a very small value (e.g. <span class="math notranslate nohighlight">\(10^{-50}\)</span>) initially, in order to
attempt to ensure that the relative tolerance threshold is
hit. Only if it becomes apparent that the problem being solved is
in a regime for which machine precision is a problem is a higher
absolute tolerance set.</p>
</dd>
</dl>
<p>It is important to realise that both of these criteria involve making
essentially arbitrary judgements about the scale of error which is
tolerable. There is also a clear trade-off between the level of error
tolerated and the cost of performing a large number of Newton
steps. For realistic problems, it is therefore frequently expedient
and/or necessary to tune the convergence criteria to the particular
case.</p>
<p>In making these judgements, it is also important to remember that the
error in the Newton solver is just one of the many sources of error in
a calculation. It is pointless to expend computational effort in an
attempt to drive the level of error in this component of the solver to
a level which will be swamped by a larger error occurring somewhere
else in the process.</p>
</section>
<section id="failure-modes">
<h3><span class="section-number">8.4.3. </span>Failure modes<a class="headerlink" href="#failure-modes" title="Link to this heading">¶</a></h3>
<p>Just as with the Newton method for scalar problems, Newton iteration
is not guaranteed to converge for all nonlinear problems or for all
initial guesses. If Newton’s method fails to converge, then the
algorithm presented so far constitutes an infinite loop. It is
therefore necessary to define some circumstances in which the
algorithm should terminate having failed to find a solution. Two such
circumstances are commonly employed:</p>
<dl class="simple">
<dt>maximum iterations</dt><dd><p>It is a reasonable heuristic that Newton’s method has failed if it
takes a very large number of iterations. What constitutes “too
many” is once again a somewhat arbitrary judgement, although if the
approach takes many tens of iterations this should always be cause
for reconsideration!</p>
</dd>
<dt>diverged error estimate</dt><dd><p>Newton’s method is not guaranteed to produce a sequence of
iterations which monotonically decrease the error, however if the
error estimate has increased to, say, hundreds or thousands of
times its initial value, this would once again be grounds for the
algorithm to fail.</p>
</dd>
</dl>
<p>Note that these failure modes are heuristic: having the algorithm
terminate for these reasons is really an instruction to the user to
think again about the problem, the solver, and the initial guess.</p>
</section>
</section>
<section id="implementing-a-nonlinear-problem">
<h2><span class="section-number">8.5. </span>Implementing a nonlinear problem<a class="headerlink" href="#implementing-a-nonlinear-problem" title="Link to this heading">¶</a></h2>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This problem is intentionally stated in more general terms than the
previous ones. It is your responsibility to decide on a code
structure, to derive a method of manufactured solutions answer, and
to create the convergence tests which demonstrate that your
solution is correct.</p>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This problem is not currently an assessable part of the module at Imperial
College. It is presented here for reference.</p>
</div>
<div class="proof proof-type-exercise" id="id2">
<div class="proof-title">
<span class="proof-type">Exercise 8.1</span>
</div><div class="proof-content">
<p>The <span class="math notranslate nohighlight">\(p\)</span>-laplacian is a generalisation of the laplacian from
a second derivative to an arbitrary derivative. It is nonlinear for
<span class="math notranslate nohighlight">\(p\neq2\)</span>.</p>
<p>Implement <a class="reference internal" href="fe_utils.solvers.html#fe_utils.solvers.mastery.solve_mastery" title="fe_utils.solvers.mastery.solve_mastery"><code class="xref py py-func docutils literal notranslate"><span class="pre">solve_mastery()</span></code></a> so that it solves
the following problem using degree 1 Lagrange elements over the
unit square domain:</p>
<div class="math notranslate nohighlight" id="equation-mastery">
<span class="eqno">(8.15)<a class="headerlink" href="#equation-mastery" title="Link to this equation">¶</a></span>\[ \begin{align}\begin{aligned}-\nabla\cdot\left(|\nabla u|^{p-2} \nabla u\right) = g\\u = b \textrm{ on } \Gamma\\p = 4\end{aligned}\end{align} \]</div>
<p>Select the solution <span class="math notranslate nohighlight">\(u=e^{xy}\)</span> and compute the required forcing function <span class="math notranslate nohighlight">\(g\)</span> so
that your solution solves the equations. Make sure your boundary
condition function <span class="math notranslate nohighlight">\(b\)</span> is consistent with your chosen solution!</p>
<p>For this problem, it is not possible to use the zero function as an
initial guess for Newton’s method. A much better choice is to treat
the 2-laplacian as an approximation to the 4-laplacian, and
therefore to solve Poisson’s equation first to obtain a good
initial guess for the 4-laplacian problem.</p>
<p>Your submitted answer will consist of:</p>
<ol class="arabic">
<li><p>A written component containing your derivation of:</p>
<ol class="loweralpha simple">
<li><p>The weak form of <a class="reference internal" href="#equation-mastery">(8.15)</a>; and</p></li>
<li><p>the Jacobian; and</p></li>
<li><p>the forcing term implied by the specified manufactured solution; and</p></li>
<li><p>an explanation of why the zero function cannot be used as an initial guess for the solution.</p></li>
</ol>
<p>A neatly hand-written or a typed submission are equally acceptable.</p>
</li>
<li><p>The code to implement the solution. This should be in
<code class="docutils literal notranslate"><span class="pre">fe_utils.solvers.mastery.py</span></code> in your implementation. A
convergence test for your code is provided in
<code class="docutils literal notranslate"><span class="pre">test/test_12_mastery_convergence.py</span></code>.</p>
<p>The submission of your mastery exercise, and indeed the entire
implementation exercise will be on Blackboard. You will submit a
PDF containing the derivations above, and the git sha1 for the
commit you would like to have marked.</p>
</li>
</ol>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>It is an exceptionally useful aid to debugging to have your
Newton iteration print out the value of the error norm and the
iteration number for each iteration. If you wish to see the
printed output while running the test, you can pass the <code class="docutils literal notranslate"><span class="pre">-s</span></code>
option to <code class="docutils literal notranslate"><span class="pre">py.test</span></code>.</p>
</div>
<div class="admonition hint">
<p class="admonition-title">Hint</p>
<p>You could parametrise your code by <span class="math notranslate nohighlight">\(p\)</span>. By setting <span class="math notranslate nohighlight">\(p=2\)</span>, you
reduce your problem to the linear case. You can use the linear
case to test your code initially, before setting <span class="math notranslate nohighlight">\(p=4\)</span> for the
actual exercise. Note that, in the linear case, Newton’s method
will converge in exactly one iteration (although your algorithm
will have to actually calculate two steps in order to know that
convergence has occurred).</p>
</div>
</div></div></section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
© Copyright 2014-2026, David A. Ham and Colin J. Cotter.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.4.7.
</div>
</body>
</html>