SetDirectory[$HomeDirectory<>"/Documents/handouts/math467/KdVEquation"]

Korteweg-De Vries Equation

Clear[a,c,u]

u[x_,t_]:=2(c^2)((Sech[c(x-4(c^2)t)+a])^2)

Plot[{u[x,0]/.{c->3/2,a->1},u[x,0]/.{c->1,a->0}},{x,-3,3},AxesLabel->{"\!\(\*TemplateBox[<|"boxes" -> FormBox[
StyleBox["x", "TI"], TraditionalForm], "errors" -> {}, "input" -> "x", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)","\!\(\*TemplateBox[<|"boxes" -> FormBox[
RowBox[{
StyleBox["u", "TI"], "(", 
RowBox[{
StyleBox["x", "TI"], ",", "0"}], ")"}], TraditionalForm], "errors" -> {}, "input" -> "u (x, 0)", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)"},BaseStyle->FontSize->12]

GraphicsGrid[Partition[Table[Plot[{u[x,t]/.{c->3/2,a->1},u[x,t]/.{c->1,a->0}},{x,-3,3},AxesLabel->{"\!\(\*TemplateBox[<|"boxes" -> FormBox[
StyleBox["x", "TI"], TraditionalForm], "errors" -> {}, "input" -> "x", "state" -> "Boxes"|>,"TeXAssistantTemplate"]\)","u(x,"<>ToString[t]<>")"},BaseStyle->FontSize->12],{t,{0,0.1,0.2,0.3}}],2]]

Export["KdVarray.eps",%,"EPS"]

Export["KdVarray.pdf",%%,"PDF"]