Skip to content

Commit 11f1126

Browse files
author
sveinlin
committed
fixed typos in nonlin chapter
1 parent cda6bfd commit 11f1126

55 files changed

Lines changed: 775 additions & 451 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

doc/.src/chapters/nonlin/nonlin_ode.do.txt

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ label{nonlin:timediscrete:logistic}
55

66
=== Algebraic equations ===
77

8+
idx{iterative methods}
9+
810
A linear, scalar, algebraic equation in $x$ has the form
911

1012
!bt
@@ -177,7 +179,7 @@ equation for the unknown value $u^{n+1}$ that we can easily solve:
177179
!bt
178180
\[ u^{n+1} = u^n + \Delta t\,u^n(1 - u^n)\tp\]
179181
!et
180-
The nonlinearity in the original equation poses in this case no difficulty
182+
In this case, the nonlinearity in the original equation poses no difficulty
181183
in the discrete algebraic equation.
182184
Any other explicit scheme in time will also give only linear
183185
algebraic equations
@@ -200,6 +202,8 @@ known in the next step, which is linear in the unknown $u^{n+1}$ .
200202
===== Exact solution of nonlinear algebraic equations =====
201203
label{nonlin:timediscrete:logistic:roots}
202204

205+
idx{`sympy`} idx{Taylor series} idx{`limit`}
206+
203207
Switching to a Backward Euler scheme for
204208
(ref{nonlin:timediscrete:logistic:eq}),
205209

@@ -259,7 +263,7 @@ In the present simple case, however, we can analyze the roots mathematically
259263
and provide an answer. The idea is to expand the roots
260264
in a series in $\Delta t$ and truncate after the linear term since
261265
the Backward Euler scheme will introduce an error proportional to
262-
$\Delta t$ anyway. Using `sympy` we find the following Taylor series
266+
$\Delta t$ anyway. Using `sympy`, we find the following Taylor series
263267
expansions of the roots:
264268

265269
!bc pyshell
@@ -431,7 +435,7 @@ label{nonlin:timediscrete:logistic:BE:Picard:1it}
431435
!et
432436
which is a linear algebraic equation in the unknown $u^n$, making
433437
it easy to solve for $u^n$ without any need for
434-
any alternative notation.
438+
an alternative notation.
435439

436440
We shall later refer to the strategy of taking one Picard step, or
437441
equivalently, linearizing terms with use of the solution at the
@@ -456,6 +460,8 @@ level as start for the Picard iteration.
456460
===== Linearization by a geometric mean =====
457461
label{nonlin:timediscrete:logistic:geometric:mean}
458462

463+
idx{geometric mean} idx{arithmetic mean}
464+
459465
We consider now a Crank-Nicolson discretization of
460466
(ref{nonlin:timediscrete:logistic:eq}). This means that the
461467
time derivative is approximated by a centered
@@ -480,7 +486,7 @@ mean,
480486
\[ u^{n+\half}\approx \half(u^n + u^{n+1}),\]
481487
!et
482488
such that the scheme involves the unknown function only at the time levels
483-
where we actually compute it.
489+
where we actually intend to compute it.
484490
The same arithmetic mean applied to the nonlinear term gives
485491

486492
!bt
@@ -549,6 +555,7 @@ u^\prime u$, i.e., a difference of size $\Delta t^2$).
549555
===== Newton's method =====
550556
label{nonlin:timediscrete:logistic:Newton}
551557

558+
idx{quadratic convergence}
552559

553560
The Backward Euler scheme (ref{nonlin:timediscrete:logistic:eq:BE})
554561
for the logistic equation leads to a nonlinear algebraic equation
@@ -639,7 +646,7 @@ notation used in the literature.
639646
===== Relaxation =====
640647
label{nonlin:timediscrete:logistic:relaxation}
641648

642-
idx{relaxation (nonlinear equations)}
649+
idx{relaxation (nonlinear equations)} idx{relaxation parameter}
643650

