|
FunctionSupportIdeas
Collects ideas to support undefined function
IntroductionAn undefined applied function, f(x), can be currently represented as Algebra(APPLY, (f, x)) where f and x are algebra symbols. This representation is not optimal because
A solution is to introduce separate algebra for functions where undefined functions would be symbols, calculus elements would be numbers, and differential operators would be algebra functions. More details follow below. References: http://en.wikipedia.org/wiki/Function_(mathematics) Constructing functionsf = Function('f') # undefined unapplied function with a name `f`
g = Function(g_callable) # defined unapplied function
h = Function(<Calculus instance>) # constant unapplied functionTo specify the domain and value set of a function, use Function(name, <domain>, <value algebra>) where <domain> is a tuple of algebra classes or just a algebra class. By default, <domain>=Calculus and <value algebra>=Calculus. The number of arguments is specified by the length of the <domain> tuple. For example, Function('f', (Calculus, Calculus), Calculus) # undefined unapplied function with 2 arguments.Will we support Function('f', nargs=2)? Implementation notes
<FunctionRing subclass>(SYMBOL, 'f') # undefined unapplied function
<FunctionRing subclass>(NUMBER, <Calculus instance>) # constant unapplied function
<FunctionRing subclass>(TERMS, {f:2, g:3}) # linear combination of unapplied functions: 2*f + 3*gInquiring domain informationIf f=Function('f') then f.nargs -> number of arguments, default is 1 f.argument_algebras -> tuple of argument algebras, default is (Calculus,) f.value_algebra -> value algebra class, default is Calculus Differential operator supportD[i] - 1-st partial derivative with respect to i-th argument, i is integer D[x] - 1-st partial derivative with respect to x D[i]**n - n-th partial derivative with respect to i-th argument D[x]**n - n-th partial derivative with respect to x D[i]**n * D[j]**m - (n+m)-th partial derivative with respect to i-th (n-times) and j-th (m-times) argument D[x]**n * D[y]**m - (n+m)-th partial derivative with respect to x (n-times) and y (m-times) D[i] + D[j] - represents a sum of differential operators. Notes:
Unresolved issues
|
Sign in to add a comment