Establishing a particular solution of the derivative...

7
Science Professor : PhD Mathieu Colin, INRIA laboratory, Bordeaux Establishing a particular solution of the derivative nonlinear Schr dinger equation Monday 13 th April, 2015 Laurent BARRAUD ([email protected]) Alexandre FAVRY ([email protected]) ENSEIRB-MATMECA, Graduate School of Engineering Bordeaux Institute of Technology, Department of Mathematics and Mechanical

Transcript of Establishing a particular solution of the derivative...

Page 1: Establishing a particular solution of the derivative ...labarraud.com/fichier/terdnls-eng.pdfEstablishing a particular solution of the derivative nonlinear Schrödinger equation Monday13th

Science Professor : PhD Mathieu Colin, INRIA laboratory, Bordeaux

Establishing a particular solution of thederivative nonlinear Schrödinger equation

Monday 13th April, 2015

Laurent BARRAUD([email protected])

Alexandre FAVRY([email protected])

ENSEIRB-MATMECA, Graduate School of Engineering

Bordeaux Institute of Technology, Department of Mathematics and Mechanical

Page 2: Establishing a particular solution of the derivative ...labarraud.com/fichier/terdnls-eng.pdfEstablishing a particular solution of the derivative nonlinear Schrödinger equation Monday13th

Establishing a Particular Solution of the Derivative Nonlinear Schrodinger Equation

Contents1 Establishing a standing equation and discretisation method 2

1.1 Standing equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Space discretisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Approaching the standing solution 32.1 Resolution of this equation with one step methods . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.1.1 Explicit Euler method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.1.2 Implicit Euler method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.1.3 Runge-Kutta 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.2 Resolution of this equation with multi-step methods . . . . . . . . . . . . . . . . . . . . . . . . . 32.2.1 Adams Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.2.2 Adams-Moulton Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3 Fortran program architecture 43.1 Brief description of each module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43.2 Global interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

4 Comparison of several methods 54.1 Comparison between exact and approached solutions . . . . . . . . . . . . . . . . . . . . . . . . . 54.2 Comparing the errors of each method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Bordeaux Institute of Technology 1 Laurent Barraud - Alexandre Favry

Page 3: Establishing a particular solution of the derivative ...labarraud.com/fichier/terdnls-eng.pdfEstablishing a particular solution of the derivative nonlinear Schrödinger equation Monday13th

Establishing a Particular Solution of the Derivative Nonlinear Schrodinger Equation

