Nonlinear Schrodinger Equation

N=1 solution

u[z_,t_]:=-2 n Sech[2 n t] Exp[2 I n^2 z];

Assuming[n>0 && z>0 && t>0,Simplify[I D[u[z,t],z]+1/2 D[u[z,t],t,t]+Abs[u[z,t]]^2 u[z,t]]]

n=.3;
Plot3D[Abs[u[z,t]]^2,{t,-5,5},{z,0,10}]

N=2 solution

u2[z_,t_]:=4 (Cosh[3 t]+3 Exp[4 I z] Cosh[t]) Exp[I z/2]/(Cosh[4 t]+4 Cosh[2 t]+ 3 Cos[4 z]);

Assuming[z>0 && t>0,Simplify[I D[u2[z,t],z]+1/2 D[u2[z,t],t,t]+Abs[u2[z,t]]^2 u2[z,t]]]

-((256 (E^((17 I z)/2)) Cosh[t] (-1+3 (E^(4 I z))+2 Cosh[2 t]) (10 (E^(4 I z))-2 (E^(4 I z)) ((Abs[3 (E^(4 I z)) Cosh[t]+Cosh[3 t]])^2)+3 (1+3 (E^(4 I z))+(E^(8 I z))) Cosh[2 t]+3 Cosh[4 t]+3 (E^(8 I z)) Cosh[4 t]+(E^(4 I z)) Cosh[6 t]))/(((3+3 (E^(8 I z))+8 (E^(4 I z)) Cosh[2 t]+2 (E^(4 I z)) Cosh[4 t]))^3))/.{z->3.3,t->.4}

Simplify[-((256 (E^((17 I z)/2)) Cosh[t] (-1+3 (E^(4 I z))+2 Cosh[2 t]) (10 (E^(4 I z))-2 (E^(4 I z)) (3 (E^(4 I z)) Cosh[t]+Cosh[3 t]) (3 (E^(-4 I z)) Cosh[t]+Cosh[3 t]) +3 (1+3 (E^(4 I z))+(E^(8 I z))) Cosh[2 t]+3 Cosh[4 t]+3 (E^(8 I z)) Cosh[4 t]+(E^(4 I z)) Cosh[6 t]))/(((3+3 (E^(8 I z))+8 (E^(4 I z)) Cosh[2 t]+2 (E^(4 I z)) Cosh[4 t]))^3))]

Plot3D[Abs[u2[z,t]]^2,{t,-5,5},{z,0,10},PlotRange->{0,15}]

c1[n1_,n2_]:=(n1+n1) (n1+n2)/Abs[n1-n2];
c2[n1_,n2_]:=(n2+n2) (n1+n2)/Abs[n1-n2];

L1[z_,t_]:=Sqrt[c1[n1,n2]] Exp[-n1 t-I n1^2 z];
L2[z_,t_]:=Sqrt[c2[n1,n2]] Exp[-n2 t-I n2^2 z];
L1s[z_,t_]:=Sqrt[c1[n1,n2]] Exp[-n1 t+I n1^2 z];
L2s[z_,t_]:=Sqrt[c2[n1,n2]] Exp[-n2 t+I n2^2 z];
Eq11:= p11+L1[z,t] L1s[z,t]/(2 I n1) p21s+L1[z,t] L2s[z,t]/(I (n1+n2)) p22s==0;
Eq12:= p12+L2[z,t] L1s[z,t]/(I (n2+n1)) p21s+L2[z,t] L2s[z,t]/(I (n2+n2)) p22s==0;
Eq21:= p21s-L1s[z,t] L1[z,t]/(-2 I n1) p11-L1s[z,t] L2[z,t]/(-I (n1+n2)) p12==L1s[z,t];
Eq22:= p22s-L2s[z,t] L1[z,t]/(-I (n2+n1)) p11-L2s[z,t] L2[z,t]/(-I (n2+n2)) p12==L2s[z,t];
Solve[{Eq11,Eq12,Eq21,Eq22},{p11,p12,p21s,p22s}]

