1% Dispersionless Boussinesq equation: three local Hamiltonian operators 2% 2016-01-12 3% Raffaele Vitolo 4 5load_package cde; 6 7% Initialization of the jet environment of the differential equation. 8indep_var:={x,t}$ 9dep_var:={u,v,w}$ 10odd_var:={p,q,r}$ 11deg_indep_var:={-1,-2}$ 12deg_dep_var:={3,4,2}$ 13deg_odd_var:={2,1,3}$ 14total_order:=8$ 15% names for output of the state of cde and results of computations 16statename:="bou_ho1_state.red"$ 17resname:="bou_ho1_res.red"$ 18 19% Initialization of the differential equation. 20% The system must be in passive orthonomic form; 21% this also means that there will be no nontrivial integrability conditions 22% between parametric derivatives. 23 24% left-hand side of the differential equation 25principal_der:={u_t,v_t,w_t}$ 26% right-hand side of the differential equation 27de:={w*w_x + v_x, - u*w_x - 3w*u_x,u_x}$ 28 29% same constructions for odd coordinates; 30principal_odd:={p_t,q_t,r_t}$ 31de_odd:={ 32 - 2*q*w_x - 3*q_x*w + r_x, 33p_x, 34p_x*w + 2*q*u_x - q_x*u 35 }$ 36 37% Calling cde's main routine 38cde({indep_var,dep_var,odd_var,total_order}, 39 {principal_der,de,principal_odd,de_odd})$ 40 41% Solving the determining equations through dimensional analysis 42cde_grading(deg_indep_var,deg_dep_var,deg_odd_var)$ 43 44% Saving cde state in a file 45save_cde_state(statename)$ 46 47% Initialize a counter for the vector of arbitrary constants 48% and vectors of equations and constants 49ctel:=0; 50operator c,equ; 51nc:=length(dep_var); 52 53% List of variables ordered by gradings 54l_grad_mon:=der_deg_ordering(0,all_parametric_der)$ 55l_grad_odd:={1} . der_deg_ordering(1,all_parametric_odd)$ 56% List of graded monomials of scale degree <= 10 57gradmon:=graded_mon(1,10,l_grad_mon)$ 58gradmon:={1} . gradmon$ 59% list of graded monomials which are linear in odd variables 60% and have total degree from 1 to 8 61linodd:=mkalllinodd(gradmon,l_grad_odd,1,8)$ 62% Ansatz for local Hamiltonian operators 63operator phi; 64for i:=1:nc do phi(i):=(for each el in linodd sum (c(ctel:=ctel+1)*el))$ 65 66% equation for shadows of nonlocal symmetries in \ell^*-covering 67mk_superfun(lbou_sf,1,3); 68lbou_sf(1):=p_t - q_x - r*w_x - r_x*w$ 69lbou_sf(2):=p*w_x + 3*p_x*w + q_t + 3*r*u_x + r_x*u$ 70lbou_sf(3):= - p_x + r_t$ 71conv_superfun2cdiff(lbou_sf,lbou); 72 73for i:=1:nc do 74equ(i):=for j:=1:nc sum lbou(i,j,phi(j)); 75 76% This is the list of variables, to be passed to the equation solver. 77 78vars:=append(indep_var,all_parametric_der)$ 79 80% This is the number of initial equation(s) 81 82tel:=3; 83 84% This command initialize the equation solver. 85% It passes the equation(s) togeher with their number `tel', 86% the constants'vector `c', its length `ctel', 87% an arbitrary constant `f' that may appear in computations. 88 89initialize_equations(equ,tel,{},{c,ctel,0},{f,0,0}); 90 91% Run the procedures splitext and splitvars 92% in order to obtain equations on coefficiens 93% of each monomial. 94 95tel:=splitext_opequ(equ,1,3); 96 97tel2:=splitvars_opequ(equ,4,tel,vars); 98 99% Next command tells the solver the total number of equations obtained 100% after running splitvars. 101 102put_equations_used tel2; 103 104% This command solves the equations for the coefficients. 105% Note that we have to skip the initial equations! 106 107for i:=tel+1:tel2 do integrate_equation i; 108 109off nat$ 110off echo$ 111out <<resname>>; 112write "operator phi;"; 113phi(1):=phi(1); 114phi(2):=phi(2); 115phi(3):=phi(3); 116write ";end;"; 117shut <<resname>>; 118on echo$ 119on nat$ 120 121pause; 122 123% Generate a superfunction with the first operator 124mk_superfun(ham1_sf,1,{3},3); 125for i:=1:nc do 126 ham1_sf(i):=df(phi(i),c(6)); 127conv_superfun2cdiff(ham1_sf,ham1); 128adjoint_cdiffop(ham1,ham1_star); 129for i:=1:nc do if ham1_star_sf(i) + ham1_sf(i) neq 0 then 130 write "Non self-adjoint operator"; 131 132% Generate a superfunction with the second operator 133mk_superfun(ham2_sf,1,{3},3); 134for i:=1:nc do 135 ham2_sf(i):=df(phi(i),c(56)); 136conv_superfun2cdiff(ham2_sf,ham2); 137adjoint_cdiffop(ham2,ham2_star); 138for i:=1:nc do if ham2_star_sf(i) + ham2_sf(i) neq 0 then 139 write "Non self-adjoint operator"; 140 141% Generate a superfunction with the third operator 142mk_superfun(ham3_sf,1,{3},3); 143for i:=1:nc do 144 ham3_sf(i):=df(phi(i),c(59)); 145conv_superfun2cdiff(ham3_sf,ham3); 146adjoint_cdiffop(ham3,ham3_star); 147for i:=1:nc do if ham3_star_sf(i) + ham3_sf(i) neq 0 then 148 write "Non self-adjoint operator"; 149 150% Generate a superfunction as a linear combination of 151% the second and third operator 152mk_superfun(ham0_sf,1,{3},3); 153for i:=1:nc do 154 ham0_sf(i):=alpha*ham2_sf(i) + beta*ham3_sf(i); 155conv_superfun2cdiff(ham0_sf,ham0); 156adjoint_cdiffop(ham0,ham0_star); 157for i:=1:nc do write ham0_star_sf(i) + ham0_sf(i); 158 159% We find that the linear combination of the above bivectors is skew-adjoint 160% if and only if 161alpha:=9; 162beta:=5; 163 164% Conversion into bivector 165conv_genfun2biv(ham0_sf,biv0); 166conv_genfun2biv(ham1_sf,biv1); 167 168% Computes the Schouten bracket followed by the Euler operator 169% to check if the expression is a total divergence; 170% returns the list of even and odd variational derivatives. 171iszero_schouten_bracket(biv1,biv1); 172iszero_schouten_bracket(biv1,biv0); 173iszero_schouten_bracket(biv0,biv0); 174 175;end; 176 177Local Variables: 178mode:reduce 179End: