\(AN\ EXACT\ SOLUTION\ TO\ THE\ NONLINEAR\ SCHRÖDINGER\ EQUATION\)

\(This\ is\ a\ one–soliton\ solution\ with\ a\ single\ pole\ of\ order\ two . \ The\ bound\ state\ occurs\ at\ λ = 
        a1 + I\ b1 . The\ norming\ constants\ are\ c0 + I\ d0\ and\)
c1 + I d1,where a1,b1,c0,d0,c1,d1 are all real parameters,and b1 is positive because a1+I b1 is located on the upper half complex plane.		

Note that A, B, C (denoted by  a,  b,  c,  respectively,  below),are the matrices defined in (4.6)-(4.8) in  [Aktosun,  Demontis, 
                van der Mee  (2007)]. The contant  p denotes the size of the matrix A.

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

p = 2;
a = { {b1 - I a1, -1}, {0, b1 - I a1}};
b = {{0}, {1}};
c = {{c1 + I d1, c0 + I d0}};

cta = 
        ComplexExpand[Conjugate[Transpose[a]]];
ctb = 
        ComplexExpand[Conjugate[Transpose[b]]];
ctc = 
        ComplexExpand[Conjugate[Transpose[c]]];
n0 = 
        Integrate[
          MatrixExp[- a z] .  b .  ctb .  
            MatrixExp[- cta z], {z, 0, Infinity}, 
          Assumptions -> b1 > 0];
n = 
        Simplify[
          MatrixExp[- a x] . n0 . 
            MatrixExp[- cta x]];
q00 = 
        Integrate[
          MatrixExp[-  cta  z] .   ctc  . c  .  
            MatrixExp[- a z], {z, 0, Infinity}, 
          Assumptions -> b1 > 0];
q = 
        Simplify[
          MatrixExp[-  cta  x + 
                4 t I  cta .  cta] .   q00  .  
            MatrixExp[- a x - 
                4 I a . a  t]];
gammamatrix = IdentityMatrix[p] + q  .  n;
invgammamatrix = Inverse[gammamatrix];
ctgammamatrix = IdentityMatrix[p] + n .  q;
invctgammamatrix = Inverse[ctgammamatrix];
utemp = -2  ctb .   MatrixExp[- cta  x]  .  
            invgammamatrix  .  
            MatrixExp[-  cta  x + 4 t I  cta  .  cta ] .  
            ctc;
utemptemp = utemp[[1, 1]];
absusqrtemp = 
        4 ctb .  MatrixExp[- cta x] .  
            invgammamatrix . (cta  . q + q . a) . invctgammamatrix . 
            MatrixExp[- a x] . b;
absusqr = absusqrtemp[[1, 1]];

Display the exact solution  u(x, t) :

u = Simplify[utemptemp]

\(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]

\(Obtain\ a\ specific\ solution\ \ by\ assigning\ \ particular\ values\ to\ a1, b1, c0, d0, c1, \(\(d1\)\(:\)\)\)

uspecific = 
      Simplify[u /.  {a1 -> 1, b1 -> 2, c0 -> -1, 
            d0 -> 4, c1 -> 1, d1 -> 2}]

Plot  |u(x,0)|, \(the\ absolute\ value\ of\ the\ specific\ solution\ at\ t = \(\(0\)\(:\)\)\)

Plot[Chop[Abs[uspecific]] /.  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[Abs[uspecific]],  {x,  -10,  10},  
          PlotRange -> {0, 7}],  {t,  -2. ,  2,   .01}, 
        AxesLabel -> t "t"];