(* begin of command file h_kdv.m *) Needs["hirota`"]; n=3; B[f_,g_] := Dx[4,x,f,g] + Dxt[1,1,x,t,f,g]; name="KdV"; myfile="h_kdv.o"; OpenLog[myfile]; hirota[B,name,n,1,1,False,False]; (* Explanation for example : hirota[B,name,n,3,5,True,True]; B stands for the bilinear operator B[f_,g_] for the given PDE. The user can assign a `name' to the PDE, e.g. name: KdV for the KdV equation. The n refers to the N-soliton solution the user wants to calculate. n is either one, two or three. With 3 as the forth argument, the user requires 3 random number tests for the existence of the three soliton solution. With 5 as the fifth argument, the user requires 5 random number tests for the existence of the four soliton solution. With True in the sixth position, the Hirota's condition for the existence of the three soliton solution will be tested symbolically. (provided none of the random number tests failed). With True in the seventh position, the Hirota's condition for the existence of the four soliton solution will be tested symbolically. (provided none of the random number tests failed). With False these symbolic tests would be skipped. *) (* information available after the program finishes *) THETA[1]; OMEGA[3]; OM[2]; a[1,2]; b[1,2,3]; F; EXPRF; (* Setting up specific values for the wave numbers *) K[1]=1; K[2]=3/2; K[3]=5/4; CST[1]=0; CST[2]=0; CST[3]=0; FNUMER=F; (* computation of the solution u(x,t) of u_t + 6 u u_x + u_{3x} = 0 *) U[XX_,TT_]:=2*D[Log[FNUMER],{X,2}] /. {X -> XX, T -> TT}; Print["This is U[X,T] ", U[X,T]]; (* starting the plotting in 2D *) Plot[Evaluate[U[X,0.0]],{X,-12,17}, PlotRange -> {{-12,17}, All}]; (* starting the plotting in 3D *) Plot3D[Evaluate[U[X,T]],{X,-15,25},{T,-3,15}, PlotPoints -> 50, PlotRange -> {{-15,25},{-3,15},{0,1.25}}]; (* CloseLog[]; *) (* end of the command file h_kdv.m *)