Return-Path: <wms@ira.uka.de>
From: wms@ira.uka.de
Date: Tue, 11 Feb 1997 14:49:04 +0100 (MET)
To: mupad-ode@lorraine.loria.fr
Subject: differential variables
X-Sun-Charset: US-ASCII

Helau!

	As the Karlsruhe carneval parade is just thundering right below
my office window, I may also produce a bit "noise" on this lately rather
quite discussion list :-)

	I've finally managed to design a proposal for the "differential
world" of MuPAD. I'll explain it below more in plain words than in form
of code. It's a *proposal* and not identical with what we have already
implemented. Therefore I'd like some feedback and discussion, before
we (or mainly my Hiwi...) start actual programming work.

	The core of my proposal consists of two categories as discussed
in Oberwolfach: Cat::DifferentialVariableCat and Cat::DifferentialFunctionCat.
I do not introduce different categories for ODEs and PDEs as originally
planned for reasons that will become obvious below. Recall that the first
category deals mainly with "cosmetic" matters, i.e. in- and output of
differential variables. Besides the introduction of rankings, no real maths
is happening here. Algebraic structures arise only in the second category.
This mail deals only with the first category.

	My proposal for Cat::DifferentialVariableCat is based on a 
classification of differential variables into four types: independent
variables, dependent variables, derivatives and (because it is sometimes
convenient) constants, namely 0 and 1. This classification is natural for
most applications. Only hard core differential algebraists will be unhappy
with the appearance of independent variables, as in theory this concept
does not exist in differential algebra. These guys will be satisfied with
a special option to be discussed later.

	The category has no parameters or axioms; its super-category is
Cat::OrderedSet. Therefore the variables are always ordered and internally
we can always imagine that the independent and dependent variables, resp.,
are represented by the numbers 1..n and 1..m, resp. My proposal covers
only domains with finite numbers n,m. These numbers can be accessed by
the methods numIndVar and numDepVar. For derivatives we need one index
to represent the dependent variable which is differented and a multi
index that encodes with respect to which independent variables one has
differentiated.

	The category supports two types of multi indices. One is the
classical multi index of multivariate calculus, that's what I will call
in the sequel a *multi index*. It's an n-tuple of integers. The i-th
entry denotes how often one has differentiated with respect to the i-th
independent variables. The other sort I call *repeated index*; it's just
a list of integers between 1..n where each represents a differentiation
with respect to the corresponding independent variables.

	Thus u_xy is a typical repeated index notation. If x and y are
the only independent variable, this derivative would be u_[1,1] in multi
index notation. The method multiIndex would thus return [1,1], repeated-
Index would return [1,2] (if x is the first independent variable). As long 
as derivatives commute one should always order repeated indices, thus write 
u_xxy instead of u_xyx or u_yxx.

	Cat::DifferentialVariableCat requires the following methods: 

1. new - new should accept two sorts of input: it should be able to convert
	standard MuPAD expressions like diff(u(x),x) and it should accept
	an abstract definition of variables with index lists. Thus it should 
	also be possible to enter u_x as something like new("Deriv",1,[1]). 
	This provides the only representation independent mean to generate 
	differential variables and is thus crucial for programmers!

2. index - this yields a number between 1..n for an independent variable
	and a number between 1..m for a dependent variable or derivative.
	This is the second argument of "new".

3. multiIndex, repeatedIndex - you must implement one of these two, namely
	the one that corresponds to your chosen notation. The other one
	is then provided categorially. The result is the third argument of
	"new".

4. vartype - this is the above mentioned classification of the differential
	variables. vartype returns one of the following four strings:
	"Const", "Indep", "Dep","Deriv". This is the first argument of "new".

5. numIndVar, numDepVar - see above

6. notation - see above

	These eight methods are needed to uniquely generate and identify a
differential variable. Thus they are representation dependent and must be
provided by each domain in the category. The following methods are already
implemented at the level of the category:

7. convert, print, expr - business as usual in MuPAD

8. zero, one, iszero, isone - well, the real implementation of the first
	two is of course in "new" ...

9. order - obvious

10. diff - differentiation of a dependent variable or a derivative
	wrt an independent variable

11. integrate - inverse operation to diff

12. derivativeOf - checks whether one differential variable can be obtained
	by differentiation of another, returns the corresponding multi index

13. variables - list of all differential variables up to a given order

14. setRanking - with this method the user can choose his own ranking. There
	are two ways to use it. Each domain as an internal variable
	rankList that contains the names of all rankings provided by the
	domain. The user may give the name of one these as argument to
	setRanking or he passes as argument a complete procedures that
	can be used as _less. setRanking will set _less to this procedure.

15. orderLex, pureLex - two categorially provided rankings

	We will immediately provide two domains in this category.
Dom::DifferentialVariable implements the standard u_xx etc. notation. It
takes two arguments: a list of independent and a list of dependent variables.
I guess most users will stick to this domain. For most problems it is the
most natural representation. Theorist will, however, prefer Dom::Indexed-
DifferentialVariable. It takes five arguments: three identifiers, x,u,p and 
two integers n,m. The meaning of n,m is as above, the number of independent
and dependent variables. The names of the independent variables are then
x^1 .. x^n, the dependent variables are u^1 .. u^m and the derivatives are
of the form p^i_[..]. Thus opposed to the other domain we use the notation
"multi" here and not "repeated".

[will be unified: 
 Dom::DifferentialVariable([x,y], [u,v,w])
 would define the indep. vars x, y and the dep. vars u, v, w.

 Dom::DifferentialVariable(x[2], u[3], p)
 would define the indep. vars x[1], x[2], the dep. vars u[1]...u[3] and
 the derivatives p[i][J] (the output could be more TeX-like, of course).]

[A further option could define the preferred index notion.]

	Actually, most CA packages for PDEs that I know of are in fact
using indexed differential variables, typically with prescribed values
of x,u,p. However, for most moderately sized problems this notation is
rather cumbersome. I consider it as one of the main tasks of the whole
category to provide a user friendly interface. Users must be able to use
a natural and intuitive notation to enter differential variables. Other-
wise they will avoid the use of computer algebra as far as possible!

	Finally, the fine print. There is no need to distinguish between
ODEs and PDEs. Domains used for ODEs can be easily identified, as
numIndVar returns 1 for them. Well implemented domains make use of this
fact ... For the above mentioned hard core differential algebraist I
would like to provide an option and axiom "Abstract". In a domain with
this axiom, no independent variables exist and the method numIndVar is
renamed in numDeriv and returns the number of derivations. One might add
a second option "NonComm" to allow for non-commuting derivatives. In such
a domain only the "repeated" notation is possible. zero and one are
sometimes necessary for "special tasks". Imagine e.g. you want to implement
a domain for linear ODEs. A natural representation is a list of coefficients
and differential variables. But what to do with the inhomogeneous part?
Use the differential variable "one"!

Regards
						Werner


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
                      Werner M. Seiler                
wms@ira.uka.de                  Institut fuer Algorithmen und Kognitive Systeme
Tel.: (++49) 721-608-4043       Universitaet Karlsruhe
Fax.: (++49) 721-608-6116       D-76128 Karlsruhe, Germany
WWW: http://iaks-www.ira.uka.de/iaks-calmet/werner/werner.html
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