psi21s[z_,t_]:=(4 (E^(n1 t+I (n1^2) z+2 I (n2^2) z)) n1 (((n1+n2))^2) (4 (E^(2 n1 t+4 n2 t+2 I (n1^2) z)) (n1^3) (n2^2) (Sqrt[c1[n1,n2]])+8 (E^(2 n1 t+4 n2 t+2 I (n1^2) z)) (n1^2) (n2^3) (Sqrt[c1[n1,n2]])+4 (E^(2 n1 t+4 n2 t+2 I (n1^2) z)) n1 (n2^4) (Sqrt[c1[n1,n2]])+2 (E^(2 n2 t+2 I (n2^2) z)) n1 (n2^2) ((c1[n1,n2])^(3/2)) c2[n1,n2]-2 (E^(2 n2 t+2 I (n2^2) z)) (n2^3) ((c1[n1,n2])^(3/2)) c2[n1,n2]+(E^(2 n1 t+2 I (n1^2) z)) (n1^3) (Sqrt[c1[n1,n2]]) ((c2[n1,n2])^2)-(E^(2 n1 t+2 I (n1^2) z)) n1 (n2^2) (Sqrt[c1[n1,n2]]) ((c2[n1,n2])^2)))/(16 (E^(4 n1 t+4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^6) (n2^2)+64 (E^(4 n1 t+4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^5) (n2^3)+96 (E^(4 n1 t+4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^4) (n2^4)+64 (E^(4 n1 t+4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^3) (n2^5)+16 (E^(4 n1 t+4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^2) (n2^6)+4 (E^(4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^4) (n2^2) ((c1[n1,n2])^2)+16 (E^(4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^3) (n2^3) ((c1[n1,n2])^2)+24 (E^(4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^2) (n2^4) ((c1[n1,n2])^2)+16 (E^(4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) n1 (n2^5) ((c1[n1,n2])^2)+4 (E^(4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n2^6) ((c1[n1,n2])^2)+16 (E^(2 n1 t+2 n2 t+4 I (n1^2) z)) (n1^4) (n2^2) c1[n1,n2] c2[n1,n2]+16 (E^(2 n1 t+2 n2 t+4 I (n2^2) z)) (n1^4) (n2^2) c1[n1,n2] c2[n1,n2]+32 (E^(2 n1 t+2 n2 t+4 I (n1^2) z)) (n1^3) (n2^3) c1[n1,n2] c2[n1,n2]+32 (E^(2 n1 t+2 n2 t+4 I (n2^2) z)) (n1^3) (n2^3) c1[n1,n2] c2[n1,n2]+16 (E^(2 n1 t+2 n2 t+4 I (n1^2) z)) (n1^2) (n2^4) c1[n1,n2] c2[n1,n2]+16 (E^(2 n1 t+2 n2 t+4 I (n2^2) z)) (n1^2) (n2^4) c1[n1,n2] c2[n1,n2]+4 (E^(4 n1 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^6) ((c2[n1,n2])^2)+16 (E^(4 n1 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^5) n2 ((c2[n1,n2])^2)+24 (E^(4 n1 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^4) (n2^2) ((c2[n1,n2])^2)+16 (E^(4 n1 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^3) (n2^3) ((c2[n1,n2])^2)+4 (E^(4 n1 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^2) (n2^4) ((c2[n1,n2])^2)+(E^(2 I (n1^2) z+2 I (n2^2) z)) (n1^4) ((c1[n1,n2])^2) ((c2[n1,n2])^2)-4 (E^(2 I (n1^2) z+2 I (n2^2) z)) (n1^3) n2 ((c1[n1,n2])^2) ((c2[n1,n2])^2)+6 (E^(2 I (n1^2) z+2 I (n2^2) z)) (n1^2) (n2^2) ((c1[n1,n2])^2) ((c2[n1,n2])^2)-4 (E^(2 I (n1^2) z+2 I (n2^2) z)) n1 (n2^3) ((c1[n1,n2])^2) ((c2[n1,n2])^2)+(E^(2 I (n1^2) z+2 I (n2^2) z)) (n2^4) ((c1[n1,n2])^2) ((c2[n1,n2])^2));psi22s[z_,t_]:=(4 (E^(n2 t+I (n2^2) z)) (Sqrt[c2[n1,n2]]) (4 (E^(4 n1 t+2 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^6) (n2^2)+16 (E^(4 n1 t+2 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^5) (n2^3)+24 (E^(4 n1 t+2 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^4) (n2^4)+16 (E^(4 n1 t+2 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^3) (n2^5)+4 (E^(4 n1 t+2 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^2) (n2^6)-(E^(2 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^4) (n2^2) ((c1[n1,n2])^2)-2 (E^(2 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^3) (n2^3) ((c1[n1,n2])^2)+2 (E^(2 n2 t+2 I (n1^2) z+2 I (n2^2) z)) n1 (n2^5) ((c1[n1,n2])^2)+(E^(2 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n2^6) ((c1[n1,n2])^2)-2 (E^(2 n1 t+4 I (n1^2) z)) (n1^5) n2 c1[n1,n2] c2[n1,n2]-2 (E^(2 n1 t+4 I (n1^2) z)) (n1^4) (n2^2) c1[n1,n2] c2[n1,n2]+2 (E^(2 n1 t+4 I (n1^2) z)) (n1^3) (n2^3) c1[n1,n2] c2[n1,n2]+2 (E^(2 n1 t+4 I (n1^2) z)) (n1^2) (n2^4) c1[n1,n2] c2[n1,n2]))/(16 (E^(4 n1 t+4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^6) (n2^2)+64 (E^(4 n1 t+4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^5) (n2^3)+96 (E^(4 n1 t+4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^4) (n2^4)+64 (E^(4 n1 t+4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^3) (n2^5)+16 (E^(4 n1 t+4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^2) (n2^6)+4 (E^(4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^4) (n2^2) ((c1[n1,n2])^2)+16 (E^(4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^3) (n2^3) ((c1[n1,n2])^2)+24 (E^(4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^2) (n2^4) ((c1[n1,n2])^2)+16 (E^(4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) n1 (n2^5) ((c1[n1,n2])^2)+4 (E^(4 n2 t+2 I (n1^2) z+2 I (n2^2) z)) (n2^6) ((c1[n1,n2])^2)+16 (E^(2 n1 t+2 n2 t+4 I (n1^2) z)) (n1^4) (n2^2) c1[n1,n2] c2[n1,n2]+16 (E^(2 n1 t+2 n2 t+4 I (n2^2) z)) (n1^4) (n2^2) c1[n1,n2] c2[n1,n2]+32 (E^(2 n1 t+2 n2 t+4 I (n1^2) z)) (n1^3) (n2^3) c1[n1,n2] c2[n1,n2]+32 (E^(2 n1 t+2 n2 t+4 I (n2^2) z)) (n1^3) (n2^3) c1[n1,n2] c2[n1,n2]+16 (E^(2 n1 t+2 n2 t+4 I (n1^2) z)) (n1^2) (n2^4) c1[n1,n2] c2[n1,n2]+16 (E^(2 n1 t+2 n2 t+4 I (n2^2) z)) (n1^2) (n2^4) c1[n1,n2] c2[n1,n2]+4 (E^(4 n1 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^6) ((c2[n1,n2])^2)+16 (E^(4 n1 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^5) n2 ((c2[n1,n2])^2)+24 (E^(4 n1 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^4) (n2^2) ((c2[n1,n2])^2)+16 (E^(4 n1 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^3) (n2^3) ((c2[n1,n2])^2)+4 (E^(4 n1 t+2 I (n1^2) z+2 I (n2^2) z)) (n1^2) (n2^4) ((c2[n1,n2])^2)+(E^(2 I (n1^2) z+2 I (n2^2) z)) (n1^4) ((c1[n1,n2])^2) ((c2[n1,n2])^2)-4 (E^(2 I (n1^2) z+2 I (n2^2) z)) (n1^3) n2 ((c1[n1,n2])^2) ((c2[n1,n2])^2)+6 (E^(2 I (n1^2) z+2 I (n2^2) z)) (n1^2) (n2^2) ((c1[n1,n2])^2) ((c2[n1,n2])^2)-4 (E^(2 I (n1^2) z+2 I (n2^2) z)) n1 (n2^3) ((c1[n1,n2])^2) ((c2[n1,n2])^2)+(E^(2 I (n1^2) z+2 I (n2^2) z)) (n2^4) ((c1[n1,n2])^2) ((c2[n1,n2])^2));

u2g[z_,t_]:=-2 (L1s[z,t] psi21s[z,t]+L2s[z,t] psi22s[z,t]);

n1=-1/2;n2=3/2;

u2g[z,t]

Abs[u2[z,t]]-Abs[u2g[z,t]]/.{z->.345,t->2.56}

Plot3D[Abs[u2g[z,t]]^2,{t,-5,5},{z,0,10},PlotRange->{0,15}]

N=3: Homework