Christian Wolinski

MaplePrimes Activity


These are replies submitted by Christian Wolinski

@Preben Alsholm "For i from i do" means "resume i". Initially I reused that loop to get the result I wanted. Now I've simply copied it twice.

@Carl Love I just saw this: PolynomialTools, Split. Thats what it is.

@Preben Alsholm Maple V, Release 4 (1996).


It looks like a coding slip up, easy fixed.

@Carl Love `evala/toprof` given a parameter containing RootOfs chooses one RootOf in the expression, not used in parameter of any other RootOfs or functions in the expression.

@Markiyan Hirnyk Oh, I see now, residue introduces radicals. That should not be. Can you keep it in RootOf notation, for example using series and coeff?

Still I do not know what has caused the divergence. Also, I seem to have somehow omitted an important element regarding use of RootOfs. I added seq((evala@Expand)(Y*Z^i), i = 0 .. d - 1).

 

alias(beta=RootOf(RootOf(_Z^4+2*_Z^2+2)^2+_Z^2+2),alpha=RootOf(_Z^4+2*_Z^2+2));
C0 := rationalize(expand(2^(1/4)*exp(3/8*I*Pi)));
P := z^2 / (z^4 + 2*z^2 + 2)^2;
Pf := numer(P) / (evala@AFactor)(denom(P),z);
Pfs := select(`@`(evalb, 0 = evalc, evala, Norm, `+`), map2(op, 1, (roots@denom)(Pf)), -C0);


QRatpolyResidue := proc(Pf, z, Pfs, C0)
local ANS, R, X, Y, Z, W, Wn, A, k, d, i;
    A := NULL;
    for R in Pfs do
        #ANS := evala(residue(Pf, z = R));
        ANS := evala(coeff(series(Pf, z = R, 1 + degree(numer(Pf), z) + degree(denom(Pf), z)), z - R, -1));
        print(Residue, R, ANS);
        X := R - k;
        Y := X;
        W := NULL;
        Wn := NULL;
        while hastype(Y, RootOf) do
            Z := `evala/toprof`(Y);
            d := frontend(degree, [op(1, Z), _Z], [{Non}(function), {}]);
            W := W, seq((evala@Expand)(Y*Z^i), i = 0 .. d - 1);
            print(Degree, Z, d);
            Wn := Wn, Z;
            Y := (evala@Norm)(Y, {Z}, indets(Y, RootOf) minus {Z})
        od;
        print(Basis, W);
        print(Ordering, Wn);
        ANS := frontend(factor@simplify, [ANS, [W], [Wn, k]],
            [({Non}@map)(identical, {Wn}), {}]);
        print(Simplified, ANS);
        ANS := map(radnormal, subs(k = C0, ANS));
        print(Result, ANS);
        A := A, ANS
    od;
    A
end;

ANS := {QRatpolyResidue}(Pf, z, Pfs, C0);
ANS2 := {QRatpolyResidue}(Pf, z, Pfs, k), k = C0;

returns:

C0 := 2^(1/4)*(-1)^(3/8)
P := z^2/(z^4+2*z^2+2)^2
Pf := z^2/(z-beta)^2/(z+alpha)^2/(z+beta)^2/(z-alpha)^2
Pfs := [alpha, -beta, -alpha, beta]

Residue   alpha   -3/32*alpha^3-1/16*alpha
Degree   alpha   4
Basis   alpha-k   alpha^2-alpha*k   alpha^3-alpha^2*k   -2*alpha^2-2-alpha^3*k
Ordering   alpha
Simplified   -1/32*k*(2+3*k^2)
Result   (1/32-3/32*I)*2^(1/4)*(-1)^(3/8)
Residue   -beta   -3/32*alpha^2*beta-1/8*beta
Degree   beta   2
Degree   alpha   4
Basis   -beta-k   alpha^2+2-beta*k   alpha^2+2+k^2   alpha^3+2*alpha+alpha*k^2
  -2+alpha^2*k^2   -2*alpha+alpha^3*k^2
Ordering   beta   alpha
Simplified   -1/32*k*(2+3*k^2)
Result   (1/32-3/32*I)*2^(1/4)*(-1)^(3/8)
Residue   -alpha   3/32*alpha^3+1/16*alpha
Degree   alpha   4
Basis   -alpha-k   -alpha^2-alpha*k   -alpha^3-alpha^2*k   2*alpha^2+2-alpha^3
*k
Ordering   alpha
Simplified   -1/32*k*(2+3*k^2)
Result   (1/32-3/32*I)*2^(1/4)*(-1)^(3/8)
Residue   beta   3/32*alpha^2*beta+1/8*beta
Degree   beta   2
Degree   alpha   4
Basis   beta-k   -alpha^2-2-beta*k   alpha^2+2+k^2   alpha^3+2*alpha+alpha*k^2
  -2+alpha^2*k^2   -2*alpha+alpha^3*k^2
