 # Demonstration of the REDUCE Package ConLaw for Investigating Conservation Laws of Partial Differential Equations and First Integrals of Ordinary Differential Equations

## Authors

ConLaw: Thomas Wolf
CRACK: Thomas Wolf and Andreas Brand (Jena)

## Purpose

The ConLaw package attempts to compute first integrals for single ordinary differential equations (ODEs) or systems of ODEs, and conservation laws for single partial differential equations (PDEs) or systems of PDEs.

## Availability

The latest version of ConLaw together with CRACK which is also needed is available from http://lie.math.brocku.ca/crack/src/, for example, in form of a single tar.gz file.

## Documentation

A 5-page manual for ConLaw is available in tex, dvi, ps, pdf format as well as a more detailed description with emphasis on some of the computer algebra algorithms [dvi, ps, pdf] (J. Symb. Comp. 27 (1999), 221-238) and a general description of the pro's and con's of the four different methods implemented in ConLaw1,...,ConLaw4 for finding conservation laws [dvi, ps, pdf] (Euro. J. of Applied Mathematics, 13, part 2 (2002) 129-152). (LATEX documents will be properly formatted by your web browser only if you have installed the IBM techexplorer or equivalent plug-in). This demonstration is based on the ConLaw manual.

## Background

The ConLaw package tries to find conservation laws for a given differential equation (ODE or PDE) or system of ODEs or PDEs of the form

 uaJ = wa (x, ub, ..., ubK, ...). (1)

ConLaw comes in four versions:

ConLaw1 tries to find the conserved current Pi by directly solving

 Div P = 0 (modulo eqn(1)). (2)

ConLaw3 tries to find Pi and characteristic functions Qn by solving
 Div P = SUMn Qn . (unJ - wn) (3)
identically in all x, ub, ..., ubK, ... .

Applying the Euler operator (variational derivative) for each ub on (3) gives a zero left hand side and therefore conditions involving only Qn. ConLaw4 tries to solve these conditions directly in all derivatives of ub and to compute Pi afterwards.

ConLaw2 does substitutions based on (1) before solving these conditions for Qn and therefore computes adjoined symmetries. If possible, the adjoined symmetries are completed to conservation laws by computing Pi from the Qn. (For more details please see the documentation).

All four procedures have the same syntax. They have two parameters, both of which are lists. The first parameter specifies the equations (1), the second specifies the computation to be done. One can either specify an ansatz for Pi and Qn or investigate a general situation by specifying only the order of the characteristic functions or the conserved current.

## Variables and their dependences

Note that REDUCE is not (by default) case sensitive, so it is normal for all REDUCE input to be in lower case even for mathematical variables that are conventionally written in upper case.

ConLaw does not use explicit functional notation but rather works with dependent variables that have been declared to depend implicitly on other independent variables using REDUCE depend statements.  Hence, the terms function and dependent variable are used synonymously.

However, this web interface uses functional notation to specify such dependences, from which it generates the appropriate depend statement.  Specify here all variable dependences as a comma-separated list of functional forms, e.g. to declare u and v to depend on t and x use u(t,x), v(t,x)

[As a convenience, the syntax "u, v(t,x)" is interpreted here (only) as "u(t,x), v(t,x)".  Alternatively, dependence information can be included in the ConLaw input fields below.]

## Specify which version of ConLaw to run: ConLaw4 ConLaw2 ConLaw3 ConLaw1

The four different versions have all different strengths and weaknesses depending very much on the problem. The third paper mentioned in the documentation gives a detailed comparison between them and is recommended to read.

## Input to ConLaw

All versions of ConLaw take two arguments: problem and runmode. Their values are lists, the elements of which are input as separate fields below.

### 1. Problem

The following three input fields correspond to the three elements of the first argument to the ConLaw operator, which specifies the DEs to be investigated.  Each should be a (comma-separated) sequence of one or more elements and the third may be empty.  (The example relates to the second example in the ConLaw manual, which is also available as "canned example" 4 below.)

1. required  DEs: (partial or ordinary) differential equation(s), where each must have the form
df(ui,..) = ...
with a single derivative on the left hand side (LHS), selected such that:
• the right hand side of an equation must not include the derivative on the left nor any derivative of it;
• the LHS of any equation must not occur in any other equation nor any derivative of the LHS;
• each of the unknown functions occurs on the LHS of exactly one equation.

For example:
df(u,t) = df(u,x,3) + 6*u*df(u,x) + 2*v*df(v,x),
df(v,t) = 2*df(u,x)*v + 2*u*df(v,x)

2. required  DepVars: dependent variables or functions, e.g. u, v
[You may optionally include the independent variables on which they depend, by using functional notation here instead of in the dependence field above, e.g. u(t,x), v(t,x)]
3. required (unless specified in the previous input)  IndVars: independent variables, e.g. t, x

