graduation thesis in mathematics - matematica - roma tre · • intermediate complexity models...
Post on 22-Jul-2020
5 Views
Preview:
TRANSCRIPT
UNIVERSITÀ DEGLI STUDI
ROMA
TRE
Facolta di Scienze Matematiche, Fisiche e Naturali
Graduation Thesis in Mathematics
Impact of the numerical techniques on the
statistical properties of simplified
climatological models
(Synthesis)
Candidate Supervisor
Giulia Iacovelli Prof. Roberto Ferretti
Academic Year 2012/2013
Contents
0 Introduction 1
0.1 Atmospheric Models . . . . . . . . . . . . . . . . . . . . . . . 2
0.2 The Lorenz System . . . . . . . . . . . . . . . . . . . . . . . . 4
0.3 A numerical example:
the harmonic oscillator . . . . . . . . . . . . . . . . . . . . . . 7
0.4 Considerations and Objectives . . . . . . . . . . . . . . . . . . 8
1 Symmetric numerical methods and Reversibility 9
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2 Reversibility of differential equations and maps . . . . . . . . 10
1.3 Symmetry and Reversibility for Runge Kutta Methods . . . . 13
1.4 Symmetry and Reversibility for Multistep Methods . . . . . . 14
2 Numerical Tests 16
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.2 Test for the harmonic oscillator . . . . . . . . . . . . . . . . . 17
2.2.1 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.3 Test for the Lorenz system . . . . . . . . . . . . . . . . . . . . 22
2.3.1 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.3.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.4 Final considerations . . . . . . . . . . . . . . . . . . . . . . . . 29
2
Contents 3
Bibliography 32
Chapter 0
Introduction
Atmospheric models are mathematical models constructed in order to sim-
ulate the atmospheric motions. The analysis and simulation of atmospheric
models represents one of the most challenging fields of scientific computing
as the atmospheric motions are the effect of the combination of different
physical events that give rise to a complex, chaotic behaviour [1].
We will treat deterministic chaos which appears in particular deterministic
systems, as in atmospheric models. It makes them unpredictable, although
their nature is fully determined by their initial conditions, with no random
elements occured [2]. In this context, small differences in initial conditions
(such as those normally occurred in numerical computation) lead soon ap-
proximated solutions to diverge for such dynamical systems, making long-
term prediction impossible in general.
However, in particular conditions and areas, climatological systems tend to
keep an almost stable configuration for some time, and periodically it may
reassume this particular state. One should rather talk about a set of similar
regimes, known as cluster, rather than a precise one configuration. A typical
example of this phenomenon is given by the Azores High, an anticyclonic
area which sets up with some periodicity over the Azores region (see fig.1).
In conclusion, the chaoticity of the system, at a global level, might be inter-
preted as a series of transitions with unpredictable times between different
1
0.1 Atmospheric Models 2
Extracting information from chaos: a case in climatological analysis 3
Fig. 1 A typical climatic regime: the Azores High (courtesy of ECMWF)
corresponds to a neighbourhood of a given (average) point in the space of configu-rations of the system. The points associated to different regimes act as some sort ofmetastable equilibria, around which the systems may evolve for a while.
At a very global level, the chaoticity of the system might be interpreted as a seriesof transitions (with unpredictable times) between different regimes. This approach,which has a well-established tradition started in the late 80s (see [5]) aims at charac-terizing climatic regimes as some sort of Markov chain. We will soon try to clarifythis approach by examining the behaviour of the Lorenz model.
2.1 A toy model for regime transitions
The Lorenz model originates from the so-called Rayleigh–Benard experiment (seeFig. 2), in which a fluid is heated from below and cooled down from above, thuscausing the appearance of convective cells. Describing the physics of a single cell
Fig. 2 A sketch of theRayleigh–Benard experiment
Figure 1: The Azores High (courtesy of ECMWF).
states.
0.1 Atmospheric Models
An atmospheric model involves a system of at least six nonlinear differential
equations, known as primitive equations :
dudt− fv = −1
ρdpdx
(conservation of momentum)dvdt− fu = −1
ρdpdy
(conservation of momentum)dpdz
= −ρg (electrostatic equilibrium)dudx
+ dvdy
dwdz
= −1ρdρdt
(conservation of mass)
cpdTdt− αdp
dt= Q (conservation of energy)
p = ρRT (ideal gas law)
The system is a chaotic model, i.e. a model whose solutions show a critical
dependence on perturbations: similar initial conditions may lead to com-
pletely different evolutions after a relatively short time interval.
Due to its intrinsic complexity, the system of primitive equations has pro-
duced a classification of models of use in atmospheric simulation in terms of
0.1 Atmospheric Models 3
amount of embedded informations:
• Full models involve as many physical mechanisms as possible in order
to achieve the best accuracy for the approximated solutions;
• Intermediate complexity models consider only the most significant char-
acteristics in order to obtain a more manageable model;
• Toy models are greatly simplified and formulated in low dimension, but
preserve some crucial properties of the real physical system. They are
used to get qualitative informations on a specific physical phenomenon.
Depending on the context, the analysis and simulation of atmospheric models
are approached with different techniques and purposes. In particular, two
branches of the atmospheric sciences apply complementary strategies:
• Meteorology is typically interested in small time, deterministic anal-
ysis/forecast. In the time horizon of interest in Numerical Weather
Prediction (up to about 10 days) the attempt is to reproduce as close
as possible the evolution of atmosphere, and chaotic behaviour repre-
sents a limit to enlarge this time interval;
• Climatology is typically interested in the evolution of atmosphere for
long times (years or decades) and at planetary scale. In this context,
chaos becomes an inherent characteristic of the problem and the tech-
niques adopted in the analysis are mainly of statistical nature.
To what has been said so far, toy models are mainly used in climatology.
In this study we are interested in the analysis of simplified climatological
models, in particular in the conservation of their statistical properties. In
this context, we are going to treat, in the next section, the most famous
among toy models: the Lorenz system, proposed in 1963 by E. Lorenz in
a paper in which for the first time the concept of deterministic chaos was
formulated [3].
0.2 The Lorenz System 4
Extracting information from chaos: a case in climatological analysis 3
Fig. 1 A typical climatic regime: the Azores High (courtesy of ECMWF)
corresponds to a neighbourhood of a given (average) point in the space of configu-rations of the system. The points associated to different regimes act as some sort ofmetastable equilibria, around which the systems may evolve for a while.
At a very global level, the chaoticity of the system might be interpreted as a seriesof transitions (with unpredictable times) between different regimes. This approach,which has a well-established tradition started in the late 80s (see [5]) aims at charac-terizing climatic regimes as some sort of Markov chain. We will soon try to clarifythis approach by examining the behaviour of the Lorenz model.
2.1 A toy model for regime transitions
The Lorenz model originates from the so-called Rayleigh–Benard experiment (seeFig. 2), in which a fluid is heated from below and cooled down from above, thuscausing the appearance of convective cells. Describing the physics of a single cell
Fig. 2 A sketch of theRayleigh–Benard experiment
Figure 2: Schematization of the motion of a convective cell, reproduced in
Rayleigh-Benard experiment.
0.2 The Lorenz System
In the early 1960s, the American mathematician Edward Norton Lorenz
accidentally discovered the chaotic behaviour of a deterministic and three-
dimensional system of nonlinear differential equations
dxdt
= σ(y − x)dydt
= x(ρ− z)− ydzdt
= xy − βz
where x, y and z make up the system state, t is time, and σ, ρ and β are the
system parameters. In particular σ is the Prandt number, ρ = Ra/Rac where
Ra is the Rayleigh number and Rac is the critical Rayleigh number and β is
a geometric factor.
The system is a simplified description of fluid circulation. Lorenz formulated
it by simplification of the so-called Rayleigh–Benard experiment, in which
fluid is heated uniformly from below and cooled uniformly from above (see
fig.2), thus causing the appearance of convective cells.
Depending on the value of the parameters σ, ρ, β and the initial conditions,
a chaotic behaviour may appear. In particular, the plot of a peculiar set of
chaotic solutions, known as Lorenz attractor, shows the famous trajectory
0.2 The Lorenz System 5’../lorenz/lorenz_attractor’
-20 -15 -10 -5 0 5 10 15 20 -25-20
-15-10
-50
510
1520
25
05101520253035404550
Figure 3: Lorenz attractor.
that resembles a shape of a butterfly (see fig.3).
It is useful to focus on the plot of the x component of the system (see fig.4),
since it still preserves a physical meaning despite the very rough mathe-
matical formulation of the equations: the first variable represents the main
component of vorticity. Its signs says whether the cell is rotating clockwise
or anticlockwise and we can easily individuate them in fig.3: the two wings
of the butterfly correspond to positive and negative values of x. Since the
transition of the trajectory between a wing and the other represents a change
in the sign of x(t), it has also the meaning of a change of direction in the
rotation of the cell. If we focus on alternations of sign in the plot of fig.4,
it becomes evident that they occur without any fixed periodicity. This phe-
nomenon is an example of chaotic behaviour, in which the system switches
between two states, which have two average holding times. This situation
can be represented as a Markov chain 1 (see fig.5), where the two states are
showed with their own average holding time T1 and T2.
1A discrete Markov chain is a mathematical system that describes the transitions from
one state to an other, and it is a stochastic process [5].
0.2 The Lorenz System 6
4 Francesco Bonghi and Roberto Ferretti
Fig. 3 A trajectory on the Lorenz attractor and its x-component as a function of time
in terms of a Fourier series, and truncating to the first terms, Lorenz obtained thedifferential system 8
<:
x = s(y� x)y = rx� xz� yz = xy�b z
in which, depending on the value of the constants s , r and b , a chaotic behaviourmay appear. The upper plot of Figure 4 shows a typical trajectory of the Lorenzsystem on the famous butterfly-shaped attractor.
Despite the very rough mathematical formulation, the variable x still keeps aphysical meaning: it represents the main component of vorticity – in other words,its sign says whether the cell is rotating clockwise or counterclockwise. The lowerplot of Figure 4 shows the evolution of the x component along the trajectory of theupper plot. Since the two wings of the Lorenz attractor correspond to positive andnegative values of x, a transition of the trajectory between a wing and the otheris recognized by a change in the sign of x(t) and has the meaning of a change ofdirection in the rotation of the cell.
Figure 4: X-component evolution as a function of time in Lorenz attractor.
Figure 5: Markov chain which refers to the Lorenz system.
0.3 A numerical example:the harmonic oscillator 7
0.3 A numerical example:
the harmonic oscillator
Due to the chaotic behaviour and long-term simulations in climatological
analysis, the accuracy of numerical approximation is no longer the main
purpose, rather the conservation of statistical properties of the physical model
becomes more significant in this context.
In nondissipative systems, the study of their own invariants, as the total
energy, plays a key role. It is known that numerical schemes may or may not
preserve the total energy of the system, even if it has a constant value. To
fix ideas, we can consider the example of the undamped harmonic oscillator
x(t) + x(t) = 0
whose exact solution is
x(t) = Asin(t− φ)
Figure 6 shows an approximation of its evolution using two numerical schemes:
the explicit, second-order Runge–Kutta method and the implicit Crank–
Nicolson scheme, on the interval [0, 200], with A = 1 and 1000 time steps.
These schemes approximate the solution with a comparable accuracy, also
because they both have the second-order of consistency. However, the differ-
ence is that an increase of energy appears in the Runge–Kutta method, due
to the expansion of oscillations, while the other method preserves energy.
The results of the simulations are represented in the histograms of the po-
sitions in fig.6, where the lowest plot shows a deformation of the histogram
obtained during Runge–Kutta simulation, hence the statistical properties of
the solutions are changed , and the change is even more dramatic on longer
time intervals.
Therefore, we can deduce that it is needful to avoid introduction or dis-
sipation of energy especially in long-term simulations. In this regard, the
symplectic integrators assume a key role due to their property of conserving
the geometric structure of the corresponding continuous system [7].
0.4 Considerations and Objectives 8
Figure 6: Histograms representing exact and two approximated solutions of the
harmonic oscillator.
0.4 Considerations and Objectives
In this first phase, we have presented a generic atmospheric model with its
intrinsic chaotic behaviour and the two main complementary strategies to
approach its simulation: meteorology and climatology. We have presented
the most famous example of simplified atmospheric model: the Lorenz sys-
tem with its main features. We also have compared a symmetric numerical
method and a non-symmetric one by means the example of the harmonic
oscillator, it was evident that only the latter has preserved energy of the
system.
The present work aims at analysing what differences, in terms of conservation
of the statistical properties of the original system, exist between numerical
schemes that do not care for conserving any geometric structure of the system
and symmetric integrators which instead preserve some geometric properties,
as reversible structure, to approximate the solutions of simplified climatolog-
ical models.
Chapter 1
Symmetric numerical methods
and Reversibility
1.1 Introduction
Since we are interested in the preservation of geometric properties of the
exact solution, it is necessary to analyze the concepts of reversibility and
symmetry of numerical schemes.
Conservative mechanical systems have the property that inverting the initial
direction of the velocity vector and keeping the initial position only inverts
the direction of motion without changing the solution trajectory. Such sys-
tems are called reversible. In this situation, it is natural to search for numer-
ical methods that produce a reversible numerical flow when they are applied
to a reversible differential equation, in order to obtain a numerical solution
with long time behaviour similar to that of the exact solution. In this con-
text, a key role is played by symmetric (or reversible) numerical methods.
In this chapter, we introduce reversible differential equations and reversible
maps and study how symmetric (or reversible) methods are related to them.
9
1.2 Reversibility of differential equations and maps 10
Notation
As usual, we study the problem
{y′ = f(t, y)y(t0) = y0
(1.1)
We denote by ϕt,f (y0) the flow of equation (1.1) which coincides with the ex-
act solution at instant t with initial condition y(t0) = y0. Numerical methods
which approximate for sufficiently small step sizes h the exact flow ϕh,f (y0),
compute numerical flow denoted by φh,f .
Really significant in the context of symmetric methods [13] is the concept of
adjoint method
Definition 1. The adjoint method φ∗h,f is the inverse of φh,f with reversed
time step −hφ∗h,f = φ−1
−h,f (1.2)
Definition 2. A numerical method φh is called symmetric [14] or time-
reversible [15] if
φh,f ◦ φ−h,f = id ⇐⇒ φh,f = φ−1−h,f ⇐⇒ φh,f = φ∗h,f (1.3)
In other words, a numerical method y1 = φh,f (y0) is symmetric if exchanging
y0 with y1 and the step h with -h leaves the method unaltered.
1.2 Reversibility of differential equations and
maps
Let us extend the above concept of reversible systems to more general situ-
ations with the following definition
Definition 3. Let ρ be an invertible linear transformation (i.e. an iso-
morphism) in the phase space of the equation y′ = f(y). This differential
equation and the vector field f(y) are called ρ-reversible if
1.2 Reversibility of differential equations and maps 11
ρf(y) = −f(ρy) ∀y ∈ Rn (1.4)
Observation 1. If the differential equation y′ = f(y) is ρ-reversible, then
the exact flow ϕt,f satisfies
ρ ◦ ϕt,f = ϕ−t,f ◦ ρ = ϕ−1t,f ◦ ρ (1.5)
We can easily prove the above equality using the group property
ϕt+s,f = ϕt,f ◦ ϕs,f
for the right identity and as all expressions of (1.5) satisfy the same differen-
tial equation with the same initial value, we have
d
dt(ρ ◦ ϕt,f ) = ρf(ϕt,f ) = −f
((ρ ◦ ϕt,f )
)
d
dt(ϕ−t,f ◦ ρ) = −f(ϕ−t,f ◦ ρ)
for the left one.
The following notion derives from property (1.5).
Definition 4. If
ρ ◦ φ = φ−1 ◦ ρ
then the map φ is called ρ-reversible.
Example. Hamiltonian systems defined as
y′ =dH
dz(y, z)
z′ = −dHdy
(y, z)
where H(p, q) is an Hamiltonian function satisfying H(y,−z) = H(y, z), are
ρ-reversible for ρ(y, z) = (y,−z).
1.2 Reversibility of differential equations and maps 12
We can see that the ρ-reversibility of a numerical one-step method is closely
related to the concept of symmetry:
Definition 5. If a numerical method φh,f , applied to a ρ-reversible ordinary
differential equation, satisfies
ρ ◦ φh,f = φ−1h,f ◦ ρ, (1.6)
then it is called ρ-reversible.
Theorem 1.1. If a numerical method, applied to a ρ-reversible differential
equation, satisfies the condition
ρ ◦ φh,f = φ−h,f ◦ ρ, (1.7)
then the numerical flow computed by using this method is a ρ-reversible map
if and only if φh,f is a symmetric method.
Proof. From condition (1.7), derives that the numerical flow φh,f is ρ-
reversible if and only if
φ−h,f ◦ ρ = φ−h,f ◦ ρMoreover ρ is an invertible transformation, so this is equivalent to the sym-
metry of the method φh,f .
2
Besides, if (1.7) holds for an invertible ρ, then method φh,f is ρ-reversible if
and only if it is symmetric.
Compared to the symmetry of the method, relation (1.7) is more weak. Since
it is automatically satisfied by most numerical methods, symmetry is the
required property for numerical methods to share with the exact flow not
only time-reversibility but also ρ-reversibility. This tells us that a symmetric
method preserves geometric properties of the exact flow.
1.3 Symmetry and Reversibility for Runge Kutta Methods 13
1.3 Symmetry and Reversibility for Runge
Kutta Methods
An example of numerical methods which satisfies condition (1.7) is the class
of Runge Kutta methods, as showed in the observation below.
Observation 2. Runge Kutta methods (explicit or implicit) satisfy (1.7)
without any restriction other than the ρ-reversibility of the vector field f
[16].
Proof. Let us give below the proof with the explicit Euler method φh,f (y0) =
y0 + hf(y0):
(ρ ◦ φh,f )(y0) = ρy0 + hρf(y0) = ρy0 − hf(ρy0) = φ−h,f (ρy0).
Let us give below an alternative definition of q-stages Runge Kutta methods
[17] that will be useful later:
Definition 6. Let bi, aij for i, j = 1, . . . , q be real numbers and let ci =∑q
j=1 aij. Then a q-stage RungeKutta method is given by
y1 = y0 + h
q∑
i=1
biki (1.8)
where ki is given by
ki = f(t0 + cih, y0 + h
q∑
j=1
aijkj
)∀i = 1, . . . , q (1.9)
Let us illustrate a characterization of symmetric methods of Runge Kutta
type:
Theorem 1.2. The adjoint method of a q-stage Runge Kutta method is again
a q-stage Runge Kutta method. Its coefficients are given by
1.4 Symmetry and Reversibility for Multistep Methods 14
a∗ij = bq+1−j − aq+1−i,q+1−j, b∗i = bq+1−i (1.10)
If its coefficients satisfy
aq+1−i,q+1−j + aij = bj ∀i, j (1.11)
then the Runge Kutta method defined by (1.8) is symmetric.
Proof. If we exchange y0 with y1 and h with -h in the Runge Kutta definition,
we obtain
ki = f(y0 + h
q∑
j=i
(bj − aij)kj), y1 = y0 + h
q∑
i=1
biki. (1.12)
If we also substitute ki by ks+1−i in (1.12), as the values∑
j = 1q(bj − aij) =
1−ci appear in reverse order, and so we replace all indices i and j by s+1− iand s+ 1− j, respectively. Then it shows (1.10).
Finally, relation (1.11) implies a∗ij = aij and b∗i = bi, so that φh,f∗ = φh,f .
2
Observation 3. We can note that explicit Runge Kutta methods cannot
satisfy condition (1.11) with i = j and so it is easy to show that no explicit
Runge Kutta can be symmetric.
1.4 Symmetry and Reversibility for Multi-
step Methods
In order to make the following concept more intuitive, we adopt here an
alternative notation for the multistep methods.
1.4 Symmetry and Reversibility for Multistep Methods 15
Definition 7. let aj, bj, real numbers, p ∈ N, p > 1. A linear p-step method
is defined by the formula
p∑
j=0
ajuk+j = h
p∑
j=0
bjf(uk+j) (1.13)
where a, b also satisfy the conditions a 6= 0 and a0 + b0 > 0. Then we can
derive recursively the approximation uk to uk+1 for k ≥ p from (1.13) only if
approximations u1, . . . up−1 are previously provided with the initial condition
u0.
We can still consider the polynomials
ρ(ζ) =
p∑
j=0
ajζj (1.14)
σ(ζ) =
p∑
j=0
bjζj (1.15)
Definition 8. A p-step scheme (1.13) is called symmetric if its coefficients
aj, bj satisfy
ap−j = −aj, bp−j = bj ∀j (1.16)
The above definition implies that for every zero ζ di ρ(ζ), its inverse ζ−1 is
still a zero. Therefore, if the method is also stable, all zeros of ρ(ζ) are simple
and lie on the unit circle.
Chapter 2
Numerical Tests
2.1 Introduction
In order to show the impact of different numerical methods on the preserva-
tion of the statistical properties of simplified climatological methods, we have
chosen to approximate the Lorenz system, which represents a very simplified
mathematical model for atmospheric convection, applying to it different nu-
merical schemes. We also have applied the same methods to the problem of
harmonic oscillator, in order to establish a connection with what was anal-
ysed in the previous chapter. Both problems considered have a Hamiltonian
formulation but, while the harmonic oscillator preserves energy, the Lorenz
system contains both forcing and dissipative terms.
In both cases we have applied one method of order one: explicit Euler
method, which represents the worst case; then four methods of order two:
explicit and implicit midpoint, Crank Nicolson and 2-stage Runge Kutta
method; finally one method of order four: 4-stage Runge Kutta. Whereas
Simpson method has been applied only to harmonic oscillator, as in the
Lorenz system there is a hidden dissipation term that brings out the approx-
imated solution of its region of stability, and therefore it makes impossible
for it to work well in long time simulations.
Among the above schemes, symmetric ones are explicit midpoint, Crank
16
2.2 Test for the harmonic oscillator 17
Nicolson and Simpson, implicit midpont, while non-symmetric are explicit
Euler method, 2-stage Runge Kutta and 4-stage methods.
We have considered time interval: [0, 1000] and different step sizes h ∈{0.5, 0.025, 0.0125, 0.00625} and focused in comparing the results obtained
with symmetric methods and non-symmetric ones varying the discretization
step size h. It is noteworthy that explicit Euler method doesn’t work well
with the biggest step size h = 0.05, as its small order of convergence, so we
have not reported values obtained in this particular case.
2.2 Test for the harmonic oscillator
2.2.1 Procedure
We are interested in comparing the results obtained varying the step size h
with regard to the positions of the oscillator. For this purpose, we have create
a normalized histogram for the positions of the approximated trajectory,
erected over discrete subintervals of equal length, equal to 0.1 of the interval
[−2, 2]. Hence, we have stored the ordinates of the histogram in the vector
fh, calculated using one of the aforementioned methods with a step size h.
Finally, we have compared results obtained with a step size h with those ones
obtained with the step size h/2, computing the differences ||fh− fh/2||. This
difference lead us to consider a sort of order of accuracy derived by the below
argument.
Let us set a step size h and consider f := hist obtained with the exact
solution, fh := histh obtained applying the scheme with step size h, such as
fh2
:= histh/2, f2h := hist2h. We can write
||fh − f || ≈ Chα (2.1)
then α is order of accuracy of the applied method, and C is a constant.
Similarly, we can also write
2.2 Test for the harmonic oscillator 18
||f2h − f || ≈ C2αhα (2.2)
||fh2− f || ≈ C
hα
2α. (2.3)
By substracting (2.2) to (2.1) and (2.1) to (2.3), we respectively get
||fh − f2h|| ≈ C(hα − 2αhα) = C(1− 2α)hα (2.4)
||fh2− fh|| ≈ C
(hα2α− hα
)= C
( 1
2α− 1)hα. (2.5)
Finally, if we consider ratio between (2.4) and (2.5), we obtain
||fh − f2h||||fh
2− fh||
≈ 1− 2α
12α− 1
= 2α
then order α is given by
α ' log2
( ||fh − f2h||||fh
2− fh||
)=
1
ln 2ln( ||fh − f2h||||fh
2− fh||
)(2.6)
where we have chosen 1-norm as norm || · ||.
2.2.2 Results
Results obtained performing the above procedure to the problem of harmonic
oscillator are listed in the tables below. It is noteworthy that, in this particu-
lar case, Crank Nicolson and Implicit midpoint method give the same results.
Explicit Euler Method
h1 h2 ||fh1 − fh2||10.025 0.0125 0.2165380.0125 0.00625 0.401469
Implicit Midpoint / Crank Nicolson Methods
h1 h2 ||fh1 − fh2||10.05 0.025 0.0006250.025 0.0125 0.0006370.0125 0.00625 0.000169
2.2 Test for the harmonic oscillator 19
Explicit Midpoint Method
h1 h2 ||fh1 − fh2||10.05 0.025 0.0038250.025 0.0125 0.0006380.0125 0.00625 0.000294
2-stage Runge Kutta Method
h1 h2 ||fh1 − fh2||10.05 0.025 0.0251250.025 0.0125 0.0033870.0125 0.00625 0.000606
4-stage Runge Kutta Method
h1 h2 ||fh1 − fh2||10.05 0.025 0.0065750.025 0.0125 0.0006380.0125 0.00625 0.000244
Simpson Method
h1 h2 ||fh1 − fh2||10.05 0.025 0.0067250.025 0.0125 0.0006130.0125 0.00625 0.000244
Finally, for the order α of accuracy given by the expression
log2
||fh − f2h||||fh
2− fh||
where h = 0.0125, we get
Method α
Explicit Euler 0.8907Implicit Midpoint 1.9143Explicit Midpoint 2.1701
2-stage Runge Kutta 2.4826Crank Nicolson 1.9143
4-stage Runge Kutta 1.3867Simpson 1.3290
2.2 Test for the harmonic oscillator 20
Let us give below histograms for the positions of the approximated trajectory
of the harmonic oscillator, in order to compare the dependency on the step
size h of a symmetric scheme, such as Crank Nicolson, with a non-symmetric
one, such as Runge Kutta (see fig.2.1).
Results obtained by the procedure described above show that, using these
step sizes, Euler method provides unreliable results. On the other hand,
among the second-order schemes, the symmetric ones have a higher accuracy
for long steps, with an advantage of the one-step methods. Finally, fourth-
order methods give comparable results, and in this particular case it seems
to have more relevance the order of consistency that the reversibility of the
method.
2.2 Test for the harmonic oscillator 21
−2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.50
0.02
0.04
0.06
0.08
0.1
0.12
−2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.50
0.02
0.04
0.06
0.08
0.1
0.12
−2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.50
0.02
0.04
0.06
0.08
0.1
0.12
−2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.50
0.02
0.04
0.06
0.08
0.1
0.12
−2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.50
0.02
0.04
0.06
0.08
0.1
0.12
−2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.50
0.02
0.04
0.06
0.08
0.1
0.12
−2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.50
0.02
0.04
0.06
0.08
0.1
0.12
−2.5 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.50
0.02
0.04
0.06
0.08
0.1
0.12
Figure 2.1: Histograms for the positions of harmonic oscillator obtained using 2-
stage Runge Kutta method (left), Crank Nicolson method (right), with decreasing
step size h (from top to bottom).
2.3 Test for the Lorenz system 22’../lorenz/lorenz_attractor’
-20 -15 -10 -5 0 5 10 15 20 -25-20
-15-10
-50
510
1520
25
05101520253035404550
Figure 2.2: Lorenz attractor.
2.3 Test for the Lorenz system
In this more complex case, we have studied the problem
x′(t) = σ(y − x)y′(t) = ρx− xz − yz′(t) = xy − βz
setting σ = 10, β = 83
and ρ = 28, initial condition (x(0), y(0), z(0)) =
(−11.3360,−16.0335, 24.4450), whose plot is the famous Lorenz attractor
[3], which resembles a butterfly, showed in fig.2.2.
We have focused in comparing the results obtained with symmetric methods
and non-symmetric ones varying the discretization step size h, especially with
regard to the conservation of the times of switching between one lobe and
the other one of the attractor. This passage corresponds to the sign change
of x variable, which physically means that the fluid particle has reversed the
direction of rotation, from anti-clockwise to clockwise and vice versa. We are
also interested, as well as in the case of the harmonic oscillator, in considering
histograms for positions of the approximated solution. In particular, we have
2.3 Test for the Lorenz system 23
created histograms for the first two coordinates, x and y.
2.3.1 Procedure
• Holding time
In this case, we are interested in the calculation of the order of accu-
racy, defined in the previous section, for the holding time in one of the
two lobes for each numerical scheme cited above. For this purpose, we
have computed instant t in which x variable has changed its time by
interpolating the first component of the solution between two consecu-
tive iterations.
In other words, at each step k at which x variable changes its sign, we
derive instant t by considering
x− uk =uk+1 − uk
h(t− kh)
where uk is the first component of the approximated solution at the
iteration k. By setting x = 0 (i.e. we are considering the solution on
the plane {x = 0}), we get
−uk =uk+1 − uk
h(t− kh)
t = kh− hukuk+1 − uk
At this point, we can store all instants t in [0, 1000] at which vari-
able x changes its sign, then calculate array timeIntervalsh, depend-
ing on h and containing the difference values between two consecu-
tive instants. Moreover, we display the distribution of values stored in
timeIntervalsh in a normalized histogram erected over discrete subin-
tervals of equal length, equal to 0.1 of the interval [0, 10].
We perform this procedure first with a step size h1 then with h2 and
2.3 Test for the Lorenz system 24
compare the two histograms obtained, seen as vectors of their own or-
dinates (denoted respectively by fh1 := histh1 and fh2 = histh2 ), com-
puting an other array which contains difference values between them.
Finally, we can consider its 1−norm which corresponds to the order of
accuracy for the holding time.
• Positions
As stated above, we have calculated also a sort of two-dimensional
histogram, seen as a two-dimensional matrix P whose generic item is
given by
|Pij| = #{
(x, y, z) = u(t) : i− 1 < |x| < i, j − 1 < |y| < j}
where u(t) is the approximated solution at instant t. In other words,
we are considering a grid made up of cells of dimension 1 × 1 in
[−xmin, xmax] × [−ymin, ymax], and counting how many points (x, y)
there are in each cell, storing these amounts in the matrix P . We
repeat this procedure for each step size h, then we normalize the re-
sults obtained and compute norm of the matrix (Ph1 − Ph2).It is noteworthy that, in order to keep track of each aforementioned
amount for the positions of (x, y), we need to store four matrices de-
pending on size step h and on sign of x and y:
Pij = #{
(x, y, z) = u(t) : i− 1 < x < i, j − 1 < y < j, x, y ≥ 0}
PNij = #{
(x, y, z) = u(t) : i− 1 < x < i, j − 1 < |y| < j, x ≥ 0, y < 0}
NPij = #{
(x, y, z) = u(t) : i− 1 < |x| < i, j − 1 < y < j, x < 0, y ≥ 0}
Nij = #{
(x, y, z) = u(t) : i− 1 < |x| < i, j − 1 < |y| < j, x, y < 0}.
and suppose Ph = P obtained with the time step h.
2.3 Test for the Lorenz system 25
Finally, we have computed
||fh1−fh2 || := ||Ph1−Ph2||+||PNh1−PNh2||+||NPh1−NPh2 ||+||Nh1−Nh2||
which gives us the notion of order of accuracy for the positions of the
solution in the plane {z = 0}.
2.3.2 Results
• Results obtained with regard to the holding time, applying the above
procedure to each method, are listed in the following tables
Explicit Euler Method
h1 h2 ||fh1 − fh2||10.025 0.0125 1.25190.0125 0.00625 0.6168
Implicit Midpoint Method
h1 h2 ||fh1 − fh2||10.05 0.025 0.55130.025 0.0125 0.25270.0125 0.00625 0.2610
Explicit Midpoint Method
h1 h2 ||fh1 − fh2||10.05 0.025 1.63180.025 0.0125 0.31560.0125 0.00625 0.1940
2-stage Runge Kutta Method
h1 h2 ||fh1 − fh2||10.05 0.025 1.60200.025 0.0125 0.20770.0125 0.00625 0.2515
Crank Nicolson Method
h1 h2 ||fh1 − fh2||10.05 0.025 0.43990.025 0.0125 0.21840.0125 0.00625 0.1792
2.3 Test for the Lorenz system 26
4-stage Runge Kutta Method
h1 h2 ||fh1 − fh2||10.05 0.025 0.22130.025 0.0125 0.23910.0125 0.00625 0.2843
Finally, for the order α of accuracy given by the expression
log2
||fh − f2h||||fh
2− fh||
where h = 0.0125, we get
Method α
Explicit Euler 1.0212Implicit Midpoint 0.0466Explicit Midpoint 0.7020
2-stage Runge Kutta 0.2761Crank Nicolson 0.2854
4-stage Runge Kutta 0.2498
We give below histograms showing the most significant comparison: 2-stage
Runge Kutta with Crank Nicolson methods (see fig.2.3). It is noteworthy
that the frequency peaks of the histogram correspond to different amount of
cycles that the system performs on a single lobe of the attractor.
2.3 Test for the Lorenz system 27
−2 0 2 4 6 8 10 120
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
−2 0 2 4 6 8 10 120
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
−2 0 2 4 6 8 10 120
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
−2 0 2 4 6 8 10 120
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
−2 0 2 4 6 8 10 120
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
−2 0 2 4 6 8 10 120
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
−2 0 2 4 6 8 10 120
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
−2 0 2 4 6 8 10 120
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
Figure 2.3: Histograms for holding time of the Lorenz attractor obtained using 2-
stage Runge Kutta method (left), Crank Nicolson method (right), with decreasing
step size h (from top to bottom).
2.3 Test for the Lorenz system 28
• Results obtained with regard to the grid of positions for the first two
coordinates x, y are listed in the below tables.
Explicit Euler Method
h1 h2 ||fh1 − fh2||0.025 0.0125 0.26030.0125 0.00625 0.3595
Implicit Midpoint Method
h1 h2 ||fh1 − fh2||0.05 0.025 0.18410.025 0.0125 0.15740.0125 0.00625 0.0974
Explicit Midpoint Method
h1 h2 ||fh1 − fh2||0.05 0.025 0.64290.025 0.0125 0.11090.0125 0.00625 0.0996
2-stage Runge Kutta Method
h1 h2 ||fh1 − fh2||0.05 0.025 0.66430.025 0.0125 0.15810.0125 0.00625 0.1526
Crank Nicolson Method
h1 h2 ||fh1 − fh2||0.05 0.025 0.17680.025 0.0125 0.12720.0125 0.00625 0.0717
4-stage Runge Kutta Method
h1 h2 ||fh1 − fh2||0.05 0.025 0.13860.025 0.0125 0.11470.0125 0.00625 0.1506
2.4 Final considerations 29
Finally, for the order α of accuracy given by the expression
log2
||fh − f2h||||fh
2− fh||
where h = 0.0125, we get
Method α
Explicit Euler 0.4658Implicit Midpoint 0.69244Explicit Midpoint 0.1550
2-stage Runge Kutta 0.0511Crank Nicolson 0.8271
4-stage Runge Kutta 0.3929
Let us give below bidimensional histograms obtained by application of 2-
stage Runge Kutta and Crank Nicolson methods. They show matrix P , and
their frequency peaks correspond to the amount of times in which numerical
trajectory, projected onto the portion of the plane {(x, y, z) = u(t) : z =
0, x, y > 0}, passes in that specific cell (see fig.2.4).
2.4 Final considerations
Results obtained by the procedure described below show that, in the case of
the Lorenz system, we can draw conclusions similar to the case of the oscil-
lator, but with a more critical behaviour of reversible multistep methods. In
any case, it seems that the effect of the geometric integration is to be seen
mainly in the greater precision achievable on long time simulations.
This supports the idea that it can be preferable the application of geometric
integrators to real climatological models, in order to obtain numerical mod-
els with good statistical properties, using relatively inaccurate step size. It
means that we can achieve a saving in terms of computational complexity.
2.4 Final considerations 30
010
2030
0
10
20
300
0.002
0.004
0.006
0.008
0.01
0.012
010
2030
0
10
20
300
0.005
0.01
0.015
0.02
010
2030
0
10
20
300
0.005
0.01
0.015
0.02
010
2030
0
10
20
300
0.005
0.01
0.015
0.02
010
2030
0
10
20
300
0.005
0.01
0.015
0.02
010
2030
0
10
20
300
0.005
0.01
0.015
0.02
010
2030
0
10
20
300
0.005
0.01
0.015
0.02
010
2030
0
10
20
300
0.005
0.01
0.015
0.02
Figure 2.4: Histograms for the position of the numerical trajectory projected
onto the portion of plane {z = 0 : x, y > 0}, obtained using 2-stage Runge Kutta
method (left), Crank Nicolson method (right), with decreasing step size h (from
top to bottom).
Bibliography
[1] F. Bonghi, R. Ferretti, Extracting information from chaos: a case in
climatological analysis, published in ”Imagine Math2 ”, proceedings of
the conference ”Matematica e Cultura 2012”, Venezia, 2012.
[2] S. H. Kellert, In the Wake of Chaos: Unpredictable Order in Dynamical
Systems. University of Chicago Press, (1993).
[3] E. N. Lorenz, Deterministic Nonperiodic Flow, J. Atmos. Sci. 20, (1963).
[4] M. Crouzeix, A. L. Mignot, Analyse Num erique des equations differen-
tielles, Masson.
[5] S. M. Ross, Calcolo delle probabilita, Apogeo, 2008.
[6] C. W. Gear, Numerical Initial Value Problems in ordinary differential
equations, PrenticeHall.
[7] E. Hairer, Numerical Geometric Integration, (1999).
[8] Milne, W. E., Numerical integration of ordinary differential equations,
American Mathematical Monthly, (1926).
[9] Butcher, John C., Numerical Methods for Ordinary Differential Equa-
tions, John Wiley, (2003).
[10] Dahlquist G., Convergence and stability in the numerical integration of
ordinary differential equations, Math. Scand. 4 (1956).
31
Bibliography 32
[11] Hairer, Ernst; Nørsett, Syvert Paul; Wanner, Gerhard, Solving ordinary
differential equations I: Nonstiff problems, (1993).
[12] Hairer E., Lubich C., Wanner G., Geometric Numerical Integration.
Structure-Preserving Algorithms for Ordinary Differential Equations,
Springer, (2006).
[13] Hammer P.C., Hollingsworth J. W., Trapezoidal methods of approximat-
ing solutions of differential equations, MTAC 9, (1955).
[14] Gragg W. B., Repeated extrapolation to the limit in the numerical so-
lution of ordinary differential equations, Thesis, Univ. of California,
(1965).
[15] Buneman O., Time-reversible difference procedures, J. Comput. Physics
1, (1967).
[16] D. Stoffer, On reversible and canonical integration methods, SAM-
Report No. 88-05, ETH-Zurich, (1988).
[17] Butcher J.C., Coefficients for the study of RungeKutta integration pro-
cesses, J. Austral. Math. Soc 3, (1963).
top related