\(AN\ EXACT\ SOLUTION\ TO\ THE\ NONLINEAR\ SCHRÖDINGER\ EQUATION\)
		
This is the modified version of the n–soliton solution with all simple poles .   In the soliton case all the poles used are located in the upper half complex plane .  In this example we use two poles, \(one\ in\ the\ upper\ half\ complex\ plane\ and\ one\ in\ the\ lower\ half\ complex\ plane . \ As\ shown\ in\ this\ example\),we still get a solution to the NLS equation. 

The number of poles is denoted by n. The poles are specified in the vector λ below .  The norming constants are specified as the complex entries of the vector  c  below.

The exact solution  u(x, t)  to the NLS equation is evaluated as in  (5.11) \(of\ \ [Aktosun, \ Demontis, \ 
                van\ der\ Mee\ \ \((2007)\)] . 

The\) absolute value of the exact solution, i . e .   |u(x, t)|,  \(to\ the\ NLS\ equation\ is\ evaluated\ as\ in\ \ \((6.6)\)\ \(\(of\ \ [Aktosun, \ Demontis, \ 
                van\ der\ Mee\ \ \((2007)\)]\)\(.\)\(
\)\)\)

n = 2;
λ = {2 I, -I};
c = {1, -1};

Display the exact solution  u(x, t) :

u = -(8 (E^(4 I t - 4 x)) (9 + 
                  16 (E^(8 x)) - 
                  4 (E^(2 (6 I t + x))) (4 + 9 (E^(4 x)))))/(128 Cos[12 t] - 
              145 Cosh[2 x] - 20 Cosh[6 x] + 17 Sinh[2 x] - 
              12 Sinh[6 x])

\(Verify\ that\ the\ NLS\ equation\ is\ satisfied\ by\ verifying\ that\ \*""" 
          test \*"""\ defined\ below\ is\ \(\(zero\)\(:\)\)\)

iut = I D[u, t];
uxx = D[D[u, x, x]];
ucconj = ComplexExpand[Conjugate[u ]];
test = iut + uxx + 2 ucconj  u^2;
Simplify[test]

Next, evaluate |u(x, t)|:

ccλ = Conjugate[λ];
ccc = 
        Conjugate[c];
gammamatrix=IdentityMatrix[n]+Table[ccc[[i]] E^(-I ccλ[[i]]  x - 
                      4 I (ccλ[[i]])^2 t) Sum[
                  c[[k]] E^(2 I λ[[k]]  x + 
                            4 I (λ[[k]])^2 t)/((ccλ[[i]] - λ[[k]]) (λ[[k]] - ccλ[[j]])), {k, 1, n}] E^(-I ccλ[[j]]  x),{i, n},{j, n}];
detgamma = Det[gammamatrix];
derivdetgamma = 
        D[detgamma, x];
absusqr = 
        D[derivdetgamma/detgamma, x];
absu = 
        Chop[Sqrt[Abs[absusqr]]];

Plot  |u(x,0)|, \(the\ absolute\ value\ of\ the\ initial\ \(\(potential\)\(:\)\)\)

Plot[Chop[absu] /.  t -> 0, {x, -3, 3},  
      PlotRange -> {0, 7}]

<< Graphics`Animation`

Animate  |u(x,t)| \(to\ watch\ the\ time\ evolution\ of\ the\ \(\(potential\)\(:\)\)\)

Animate[
        Plot[Chop[absu],  {x,  -3,  3},  
          PlotRange -> {0, 7}],  {t,  -1,  1.5,   .01}, 
        AxesLabel -> t "t"];