644651
One iteration in Newton's method or
645652
Picard iteration consists of solving a linear problem $\hat F(u)=0$.
@@ -670,6 +677,7 @@ label{nonlin:timediscrete:logistic:relaxation:Newton:formula}
670677
===== Implementation and experiments =====
671678
label{nonlin:timediscrete:logistic:impl}
672679

680+
idx{`logistic.py`}
673681

674682
The program "`logistic.py`": "${src_nonlin}/logistic.py" contains
675683
implementations of all the methods described above.
@@ -828,13 +836,15 @@ where $f$ is a nonlinear function of $u$.
828836

829837
=== Explicit time discretization ===
830838

831-
Explicit ODE methods like the Forward Euler scheme, Runge-Kutta methods,
839+
Explicit ODE methods like the Forward Euler scheme, Runge-Kutta methods and
832840
Adams-Bashforth methods all evaluate $f$ at time levels where
833841
$u$ is already computed, so nonlinearities in $f$ do not
834842
pose any difficulties.
835843

836844
=== Backward Euler discretization ===
837845

846+
idx{`ODE_Picard_tricks.py`}
847+
838848
Approximating $u^{\prime}$ by a backward difference leads to a Backward Euler
839849
scheme, which can be written as
840850

@@ -863,8 +873,8 @@ until a stopping criterion is fulfilled.
863873
!bnotice Explicit vs implicit treatment of nonlinear terms
864874
Evaluating $f$ for a known $u^{-}$ is referred to as *explicit* treatment of
865875
$f$, while if $f(u,t)$ has some structure, say $f(u,t) = u^3$, parts of
866-
$f$ can involve the known $u$, as in the manual linearization
867-
like $(u^{-})^2u$, and then the treatment of $f$ is ``more implicit''
876+
$f$ can involve the unknown $u$, as in the manual linearization
877+
$(u^{-})^2u$, and then the treatment of $f$ is ``more implicit''
868878
and ``less explicit''. This terminology is inspired by time discretization
869879
of $u^{\prime}=f(u,t)$, where evaluating $f$ for known $u$ values gives
870880
explicit schemes, while treating $f$ or parts of $f$ implicitly,
@@ -894,7 +904,7 @@ implicitly.
894904

895905
A trick to treat $f$ implicitly in Picard iteration is to
896906
evaluate it as $f(u^{-},t)u/u^{-}$. For a polynomial $f$, $f(u,t)=u^m$,
897-
this corresponds to $(u^{-})^{m}u/u^{-1}=(u^{-})^{m-1}u$. Sometimes this more implicit
907+
this corresponds to $(u^{-})^{m}u/u^{-}=(u^{-})^{m-1}u$. Sometimes this more implicit
898908
treatment has no effect, as with $f(u,t)=\exp(-u)$ and $f(u,t)=\ln (1+u)$,
899909
but with $f(u,t)=\sin(2(u+1))$, the $f(u^{-},t)u/u^{-}$ trick
900910
leads to 7, 9, and 11 iterations during the first three steps, while
@@ -904,7 +914,7 @@ $f(u^{-},t)$ demands 17, 21, and 20 iterations.
904914

905915
Newton's method applied to a Backward Euler discretization of
906916
$u^{\prime}=f(u,t)$
907-
requires the computation of the derivative
917+
requires computation of the derivative
908918

909919
!bt
910920
\[ F^{\prime}(u) = 1 - \Delta t\frac{\partial f}{\partial u}(u,t_n)\tp\]
@@ -966,6 +976,8 @@ while Newton's method can apply the general formula
966976
===== Systems of ODEs =====
967977
label{nonlin:ode:generic:sys:pendulum}
968978

979+
idx{system of algebraic equations} idx{coupled system}
980+
969981
We may write a system of ODEs
970982