### 2. Runmode

The investigation of conservation laws is done with the conserved current P and the characteristic functions Q being allowed to depend on a successively increasing order of derivatives of the dependent variables (say u). The first parameter (minord) is the highest order of u-derivatives in the first run and the second parameter (maxord) is the highest order of u-derivatives in the last run. Depending on which version of ConLaw is used, this is the order of the highest u-derivative in the first component of the conserved current P (for ConLaw1) or the order of the highest u-derivative in any characteristic function Q (for ConLaw2/3/4).

The following five input fields specify the calculation to be done and correspond to the five elements of the second argument to the ConLaw operator (e.g. {0, 1, t, {}, {}}).

1. required  minord: the initial (minimum) value of the highest order of derivatives of u, e.g. 0
2. required  maxord: the final (maximum) value of the highest order of derivatives of u, e.g. 1
3. required  expl: whether or not the ansatz for the characteristic functions Qj or conserved current may depend explicitly on the independent variables, e.g. ticked (or checked or shaded) meaning "yes" (or "true" or "t").
4. optional  flist: a sequence of unknown functions in any ansatz for Pt, Qj, also all parameters and parametric functions in the equation that are to be calculated such that conservation laws exist:
[You may optionally include the independent variables on which they depend, by using functional notation here instead of in the dependence field above, e.g.
u(t,x), v(t,x).]
5. optional  inequ: a sequence of expressions none of which may be identically zero for the conservation law to be found. These are extra inequality conditions, i.e. non-vanishing conditions which must be satisfied by the unknown functions in input field 4 above.

## Specifying an ansatz

An ansatz for a conservation law can be formulated by specifying one or more of the functions Pi (input as p_t,p_x,...) for ConLaw1, one or more of the functions Qj (input as q_1,q_2,...) for ConLaw2/4, one or more of p_t, q_j for ConLaw3. The "t" in p_t stands for a variable name, the "j" in q_j stands for an index  the number of the equation in the input system of equations with which q_j is multiplied to give the RHS of (1). There is a restriction on the structure of all the expressions for p_t, q_j that are specified, namely that they must be homogeneous and linear in some unknown function or constant. For an example see canned example 2.

All such functions and constants must be listed in flist (see above). The dependences of such functions must be defined before calling ConLawi. This is done by including them in the variable dependence field above (or by including the variable dependence in the flist field), e.g. f(t,x,u) to specify f as a function of t, x, u. Beware: If one wants to have f as a function of derivatives of u(t,x), say f depending on d3u/dtdx2, then one cannot use

f(df(u,t,x,2))

f(u!`1!`2!`2)

if IndVars has been specified as t,x (in that order). As t is the first variable and x is the second variable in IndVars and u is differentiated once wrt. t and twice wrt. x we therefore get u!`1!`2!`2. (The character ! is the escape character to allow special characters like ` to occur in identifiers in REDUCE.) [The reason for this extra rule is that functions, like this f which are to be computed in the program CRACK must be functions of independent variables, like u!`1!`2!`2 and not of composite expressions, like df(u,t,x,2).]

Optional  Ansatz: a normal REDUCE assignment statement with a form like this: q_1 := r*df(u,x,2)
(Omit if you are copying the example input as above.) Do not use functional notation here for any unknown independent variable but use only its name.

### NOTES:

1. It is not the case that for any conserved current Pi satisfying (2) there must exist characteristic function(s) Qj that satisfy (3). One can therefore not specify a known density Pt for ConLaw3 and hope to calculate the remaining Pi and the corresponding Qj with ConLaw3. What one can do is to use ConLaw1 to calculate the other components Pi. But this restriction for ConLaw3 does not imply that it misses conservation laws. If (1) is a totally non-degenerate system then for each current Pi satisfying (2) there exists a current Pi' differing from Pi only by a curl (a trivial conservation law) such that Pi' satisfies (3) for some suitable Qj.
2. The Qj are uniquely determined only modulo the original equations (1). If one makes an ansatz for Qj then this freedom should be removed by having the Qj independent of the LHS's of the equations (1) and their derivatives. If the Qj were allowed to depend on anything, (3) could be solved for one Qj in terms of arbitrary Pi and other Qj, giving characteristic functions that are singular for solutions of the original DEs (1).

## Control and run ConLaw

ConLaw provides the following control variable (flag):

• print_  the maximum number of terms of equations that are output. The default (for this demo) is nil, which suppresses all intermediate output.  (The default value of print_ when calling ConLaw in an interactive REDUCE session is 8.)

Use subscripts to indicate derivatives (on dfprint)  the CRACK default.

Show all REDUCE input and output without filtering.

Output TEX format (primarily for use with the "http://www.software.ibm.com/network/techexplorer/">IBM techexplorer or equivalent plug-in).

Please email any comments or problems to the maintainer of this demonstration.

## Output from ConLaw

Each of the procedures ConLawi returns a list of conservation laws {C1,C2,...}; if no non-trivial conservation law is found it returns the empty list {}. Each Ci representing a conservation law has the form { {Px, Py, ...}, {Q1, Q2, ...} }.

For example, the first conservation law C1 in the list returned as the solution to the earlier input example is as follows:

```                                 2    2
{{{ - 4*u*v,2*( - df(u,x,2) - 3*u  - v )},

2      3        2
{df(u,x)  - 2*u  - 2*u*v ,

2                2                2      4
- 2*df(u,t)*df(u,x) + df(u,x,2)  + 6*df(u,x,2)*u  + 2*df(u,x,2)*v  + 9*u

2  2    4
+ 10*u *v  + v }},

...```

## Canned Examples

The input fields below can be copied into the fields of the input form above and the form submitted for execution by ConLaw, or the examples can be run directly by simply clicking the appropriate "Run" button.  (Either way, the above control fields apply.) These examples are taken from the ConLaw test file (conlaw.tst).

To see more intermediate details of the following calculations set the value of print_ to 10 (see above).

### 1. Conservation laws of the Korteweg - de Vries equation

This example calculates all conservation laws of the KdV equation with a characteristic function of order not higher than two.

ConLaw:3
DEs: df(u,t) = -u*df(u,x) - df(u,x,3)
DepVars:
u(t,x)
minord:
0
maxord:
2
expl:
true

### 2. Conservation laws of the wave equation

This example demonstrates that one can specify an ansatz for the characteristic function of one or more equations of the PDE system. In this example all conservation laws of the wave equation, which is written as a first order system, are calculated such that the characteristic functions of the first of both equations is proportional to d2u/dx2. (This will include zero as it is a multiple of d2u/dx2 too.)

DEPEND:r(t,x,u,v,u!`2,v!`2)
ConLaw:2
DEs: df(u,t) = df(v,x), df(v,t) = df(u,x)
DepVars:
u(t,x), v(t,x)
minord:
2
maxord:
2
expl:
true
flist:
r
Ansatz: q_1 := r*df(u,x,2)

### 3. Conservation laws of Burgers equation

For Burgers equation the following example finds all conservation laws of zero'th order in the characteristic function up to the solution of the linear heat equation. This is an example for what happens when not all conditions could be solved, but it is also an example which shows that not only characteristic functions of polynomial or rational form can be found.

ConLaw:1
DEs: df(u,t) = df(u,x,2) + df(u,x)^2/2
DepVars:
u(t,x)
minord:
0
maxord:
0
expl:
true

### 4. Conservation laws of the Ito system

In this example all conservation laws of the Ito system are calculated that have a characteristic function of order not higher than one. This is a further example of non-polynomial conservation laws.

ConLaw:4
DEs: df(u,t) = df(u,x,3) + 6*u*df(u,x) + 2*v*df(v,x),
df(v,t) = 2*df(u,x)*v + 2*u*df(v,x)

DepVars:
u(t,x), v(t,x)
minord:
0
maxord:
1
expl:
true

### 5. Conservation laws of the 5th order Korteweg - de Vries equation

In this example the 5th order Korteweg - de Vries equation is investigated concerning conservation laws of order 0 and 1 in the conserved density Pt. Parameters a,b,c in the PDE are determined such that conservation laws exist. This complicates the problem by making it non-linear with a number of cases to be considered. Some of the subcases below can be combined to reduce their number which currently is not done automatically.

ConLaw:1
DEs: df(u,t) = -df(u,x,5) - a*u^2*df(u,x) - b*df(u,x)*df(u,x,2) - c*u*df(u,x,3)
DepVars:
u(t,x)
minord:
0
maxord:
1
expl:
true
flist:
a,b,c

BEWARE: This example currently takes 5 to 10 minutes to run!

### 6. First integrals of the Lorentz ODE system

ConLawi can also be used to determine first integrals of ODEs. The generality of the ansatz is not just specified by the order. For example, the Lorentz system below is a first order system therefore any first integrals are zero order expressions. The ansatz to be investigated below looks for first integrals of the form a1(x, t) + a2(y, t) + a3(z, t) = constant and determines parameters s, b, r such that first integrals exist.

DEPEND:a1(x,t), a2(y,t), a3(z,t)
ConLaw:1
DEs: df(x,t) = - s*x + s*y,
df(y,t) = x*z + r*x - y,
df(z,t) = x*y - b*z

DepVars:
x(t), y(t), z(t)
minord:
0
maxord:
0
expl:
true
flist:
a1,a2,a3,s,r,b
Ansatz: p_t := a1 + a2 + a3

Original design by Francis Wright and Thomas Wolf
Maintained by Thomas Wolf [twolf(at)brocku.ca] and Winfried Neun
Last updated 23 January 2006