(* d_comkdv.m *) (* Discretization of the combined KdV-mKdV equation. *) (* See slides CU-Boulder p. 43 *) (* Complete equation aa and bb non-zero *) hh = 1; (* cc = gamma on slides, aa = alpha, bb = beta, dd = delta *) u[1][n_]'[t]:= -Expand[(cc+aa*u[1][n][t]+bb*u[1][n][t]^2)* ( dd*((1/2)*u[1][n+2][t]-u[1][n+1][t]+u[1][n-1][t]-(1/2)*u[1][n-2][t])+ (aa/2)*(u[1][n+1][t]^2-u[1][n-1][t]^2+ u[1][n][t]*(u[1][n+1][t]-u[1][n-1][t])+ u[1][n+1][t]*u[1][n+2][t]-u[1][n-1][t]*u[1][n-2][t])+ (bb/2)*(u[1][n+1][t]^2*(u[1][n+2][t]+u[1][n][t])- u[1][n-1][t]^2*(u[1][n-2][t]+u[1][n][t]) ) ) ]; noeqs = 1; name = "Herbst/Taha Discretization of combined KdV-mKdV Equation"; parameters = {}; weightpars = {aa,bb,cc,dd}; formrho = 0; (* densitychoice=1; *) (* weightu[1] = 1/4; *) weight[aa] = 1/4; (* weight[dd] = 1/2; *) (* weight[gg] = 1/2; *) (* d_comkdv.m *)