Chapter 9
Introduction to Nonlinear
Partial Differential Equations

9.2 The Burgers Equation-An Exact Solution

Example 9.1

The solution of Burgers equation with a delta function as an initial condition is obtained most easilt by applying Plot to the expression in Equation (9.42).  We first check that this expression does in fact solve Burgers' equation:

u[x_,t_]=(2/((1/(E^(1/2)-1))+
     (1/2)Erfc[x/Sqrt[4 t]]))*
     (Exp[-x^2/(4 t)]/Sqrt[4 Pi t])

Together[D[u[x,t],t]+u[x,t]D[u[x,t],x]-
     D[u[x,t],{x,2}]]/.Sqrt[Pi t]->Sqrt[Pi]Sqrt[t]

This solution is displayed for various times with the commands shown below.  Once generated, the sequence can be animated.

Do[Plot[u[x,0.025k],{x,-3,3},PlotRange->{0,2},
     Ticks->{Automatic,Range[0,2,1]},
     AxesLabel->{x,u}],{k,1,40}]

Figure 9.2

This diagram is generated by plotting the function u[x,t] for the indicated times:

Plot[{u[x,0.08],u[x,0.2],u[x,1]},{x,-3,3},
     PlotRange->{0,1},AxesLabel->{x,u}]

9.3 Elementary Soliton Solutions

Figure 9.3

The two panels of this figure are generated by first constructing the soliton and anti-soliton solutions in (9.54) and (9.55) and then using Plot to produce the line plots. The velocity has been set equal to 1/2.

phi1[x_,t_,v_]:=4ArcTan[Exp[(x-v t)/Sqrt[1-v^2]]]

phi2[x_,t_,v_]:=4ArcCot[Exp[(x-v t)/Sqrt[1-v^2]]]

Plot[phi1[x,0,1/2],{x,-10,10},AxesLabel->{x,phi}]

Plot[phi2[x,0,1/2],{x,-10,10},AxesLabel->{x,phi}]

Solutions of the Sine-Gordon Equation (Figure 9.4)

If B≠1, other types of solution of the sine-Gordon are obtained. For example, if v>1 and |B|<1, then the integral in (9.50) can be written as in Equation (9.56). This integral can be represented in the form of phi as a function of x by introducing the Jacobi elliptic function sn: k Sin[phi/2]=sn[x,k^{-1}], or

                                   phi(x)=2 Sin^{-1}(k sn[x,k])

The quantity k is called the modulus of the elliptic function.  The motivation for notation of the Jacobi elliptic functions, as well as their various properties and interrelationships, is discussed by Whittaker and Watson (1963) and Abramowitz and Stegun (1965).

Mathematica can be used to plot the solution in Equation (9.57) and to investigate the effect of changing B and v by using the in-built function JacobiSN.  A surface plot is shown in Figure 9.4 where B is varied from 0 to 0.95 and v=1.05.  The solution is seen to be periodic, with the amplitude diminishing and the period decreasing as B increases.

The diagram in Figure 9.4 is generated by defining the function phi (or u) in terms of the in-built function JacobiSN, to which Plot3D is then applied with the stated values of the arguments.

u[xi_,v_,B_]:=2ArcSin[Sqrt[(1-B)/2]*
     JacobiSN[xi/Sqrt[v^2-1],Sqrt[(1-B)/2]]]

Plot3D[u[x,1.05,B],{x,-10,10},{B,0,0.95},
     PlotRange->{-2,2},ViewPoint->{1.0,-2.4,1.5},
     Shading->False,PlotPoints->75]

Figure 9.5

This figure is obtained by constructing the solution in (9.68) and using Plot to generate the line diagram.

u[x_,t_,v_]:=(v/2)(Sech[(1/2)Sqrt[v](x-v t)])^2

Plot[u[x,0,1],{x,-6,6},AxesLabel->{x,u}]

9.5 Nonlinear Superposition Principles

Example 9.4

There are several ways that Mathematica can be used to plot soliton solutions. The surface plot in Figure 9.6 represents the entire solution surface, but leaves some interesting aspects of the soliton interaction obscured.  The contour plot in the x-t plane in Figure 9.6 shows clearly the shift of the soliton trajectories as a result of the interaction.  This phase shift is the only memory of the interaction, since the forms of the solitons are unchanged.