Ordering   beta   alpha
Simplified   -1/32*k*(2+3*k^2)
Result   (1/32-3/32*I)*2^(1/4)*(-1)^(3/8)
ANS := {(1/32-3/32*I)*2^(1/4)*(-1)^(3/8)}
Residue   alpha   -3/32*alpha^3-1/16*alpha
Degree   alpha   4
Basis   alpha-k   alpha^2-alpha*k   alpha^3-alpha^2*k   -2*alpha^2-2-alpha^3*k
Ordering   alpha
Simplified   -1/32*k*(2+3*k^2)
Result   -1/32*k*(2+3*k^2)
Residue   -beta   -3/32*alpha^2*beta-1/8*beta
Degree   beta   2
Degree   alpha   4
Basis   -beta-k   alpha^2+2-beta*k   alpha^2+2+k^2   alpha^3+2*alpha+alpha*k^2
  -2+alpha^2*k^2   -2*alpha+alpha^3*k^2
Ordering   beta   alpha
Simplified   -1/32*k*(2+3*k^2)
Result   -1/32*k*(2+3*k^2)
Residue   -alpha   3/32*alpha^3+1/16*alpha
Degree   alpha   4
Basis   -alpha-k   -alpha^2-alpha*k   -alpha^3-alpha^2*k   2*alpha^2+2-alpha^3
*k
Ordering   alpha
Simplified   -1/32*k*(2+3*k^2)
Result   -1/32*k*(2+3*k^2)
Residue   beta   3/32*alpha^2*beta+1/8*beta
Degree   beta   2
Degree   alpha   4
Basis   beta-k   -alpha^2-2-beta*k   alpha^2+2+k^2   alpha^3+2*alpha+alpha*k^2
  -2+alpha^2*k^2   -2*alpha+alpha^3*k^2
Ordering   beta   alpha
Simplified   -1/32*k*(2+3*k^2)
Result   -1/32*k*(2+3*k^2)
ANS2 := {-1/32*k*(2+3*k^2)}, k = 2^(1/4)*(-1)^(3/8)

@Carl Love What does `evala/toprof`(Pf); `evala/toprof`(indets(Pf,RootOf)); return? ANS2 should contain variable k. If it does not then what would explain this? Also I added a print command.

I am editing too much. The codes work flawlessly in Maple V R4. I wonder in which version the discontinuity occurs.

@Markiyan Hirnyk It appears _EnvExplicit:=true; is being used, converting all RootOfs into radicals. Lets see if _EnvExplicit:=false; would change that.

@Carl Love roots or evala@Roots or another? Which is better?

@Carl Love Thank you for your help. It appears roots command does not succeed. I'll change it to evala@Roots.

I ask, what command would you use to obtain roots of a factored polynomial?

@Carl Love I suppose split is the same thing as evala@AFactor. I tested it. It seems to work. I already edited my original answer.

@Dave L If you do that you should state the author of the statement you edit.

@Carl Love I have forgotten about this option completely, my apology. Unfortunately I have no access to the Groebner package. I can only suggest using method=buchberger and plex(X,Q). Quote from the help file for GB:

- GB is an implementation of Buchberger's algorithm for computing Grobner bases
  over Zp(a,b,...)[x1, ..., xn].
      
- GB(F,X,termorder) computes the reduced, minimal Grobner basis of the
  polynomials F with respect to the indeterminates X and the given term order-
  ing.      

No help otherwise.

..Also the basis you quoted is identical to tdeg basis.

@testht06 

Your definitions for x and q are:

 

L := 1+X+X^6+X^7+X^8, (X^3+X+1)*Q+Q^3+(X^7+X^6+X^4+1)*Q^2+X^7+X^6+X^4+X^3+X^2+X+1;

so the monic for Q is what you seek and it is obtained with:

 

GB([L], [X, Q], plex) mod 2;

@roman_pearce Thank You, that is precisely the function I needed. But also I was wondering if there is any support for this from side of Maple (even though the solution is so simple).

 

First 16 17 18 19 20 21 Page 18 of 21