971983
!bt
@@ -1094,7 +1106,7 @@ compactly as
10941106
where $u$ is a vector of unknowns $u=(u_0,\ldots,u_N)$, and
10951107
$F$ is a vector function: $F=(F_0,\ldots,F_N)$.
10961108
The system at the end of Section ref{nonlin:ode:generic:sys:pendulum} fits
1097-
this notation with $N=2$, $F_0(u)$ given by the left-hand side of
1109+
this notation with $N=1$, $F_0(u)$ given by the left-hand side of
10981110
(ref{nonlin:ode:generic:sys:pendulum:u0}), while $F_1(u)$ is
10991111
the left-hand side of (ref{nonlin:ode:generic:sys:pendulum:u1}).
11001112

@@ -1118,6 +1130,8 @@ of these methods, can be found in Kelley cite{Kelley_1995}.
11181130
===== Picard iteration =====
11191131
label{nonlin:systems:alg:Picard}
11201132

1133+
idx{linear system}
1134+
11211135
We cannot apply Picard iteration to nonlinear equations unless there is
11221136
some special structure. For the commonly arising case
11231137
$A(u)u=b(u)$ we can linearize the
@@ -1153,6 +1167,8 @@ more details.
11531167
===== Newton's method =====
11541168
label{nonlin:systems:alg:Newton}
11551169

1170+
idx{Jacobian}
1171+
11561172
The natural starting point for Newton's method is the general
11571173
nonlinear vector equation $F(u)=0$.
11581174
As for a scalar equation, the idea is to approximate $F$
@@ -1316,7 +1332,7 @@ k>k_{\max}\tp
13161332
===== Example: A nonlinear ODE model from epidemiology =====
13171333
label{nonlin:systems:alg:SI}
13181334

1319-
The simplest model spreading of a disease, such as a flu, takes
1335+
A very simple model for the spreading of a disease, such as a flu, takes
13201336
the form of a $2\times 2$ ODE system
13211337

13221338
!bt
@@ -1345,7 +1361,7 @@ algebraic equations in the unknowns $S^{n+1}$ and $I^{n+1}$:
13451361
\frac{\nu}{2}(I^n + I^{n+1})\tp
13461362
\end{align}
13471363
!et
1348-
Introducing $S$ for $S^{n+1}$, $S^{(1)}$ for $S^n$, $I$ for $I^{n+1}$,
1364+
Introducing $S$ for $S^{n+1}$, $S^{(1)}$ for $S^n$, $I$ for $I^{n+1}$ and
13491365
$I^{(1)}$ for $I^n$, we can rewrite the system as
13501366

13511367
!bt

doc/.src/chapters/nonlin/nonlin_pde1D.do.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ nonlinear problem and minimize the spatial discretization details.
459459
The nonlinearity in the differential equation
460460
(ref{nonlin:alglevel:1D:pde}) poses no more difficulty than a variable
461461
coefficient, as in the term $(\dfc(x)u^{\prime})^{\prime}$. We can
462-
therefore use a standard finite difference approach to discretizing
462+
therefore use a standard finite difference approach when discretizing
463463
the Laplace term with a variable coefficient:
464464

465465
!bt
@@ -612,7 +612,7 @@ case with a small mesh, say just two cells ($N_x=2$). We use $u^{-}_i$
612612
for the $i$-th component in $u^{-}$.
613613

614614
The starting point is the basic expressions for the
615-
nonlinear equations at mesh point $i=0$ and $i=1$ are
615+
nonlinear equations at mesh point $i=0$ and $i=1$:
616616

617617
!bt
618618
\begin{align}
@@ -701,7 +701,7 @@ where
701701
!bt
702702
\begin{align}
703703
B_{0,0} &=\frac{1}{2\Delta x^2}(\dfc(u^-_{-1}) + 2\dfc(u^-_{0}) + \dfc(u^-_{1}))
704-
+ a\\
704+
+ a,\\
705705
B_{0,1} &=
706706
-\frac{1}{2\Delta x^2}(\dfc(u^-_{-1}) + 2\dfc(u^-_{0})
707707
+ \dfc(u^-_{1})),\\

