Dear Viktor,
ad 1) I really had difficulties to see the case where this message appears.
Then I found, that
subst does not work, if the
poly or number in which we want to substitute has
denominators in the parameters.
So this trivial examples fails:
Code:
> ring rt = (0,t),x,dp;
> subst(2/t,t,t);
// ** ignoring denominators of coefficients...
2
but (yes!) I found a solution. See the proc
parsubst below.
The idea is, first to clear the denominator, then use
subst and divide by the substituted denominator again.
Some care must be taken for the following cases:
i) if the input only consists of a parameter, then
cleardenom returns 1.
Here I multiply first with a ring variable, (hopefully this
will not change the result in the non-commutative case),
ii) if f(0)=0, we can not recover the denominator.
Therefore, I add a constant.
This two operations will be reversed at the end.
The example above and substitution as you mention will work.
Code:
> parsubst(2/t,t,t);
2/(t)
> parsubst(2/t,t,(2t+4)/(3t+1))
(3t+1)/(t+2)
> // example parsubst
> number q = (3t+4)/(2t+3);
> parsubst(1/t,t,q);
> poly f = t/(t-1)*x2 + 2/t;
> parsubst(f,t,q);
(3t+4)/(t+1)*x2+(4t+6)/(3t+4)
Code:
proc parsubst(poly f,number t,number q)
" USAGE: parsubst(f,t,q); f poly or number, t number, q number
RETURN: poly, resp. number as the input type
ASSUME: t is a parameter of the basering
EXAMPLE: example parsubst; shows an example
"
{
int is_constant = deg(f)==0;
if (is_constant) { f = f*var(1); } // f was a number
int zero_const_term = jet(f,0)==0;
if (zero_const_term) { f = f + 1;} //otherwise denom is lost
poly g = cleardenom(f);
number commondenom = leadcoef(g)/leadcoef(f);
f = subst(g,t,q)/subst(commondenom,t,q);
if (zero_const_term) { f = f - 1;}
if(is_constant) { f = f/var(1);}
return(f);
}
example
{
"EXAMPLE:"; echo = 2;
ring r=(0,t),x,dp;
number q = (3t+4)/(2t+3);
parsubst(1/t,t,q);
poly f = t/(t-1)*x2 + 2/t;
parsubst(f,t,q);
}
ad 2) If I understand correctly, then theta(x) would form
an rational expression built on variables?
Best regards,
Christian