The retention of the wave form of the solitons after interactions with other solitons can be seen most clearly in Figure 9.7.  Plot has been used to generate a time sequence of (9.104) before, during, and after the interaction of the solitons.  These snapshots show how the wave forms are deformed as the two solitons approach and interact, but revert to their original forms after the interaction.

The animation of the sequence of frames shown in Figure 9.7, which is readily
achieved in Mathematica, provides yet another way to visualize the soliton solution.  Animation, of course, emphasizes the dynamical nature of the solution and provides the most vivid and natural illustration of the interactions among the solitons.  Thus, Plot3D (Figure 9.6), ContourPlot (Figure 9.6), Plot (Figure 9.7) and the animation each highlight a different aspect of the soliton solution.

Figure 9.6

The nonlinear superposition principle derived for the Korteweg-de Vries equation can be used to obtain a hierarchy of solutions that contain successively greater number of solitons.

We consider first the two-soliton solution.  The regular solution, which we will denote by uReg[x,t,beta1] and the irregular solution, denoted by uIrreg[x,t,beta2], are first entered:

uReg[x_,t_,beta1_]:=(2 beta1)^(1/2)*
     Tanh[(beta1/2)^(1/2)(x-2 beta1 t)];
               
uIrreg[x_,t_,beta2_]:=(2 beta2)^(1/2)*
     Coth[(beta2/2)^(1/2)(x-2 beta2 t)]

We now use the nonlinear superposition principle for the Korteweg-de Vries equation to construct the quantity psi2[x,t,beta1,beta2]:

psi2[x_,t_,beta1_,beta2_]:=2(beta1-beta2)/
     (uReg[x,t,beta1]-uIrreg[x,t,beta2])

This expression is now differentiated once with respect to x to obtain the corresponding solution u2[x,t] of the Korteweg-de Vries equation.

u2[x_,t_,beta1_,beta2_]:=
     D[psi2[s,t,beta1,beta2],s]/.s->x

This solution can now be visualized in a number of ways.  We will set beta1=0.5 and beta2=1.0.  A surface plot, as shown in the top panel of Figure 9.6, is obtained with Plot3D:

Plot3D[u2[x,t,0.5,1],{x,-10,10},{t,-10,10},
     ViewPoint->{-1.3,-2.4,2},Shading->False,
     PlotPoints->50]

A contour plot of this solution, as shown in the bottom panel of Figure 7.1, is obtained with ContourPlot:

ContourPlot[u2[x,t,0.5,1],{x,-10,10},{t,-10,10},
     AxesLabel->{x,u},PlotPoints->80,
     ContourShading->False,
     ContourSmoothing->Automatic]

For most purposes, a smaller value of PlotPoints should be used, since the time taken to produce the plot increases significantly with increasing values of this option.

Figure 9.7

The line plots of this solution that are shown in  Figure 9.7 are obtained by using Plot.

Do[Plot[u2[x,-12+8k,0.5,1],{x,-30,30},
     AxesLabel->{x,u},PlotRange->{0,1}],{k,0,3}]

Figure 9.8

To obtain the three-soliton solution shown in Figure 9.8, we simply iterate the nonlinear superposition relation using the one-soliton and two-soliton solutions, as discuissed in the lecture notes.  We first construct the quantities in (9.105) and (9.106):

psiIrreg[x_,t_,beta_,beta2_]:=2(beta2-beta)/
     (uReg[x,t,beta2]-uReg[x,t,beta]);
     
psiReg[x_,t_,beta_,beta1_]:=2(beta-beta1)/
     (uReg[x,t,beta]-uIrreg[x,t,beta1])

The regular solution of the Korteweg-de Vries equation is then constructed as in (9.110):

psi3[x_,t_,beta_,beta1_,beta2_]:=uReg[x,t,beta]+
     2(beta1-beta2)/(psiReg[x,t,beta,beta1]-
     psiIrreg[x,t,beta,beta2])

The corresponding solution of the Korteweg-de Vries equation is then obtained as:

u3[x_,t_,beta_,beta1_,beta2_]:=
     D[psi3[s,t,beta,beta1,beta2],s]/.s->x

Figure 9.8 can now be generated using Plot:

Do[Plot[u3[x,k,1,2,3],{x,-10,20},AxesLabel->{x,u},
     PlotRange->{0,3}],{k,0,2}]