doc/.src/chapters/nonlin/nonlin_pde_gen.do.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ which in 2D can be written
255255
\]
256256
!et
257257
We do not dive into the details of handling boundary conditions now.
258-
Dirichlet and Neumann conditions are handled as in a
258+
Dirichlet and Neumann conditions are handled as in
259259
corresponding linear, variable-coefficient diffusion problems.
260260

261261
Writing the scheme out, putting the unknown values on the
@@ -334,7 +334,7 @@ contribution to the Jacobian since $F_{i,j}$ contains $u_{i\pm 1,j}$,
334334
$u_{i,j\pm 1}$, and $u_{i,j}$. This means that $J_{i,j,r,s}$ has
335335
nonzero contributions only if $r=i\pm 1$, $s=j\pm 1$, as well as $r=i$
336336
and $s=j$. The corresponding terms in $J_{i,j,r,s}$ are
337-
$J_{i,j,i-1,j}$, $J_{i,j,i+1,j}$, $J_{i,j,i,j-1}$, $J_{i,j,i,j+1}$,
337+
$J_{i,j,i-1,j}$, $J_{i,j,i+1,j}$, $J_{i,j,i,j-1}$, $J_{i,j,i,j+1}$
338338
and $J_{i,j,i,j}$. Therefore, the left-hand side of the Newton
339339
system, $\sum_r\sum_s J_{i,j,r,s}\delta u_{r,s}$ collapses to
340340

@@ -380,7 +380,7 @@ of an index.
380380

381381
===== Continuation methods =====
382382

383-
idx{continuation method}
383+
idx{continuation! method} idx{continuation! parameter}
384384

385385
Picard iteration or Newton's method may diverge when solving PDEs with
386386
severe nonlinearities. Relaxation with $\omega <1$

doc/.src/chapters/nonlin/nonlin_split.do.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
======= Operator splitting methods =======
33
label{nonlin:splitting}
44

5+
idx{ADI methods} idx{split-step methods} idx{dimensional splitting}
6+
57
Operator splitting is a natural and old idea. When a PDE or system of PDEs
68
contains different terms expressing different physics, it is natural to
79
use different numerical methods for different physical processes. This can
@@ -119,6 +121,8 @@ with global solution set as $u(t_{n+1}) = u^{\stepone}(t_{n+1})$.
119121
===== Example: Logistic growth =====
120122
label{nonlin:splitting:logistic}
121123

124+
idx{logistic growth} idx{`split_logistic.py`}
125+
122126
Let us split the (scaled) logistic equation
123127

124128
!bt
@@ -284,7 +288,7 @@ The algorithm goes like this:
284288
o Solve the diffusion problem for one time step as usual.
285289
o Solve the reaction ODEs at each mesh point in $[t_n,t_n+\Delta t]$,
286290
using the diffusion solution in 1. as initial condition.
287-
The solution of the ODEs constitute the solution of the original problem
291+
The solution of the ODEs constitutes the solution of the original problem
288292
at the end of each time step.
289293

290294
We may use a much smaller time step when solving the reaction part, adapted
@@ -296,6 +300,9 @@ splitting methods.
296300
===== Example: Reaction-Diffusion with linear reaction term =====
297301
label{nonlin:splitting:RD_linearR}
298302

303+
idx{`split_diffu_react.py`} idx{verification! convergence rates}
304+
idx{Adams-Bashforth} idx{Odespy}
305+
299306
The methods above may be explored in detail through a specific
300307
computational example in which we compute the convergence rates
301308
associated with four different solution approaches for the
4.7 KB
Binary file not shown.
4.14 KB
Binary file not shown.
4.7 KB
Binary file not shown.

