OreTools[Converters]
FromOrePolyToLinearEquation
convert an OrePoly structure to the corresponding linear functional equation
FromLinearEquationToOrePoly
convert a linear functional equation to the corresponding OrePoly structure
AddConversionRule
add conversion rules to FromLinearEquationToOrePoly
FromOrePolyToPoly
convert an OrePoly structure to the corresponding polynomial
FromPolyToOrePoly
convert a polynomial to the corresponding OrePoly structure
Calling Sequence
Parameters
Description
Examples
FromOrePolyToLinearEquation (Ore, f, A)
FromLinearEquationToOrePoly (expr, f, A)
AddConversionRule (CaseName, ConvertProc)
FromOrePolyToPoly(Ore, x)
FromPolyToOrePoly(P, x)
Ore
-
Ore polynomial; to define an Ore polynomial, use the OrePoly structure.
f
name; dependent variable
A
Ore algebra; to define an Ore algebra, use the SetOreRing function.
expr
expression; linear functional equation
CaseName
name; labels the new conversion case
ConvertProc
procedure; algorithm for converting a linear functional equation to an Ore polynomial
x
name; noncommutative indeterminate
P
polynomial
The FromOrePolyToLinearEquation(Ore, f, A) calling sequence converts the Ore polynomial Ore to the corresponding linear functional equation.
The FromLinearEquationToOrePoly(expr, f, A) calling sequence converts the linear functional equation expr to the corresponding Ore polynomial. The Ore polynomial is returned as an OrePoly structure.
The FromLinearEquationToOrePoly command currently supports only the shift and differential cases.
The AddConversionRule(CaseName, ConvertProc) command adds a new conversion rule from a linear equation to an Ore polynomial to be used by the FromLinearEquationToOrePoly command.
The ConvertProc procedure must accept three arguments: linear functional equation, name of dependent variable, and Ore algebra; and return an Ore polynomial as an OrePoly structure.
The FromOrePolyToPoly(Ore, x) calling sequence converts the Ore polynomial Ore to the corresponding polynomial.
The FromPolyToOrePoly(P, x) calling sequence converts the polynomial P to the corresponding Ore polynomial. The Ore polynomial is returned as an OrePoly structure.
with⁡OreTools:
with⁡OreToolsConverters:
Define the differential algebra.
A≔SetOreRing⁡x,differential
A≔UnivariateOreRing⁡x,differential
L≔OrePoly⁡1,−x,x2+C⁢x
L≔OrePoly⁡1,−x,C⁢x+x2
eq≔FromOrePolyToLinearEquation⁡L,f,A
eq≔f⁡x−x⁢ⅆⅆxf⁡x+C⁢x+x2⁢ⅆ2ⅆx2f⁡x
FromLinearEquationToOrePoly⁡eq,f,A
OrePoly⁡1,−x,C⁢x+x2
To convert a linear difference equation to an OrePoly structure, first define the difference polynomial ring.
A := SetOreRing(n, 'difference', 'sigma' = proc(p, x) eval(p, x=x+1) end, 'sigma_inverse' = proc(p, x) eval(p, x=x-1) end, 'delta' = proc(p, x) eval(p, x=x+1) - p end, 'theta1' = 0);
A≔UnivariateOreRing⁡n,difference
Consider the following difference operator.
L≔OrePoly⁡n4n−1,n4−n3,n−1n+2
Convert L to a linear difference equation.
eq≔FromOrePolyToLinearEquation⁡L,s,A
eq≔n4⁢s⁡nn−1+n4−n3⁢s⁡n+1−s⁡n+n−1⁢s⁡n+2−2⁢s⁡n+1+s⁡nn+2
The FromLinearEquationToOrePoly function cannot convert eq to the corresponding OrePoly structure.
FromLinearEquationToOrePoly⁡eq,s,A
Error, (in OreTools:-Converters:-FromLinearEquationToOrePoly) unable to handle the difference case
You must define the rule for the difference case.
difference_case := proc(eq, func, A) local reqn, info, fcn, E, receq, req, func_set, n, place, i, var; var := OreTools[Properties][GetVariable](A); # Do some argument checking and processing reqn := LREtools['REcreate'](eq, func(var), {}); info := eval(op(4, reqn)); if info['linear']=false then error "only linear equations are handled" end if; n := info['vars']; if not (nops([n])=1 and type(n, name)) then error "only single equations are handled" end if; fcn := op(2, reqn)[1]; # locate n in arguments to fcn for place to nops(fcn) while op(place, fcn) <> n do end do; # Transform the equation from a difference equation to a # difference operator req := args[1]; func_set := indets(req, specfunc(anything, info['functions'])); receq := collect( subs( map( (x, y, z, i) -> x = (z+1)^(op(i, x)-y), func_set, n, 'E', place), req), 'E', Normalizer); 'OrePoly'(seq(coeff(receq, 'E', i), i=0..degree(receq, 'E'))) end proc:
Add this rule to OreTools, and then use the FromOrePolyToLinearEquation function again.
AddConversionRule⁡difference,difference_case
OrePoly⁡n4n−1,n4−n3,n−1n+2
Ore≔OrePoly⁡n,n−1,1n
q≔FromOrePolyToPoly⁡Ore,S
q≔n+n−1⁢S+S2n
FromPolyToOrePoly⁡q,S
OrePoly⁡n,n−1,1n
See Also
args
coeff
collect
error
eval
indets
LREtools[REcreate]
map
nops
op
OreTools
OreTools/OreAlgebra
OreTools/OrePoly
OreTools[Properties][GetVariable]
OreTools[SetOreRing]
proc
seq
subs
type/name
Download Help Document