/* Command file h_kdv.com for Korteweg-de Vries Equation */ writefile("h_kdv.out"); batchload("hir_sing.max")$ n:3$ B(f,g):= Dxt[1,1](f,g) + Dx[4](f,g)$ name:KdV$ hirota(b,name,n,2,3,true,true)$ /* extra information available after the program finishes */ theta[1]; omega[3]; om[2]; factor(a[1,2]); factor(b[1,2,3]); f; expression(f); /* 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:ev(expression(f)); /* computation of the solution u(x,t) of u_t + 6 u u_x + u_{3x} = 0 */ define(u(x,t),2*ev(diff(log(ev(expression(f))),x,2),diff)); /* Plotting commented out here, re-activate if your machine has plot capabilities */ /* taken out as of here /* starting the plotting in 2D */ plot(u(x,0),x,-9,13); /* starting the plotting in 3D */ plot3D(u(x,t),x,-4,4,t,-5,5); end of taken out */ closefile(); kill(all)$ quit(); /* end of the file h_kdv.com */