(* d_dimkdv.m *)

(* For discretization of the combined KdV-mKdV equation *)
(* derived by Herbst and Hereman *)

(* mKdV subcase! *)

(* Take the discretized mKdV by itself: set aa = 0 *)

aa = 0;

(* leave bb free, could be set equal to 1/6 *)

(* aa = alpha, bb = beta, cc = gamma, dd = delta *)
(* set hh = 1; *)
(* you can set kappa = 0 if you like *)

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 mKdV Equation";
parameters = {bb};
weightpars = {cc,dd};

formrho = 0;

(*
weightu[1] = 1/4; 
weight[bb] = 0;
weight[cc] = 1/2;
weight[dd] = 1/2;
*)

(* d_dimkdv.m *)