doc/pub/nonlin/html/._nonlin-sol000.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
88
<meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" />
99
<meta name="description" content="Solving nonlinear ODE and PDE problems">
10-
<meta name="keywords" content="linearization explicit time integration,linearization,Picard iteration,successive substitutions,fixed-point iteration,linearization Picard iteration,linearization successive substitutions,linearization fixed-point iteration,stopping criteria (nonlinear problems),single Picard iteration technique,relaxation (nonlinear equations),stopping criteria (nonlinear problems),continuation method,operator splitting,splitting ODEs,fractional step methods,Strang splitting,continuation method">
10+
<meta name="keywords" content="iterative methods,linearization explicit time integration,Taylor series,linearization,Picard iteration,successive substitutions,fixed-point iteration,linearization Picard iteration,linearization successive substitutions,linearization fixed-point iteration,stopping criteria (nonlinear problems),single Picard iteration technique,geometric mean,arithmetic mean,quadratic convergence,relaxation (nonlinear equations),relaxation parameter,system of algebraic equations,coupled system,linear system,Jacobian,stopping criteria (nonlinear problems),continuation method,continuation parameter,ADI methods,split-step methods,dimensional splitting,operator splitting,splitting ODEs,fractional step methods,Strang splitting,logistic growth,verification convergence rates,Adams-Bashforth,Odespy,continuation method">
1111

1212
<title>Solving nonlinear ODE and PDE problems</title>
1313

@@ -419,7 +419,7 @@
419419
<center>[3] <b>Department of Process, Energy and Environmental Technology, University College of Southeast Norway</b></center>
420420
<br>
421421
<p>
422-
<center><h4>Sep 29, 2016</h4></center> <!-- date -->
422+
<center><h4>Dec 21, 2016</h4></center> <!-- date -->
423423
<br>
424424
<p>
425425
Note: Preliminary version (expect typos).

doc/pub/nonlin/html/._nonlin-sol001.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
88
<meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" />
99
<meta name="description" content="Solving nonlinear ODE and PDE problems">
10-
<meta name="keywords" content="linearization explicit time integration,linearization,Picard iteration,successive substitutions,fixed-point iteration,linearization Picard iteration,linearization successive substitutions,linearization fixed-point iteration,stopping criteria (nonlinear problems),single Picard iteration technique,relaxation (nonlinear equations),stopping criteria (nonlinear problems),continuation method,operator splitting,splitting ODEs,fractional step methods,Strang splitting,continuation method">
10+
<meta name="keywords" content="iterative methods,linearization explicit time integration,Taylor series,linearization,Picard iteration,successive substitutions,fixed-point iteration,linearization Picard iteration,linearization successive substitutions,linearization fixed-point iteration,stopping criteria (nonlinear problems),single Picard iteration technique,geometric mean,arithmetic mean,quadratic convergence,relaxation (nonlinear equations),relaxation parameter,system of algebraic equations,coupled system,linear system,Jacobian,stopping criteria (nonlinear problems),continuation method,continuation parameter,ADI methods,split-step methods,dimensional splitting,operator splitting,splitting ODEs,fractional step methods,Strang splitting,logistic growth,verification convergence rates,Adams-Bashforth,Odespy,continuation method">
1111

1212
<title>Solving nonlinear ODE and PDE problems</title>
1313

@@ -576,7 +576,7 @@ <h2 id="nonlin:timediscrete:logistic:FE">Linearization by explicit time discreti
576576

577577
$$ u^{n+1} = u^n + \Delta t\,u^n(1 - u^n)\tp$$
578578

579-
The nonlinearity in the original equation poses in this case no difficulty
579+
In this case, the nonlinearity in the original equation poses no difficulty
580580
in the discrete algebraic equation.
581581
Any other explicit scheme in time will also give only linear
582582
algebraic equations
@@ -661,7 +661,7 @@ <h2 id="nonlin:timediscrete:logistic:roots">Exact solution of nonlinear algebrai
661661
and provide an answer. The idea is to expand the roots
662662
in a series in \( \Delta t \) and truncate after the linear term since
663663
the Backward Euler scheme will introduce an error proportional to
664-
\( \Delta t \) anyway. Using <code>sympy</code> we find the following Taylor series
664+
\( \Delta t \) anyway. Using <code>sympy</code>, we find the following Taylor series
665665
expansions of the roots:
666666

667667
<p>
@@ -824,7 +824,7 @@ <h3 id="___sec10">A single Picard iteration </h3>
824824