IntroductionThe derivative nonlinear Schrödinger equation (1) (DNLS) occurs in the plasma physics in order to model thespreading of waves in the environment[1]. This equation presents particular solutions which model solitary wavesand take an important place in plasma physics . These solutions are time-independent and bring informationabout dynamics of this equation.{

i∂tu+ ∂2xu+ i∂x

(|u|2u

)= 0 with(t, x) ∈ R+ × R

u(0, x) = u0(x)(1)

The first step of this study is establishing a standing equation which permits the use of single and severalstep methods. Then, applying these methods will allow an approximation to the solution of this equation to befound. These solutions have to be compared with an exact known solution. The errors between the differentmethods used permit the user to chose the best one. Moreover, these errors bring the order of the method whichshow the precision of the latter. The Fortran language is used to program these methods in order to computethe approximate solutions.

1 Establishing a standing equation and discretisation method

1.1 Standing equationThe aim of this study is to introduce a particular known solution (2) in the DNLS equation (1) and to obtain aneasier equation. This form of solution is typical when resolving the type of equation (1), it is used in reference[1].

u(t, x) = φw,c(x− ct) · exp

(i

(ωt+

c

2(x− ct)− 3

4

∫ x−ct

−∞|φw,c(η)|2 dη

))(2)

The final differential equation (3) is obtained by differentiating the function with respect to each variableas the DNLS implies. It is a nonlinear second order differential equation with respect to the space and timevariables x and t where φ is the unknown function.

φ′′

w,c(x− ct)−(ω − c2

4

)φw,c(x− ct)−

c

2|φw,c(x− ct)|2φw,c(x− ct) +

3

16|φw,c(x− ct)|4φw,c(x− ct) = 0 (3)

At first, the value of time t is zero. φw,c(x) is now written φ(x) in order to simplify the notation. Appliedin equation (3), it brings the following standing equation (4):

φ′′(x)−

(ω − c2

4

)φ(x)− c

2|φ(x)|2φ(x) +

3

16|φ(x)|4φ(x) = 0 (4)

This standing nonlinear equation (4) has an analytic solution (5) described in reference [1]. From now on,this function will be written φexact.

φexact(x) =

( √ω

4ω − c2

(cosh

(√4ω − c2 · x

)− c

2√ω

))−1/2(5)

1.2 Space discretisationThe means to approach the solution is cutting the space interval [x1, .., xn, ..., xN ] into N points. Each point isseparated by a defined step h.

φn = φ(xn) (6)

Moreover, yn is defined as a vector. φ′ is the derivative of φn with respect to the space variable x:

yn =

(φn

φ′n

)(7)

Bordeaux Institute of Technology 2 Laurent Barraud - Alexandre Favry

Page 4: Establishing a particular solution of the derivative ...labarraud.com/fichier/terdnls-eng.pdfEstablishing a particular solution of the derivative nonlinear Schrödinger equation Monday13th

Establishing a Particular Solution of the Derivative Nonlinear Schrodinger Equation

The first vector y1 is defined as an initial condition. This vector permits the following methods to beinitialized. All the approaching methods established from this point will use the following vectorial function.This function is defined as the derivative of yn:

f(yn) = y′n =

(φn

φ′n

)′=

(φ′n

φ′′n

)=

(φ′n(

ω − c2

4

)φn + c

2 |φn|2φn − 3

16 |φn|4φn

)(8)

The method order p is defined by the formula (9). The higher a method order is the faster the error decreases.

‖φn − φexact(xn)‖ ≤ Chp (9)

2 Approaching the standing solutionAll the following formulas feature in the reference [2] and fn = f(yn) = y′n.

2.1 Resolution of this equation with one step methods2.1.1 Explicit Euler method

The explicit Euler method is derived from first order of Taylor’s development where an initial value is considered.Each next value is obtained by the following schema:

yn+1 = yn + h · fn (10)

2.1.2 Implicit Euler method

The implicit Euler method is based on the explicit schema but it uses the derivative number of the calculatedpoint:

yn+1 = yn + h · fn+1 (11)

yn+1 is needed to obtain fn+1 so this term is calculated with the explicit Euler method (10). Then yn+1 isobtained by the implicit Euler method (11). This method is also called the backward Euler method: the firststep presages yn+1 and the second corrects it.

2.1.3 Runge-Kutta 4

In this method (12) each term has to be calculated in the following order k1, k2 and k3 thanks to the functionf , the step h and the vector yn because each term uses the previous term.

k1 = fn = f(yn)

k2 = f

(yn +

h

3· k1)

k3 = f

(yn +

2h

3· k2) (12)

Then, yn+1 is calculated through the previous terms and the function f as the formula (13) shows. Thismethod has the advantage of being a 4-order-single-stepped-method.

yn+1 = yn +h

4· k1 +

3h

4· k3 (13)

2.2 Resolution of this equation with multi-step methodsThis following part brings two multi-step methods which are the implicit and the explicit 4-order multi-stepAdams method.

Bordeaux Institute of Technology 3 Laurent Barraud - Alexandre Favry

Page 5: Establishing a particular solution of the derivative ...labarraud.com/fichier/terdnls-eng.pdfEstablishing a particular solution of the derivative nonlinear Schrödinger equation Monday13th

Establishing a Particular Solution of the Derivative Nonlinear Schrodinger Equation

2.2.1 Adams Method

This method needs four initial vectors, y1, y2, y3 and y4. These vectors can be obtained using a one step methodsuch as Runge-Kutta 4 which permits the method to keep a 4 order.

yn = yn−1 +h

24(55fn−1 − 59fn−2 + 37fn−3 − 9fn−4) (14)

These multi-step Adams methods have the advantage of using more previous vectors which improves theprecision.

2.2.2 Adams-Moulton Method

The 4-order Adams-Moulton method is an implicit method. A backward schema is used as the case of theimplicit Euler method. yn+1 is predicted with the 4-order explicit Adams method (14). Then, the term iscorrected thanks to the 4-order implicit Adams method (15). This method is more accurate than the 4-orderexplicit Adams method.

yn = yn−1 +h

24(fn−3 − 5fn−2 + 19fn−1 + 9fn) (15)

3 Fortran program architectureThe language used to compute the solution of the differential equation (5) is the Fortran (FORmula TRANslatingsystem). It permits the user to calculate the approached solutions using the previous methods.

3.1 Brief description of each moduleThe FORTRAN program constitutes of seven module : main, create_table, exact, equation, resolve, error,writefile.

The module create_table is composed of the subroutine the create_table_step which create a table ofreal number. The array goes from a to b with a step of h. a, b and h are the arguments of the subroutine.

The module exact contains the function phi_exact which calculate φexact(x) defined by (5) with x, ω andc given. Moreover it calculates Dphi_exact the derivative function φ′(x) with the same arguments.

The module equation which contains the subroutine fonct calculates the vector f(yn) knowing the vectoryn, ω and c.

The module resolve which contains the subroutines expliciteEuler, impliciteEuler, RK4, Adams4 andAdams4cor calculates yn+1 according to each quoted method with yn, h, ω and c given.

The module error which contains the funcions euclidean_norm and infinity_norme calculates respectivelythe Euclean and infinity norms using a known vector. This module contains the subroutines error_expliciteEuler,error_impliciteEuler, error_RK4, error_Adams4 and error_Adams4cor. The two relative errors (16) and(17) between exact and approached solutions for each method with h given are permitted to calculate by thesefunctions.

3.2 Global interactionFigure 1 shows the dependence between the Fortran program modules. It shows the logical succession of themodule compilation and the main into the executable ter. Then, the execution of this executable creates datafiles.

Bordeaux Institute of Technology 4 Laurent Barraud - Alexandre Favry

Page 6: Establishing a particular solution of the derivative ...labarraud.com/fichier/terdnls-eng.pdfEstablishing a particular solution of the derivative nonlinear Schrödinger equation Monday13th

Establishing a Particular Solution of the Derivative Nonlinear Schrodinger Equation

Figure 1: Fortran program architecture

4 Comparison of several methodsEvery data file obtained by the execution of the Fortran program are represented in figures 2 and 3. Thesegraphs are obtained with the software Gnuplot.

4.1 Comparison between exact and approached solutions

0.5

1

1.5

2

2.5

3

3.5

4

4.5

-0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8

Phi

x

’result/Euler_e.dat’’result/Euler_i.dat’

’result/RK4.dat’’result/Adam4.dat’

’result/Adam4cor.dat’’result/exact.dat’

Figure 2: Φ depending on x, exact and approximate method

The black curve represents the actual function (5) while the others represent the approached solutions. Thefunction (5) is symmetric. It rose from 0.75 to 3.75 units which was its maximum and then decreased to 0.75.As expected, the worse approximation of the solution is obtained by the explicit Euler method and the bestcurves are obtained by Runge-Kutta and Adams-Moulton.

4.2 Comparing the errors of each methodThe error between approximate and exact solutions is given by the Euclidean (16) and infinity (17) norm. Thestep included in the formula implies calculating the relative error.

Bordeaux Institute of Technology 5 Laurent Barraud - Alexandre Favry

Page 7: Establishing a particular solution of the derivative ...labarraud.com/fichier/terdnls-eng.pdfEstablishing a particular solution of the derivative nonlinear Schrödinger equation Monday13th

Establishing a Particular Solution of the Derivative Nonlinear Schrodinger Equation

Error with euclidean norm:

ε2 =‖φexact − φaprox‖2‖φexact‖2

=

√∑Nn=1(φnexact − φnaprox)2√∑N

n=1(φnexact)2

(16)

Error with Infinity norm:

ε∞ =‖φexact − φaprox‖∞‖φexact‖∞

=max1≤n≤N |φnexact − φnaprox|

max1≤n≤N |φnexact|(17)

1e-20

1e-18

1e-16

1e-14

1e-12

1e-10

1e-08

1e-06

0.0001

0.01

1

1e-05 0.0001 0.001 0.01 0.1

err

or

with

eu

clid

ea

n n

orm

step h

’result/error_euler_norme2.dat’Eeulern2(x) = 1.19x + 3.14

’result/error_euleri_norme2.dat’Eeulerin2(x) = 0.87x + 1.17

’result/error_RK4_norme2.dat’ERK4n2(x) = 4.06x + 4.70

’result/error_Adam4_norme2.dat’EAdam4n2(x) = 4.14x + 9.11

’result/error_Adam4cor_norme2.dat’EAdam4corn2(x) = 4.10x + 6.82

(a) With euclidean norm

1e-20

1e-18

1e-16

1e-14

1e-12

1e-10

1e-08

1e-06

0.0001

0.01

1

100

1e-05 0.0001 0.001 0.01 0.1

err

or

with

in

fin

ity n

orm

step h

’result/error_euler_nf.dat’Eeulernf(x) = 1.17x + 3.71’result/error_euleri_nf.dat’

Eeulerinf(x) = 0.84x + 1.71’result/error_RK4_nf.dat’

ERK4nf(x) = 4.07x + 4.91’result/error_Adam4_nf.dat’

EAdam4nf(x) = 4.19x + 9.64’result/error_Adam4cor_nf.dat’

EAdam4cornf(x) = 4.20x + 7.73

(b) With infinity norm

Figure 3: Error ε between exact and approximate solution for different method depending on step h

At first sight, figure 3 shows the equivalence between the two norms since the graphs of the figures 3a and3b are similar. Moreover the graphs show that implicit methods are more accurate than explicit methods. Theerrors reach the minimum 10−14 which is due to machine epsilon: the computer cannot give a lower error inFortran.

As it can be seen in the figures 3a and 3b, the theoretical orders are respected. The best method is Runge-Kutta-4.

ConclusionThe first step of this study was to choose an adapted solution structure. The second step, a particular solutionpermitted a time-independant equation to be established which can be solved by known methods. Implementingthese methods in Fortran allowed this language to be familiarized. By comparing the different method errorswe could choose the most adapted method in order to pursue our study. The remaining work will consist inconsidering the time variable using the Crank-Nicholson method.

References[1] Mathieu Colin. Etude de quelques problèmes issus de la physique des plasmas et de la mécanique des fluides.

PhD thesis, Université Sciences et Technologies-Bordeaux I, 2011.

[2] Rodolphe Turpault. Cours d’Analyse Numérique. ENSEIRB-MATMECA graduate School of engineering,Bordeaux Institute of Technology, Department of Mathematics and Mechanical, 2014.

Bordeaux Institute of Technology 6 Laurent Barraud - Alexandre Favry