825825
which is a linear algebraic equation in the unknown \( u^n \), making
826826
it easy to solve for \( u^n \) without any need for
827-
any alternative notation.
827+
an alternative notation.
828828

829829
<p>
830830
We shall later refer to the strategy of taking one Picard step, or
@@ -877,7 +877,7 @@ <h2 id="nonlin:timediscrete:logistic:geometric:mean">Linearization by a geometri
877877
$$ u^{n+\half}\approx \half(u^n + u^{n+1}),$$
878878

879879
such that the scheme involves the unknown function only at the time levels
880-
where we actually compute it.
880+
where we actually intend to compute it.
881881
The same arithmetic mean applied to the nonlinear term gives
882882

883883
$$ (u^{n+\half})^2\approx \frac{1}{4}(u^n + u^{n+1})^2,$$
@@ -1228,7 +1228,7 @@ <h2 id="nonlin:ode:generic">Generalization to a general nonlinear ODE</h2>
12281228
<h3 id="___sec16">Explicit time discretization </h3>
12291229

12301230
<p>
1231-
Explicit ODE methods like the Forward Euler scheme, Runge-Kutta methods,
1231+
Explicit ODE methods like the Forward Euler scheme, Runge-Kutta methods and
12321232
Adams-Bashforth methods all evaluate \( f \) at time levels where
12331233
\( u \) is already computed, so nonlinearities in \( f \) do not
12341234
pose any difficulties.
@@ -1261,8 +1261,8 @@ <h3 id="___sec17">Backward Euler discretization </h3>
12611261
<div class="alert alert-block alert-success alert-text-normal"><b>Explicit vs implicit treatment of nonlinear terms.</b>
12621262
Evaluating \( f \) for a known \( u^{-} \) is referred to as <em>explicit</em> treatment of
12631263
\( f \), while if \( f(u,t) \) has some structure, say \( f(u,t) = u^3 \), parts of
1264-
\( f \) can involve the known \( u \), as in the manual linearization
1265-
like \( (u^{-})^2u \), and then the treatment of \( f \) is &quot;more implicit&quot;
1264+
\( f \) can involve the unknown \( u \), as in the manual linearization
1265+
\( (u^{-})^2u \), and then the treatment of \( f \) is &quot;more implicit&quot;
12661266
and &quot;less explicit&quot;. This terminology is inspired by time discretization
12671267
of \( u^{\prime}=f(u,t) \), where evaluating \( f \) for known \( u \) values gives
12681268
explicit schemes, while treating \( f \) or parts of \( f \) implicitly,
@@ -1296,7 +1296,7 @@ <h3 id="___sec17">Backward Euler discretization </h3>
12961296
<p>
12971297
A trick to treat \( f \) implicitly in Picard iteration is to
12981298
evaluate it as \( f(u^{-},t)u/u^{-} \). For a polynomial \( f \), \( f(u,t)=u^m \),
1299-
this corresponds to \( (u^{-})^{m}u/u^{-1}=(u^{-})^{m-1}u \). Sometimes this more implicit
1299+
this corresponds to \( (u^{-})^{m}u/u^{-}=(u^{-})^{m-1}u \). Sometimes this more implicit
13001300
treatment has no effect, as with \( f(u,t)=\exp(-u) \) and \( f(u,t)=\ln (1+u) \),
13011301
but with \( f(u,t)=\sin(2(u+1)) \), the \( f(u^{-},t)u/u^{-} \) trick
13021302
leads to 7, 9, and 11 iterations during the first three steps, while
@@ -1308,7 +1308,7 @@ <h3 id="___sec17">Backward Euler discretization </h3>
13081308
<p>
13091309
Newton's method applied to a Backward Euler discretization of
13101310
\( u^{\prime}=f(u,t) \)
1311-
requires the computation of the derivative
1311+
requires computation of the derivative
13121312

13131313
$$ F^{\prime}(u) = 1 - \Delta t\frac{\partial f}{\partial u}(u,t_n)\tp$$
13141314

0 commit comments

Comments
 (0)