Exiu

15 Reputation

One Badge

0 years, 82 days

MaplePrimes Activity


These are replies submitted by Exiu

@Thomas Richard 
Thanks for your help! I will use subs in my code.

@Carl Love 

Wow, this command involves several advanced Maple programming techniques, I will try to understand it, I use the slow and naive way to do this:

fullparfrac1.mw
 

``

f := convert((x^3+2*x+1)/((x^2+1)*(x^2+2)), fullparfrac, x, true)

Sum((-(1/2)*_alpha+1/2)/(x-_alpha), _alpha = RootOf(_Z^2+1))+Sum((1/4)*_alpha/(x-_alpha), _alpha = RootOf(_Z^2+2))

(1)

fr := convert(f, radical)

(1/2-(1/2)*I)/(x-I)+(1/2+(1/2)*I)/(x+I)+((1/4)*I)*2^(1/2)/(x-I*2^(1/2))-((1/4)*I)*2^(1/2)/(x+I*2^(1/2))

(2)

L := `~`[convert](fr, list, `+`)

[(1/2-(1/2)*I)/(x-I), (1/2+(1/2)*I)/(x+I), ((1/4)*I)*2^(1/2)/(x-I*2^(1/2)), -((1/4)*I)*2^(1/2)/(x+I*2^(1/2))]

(3)

denom(L[1])

-2*x+2*I

(4)

numer(L[1])

-1+I

(5)

````

``

NULL

#if alpha can not be represented explicit,then

g := convert((x^3+2*x+1)/(x^6-4*x^3+9*x^2-1), fullparfrac, x)

Sum(((2416/28239)*_alpha^5+(1751/56478)*_alpha^4+(34/9413)*_alpha^3-(3522/9413)*_alpha^2+(34903/56478)*_alpha+1683/9413)/(x-_alpha), _alpha = RootOf(_Z^6-4*_Z^3+9*_Z^2-1))

(6)

gr := convert(g, radical)

((2416/28239)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)^5+(1751/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)^4+(34/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)^3-(3522/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)^2+(34903/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)+1683/9413)/(x-RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1))+((2416/28239)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 2)^5+(1751/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 2)^4+(34/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 2)^3-(3522/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 2)^2+(34903/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 2)+1683/9413)/(x-RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 2))+((2416/28239)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 3)^5+(1751/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 3)^4+(34/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 3)^3-(3522/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 3)^2+(34903/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 3)+1683/9413)/(x-RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 3))+((2416/28239)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 4)^5+(1751/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 4)^4+(34/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 4)^3-(3522/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 4)^2+(34903/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 4)+1683/9413)/(x-RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 4))+((2416/28239)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 5)^5+(1751/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 5)^4+(34/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 5)^3-(3522/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 5)^2+(34903/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 5)+1683/9413)/(x-RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 5))+((2416/28239)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 6)^5+(1751/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 6)^4+(34/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 6)^3-(3522/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 6)^2+(34903/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 6)+1683/9413)/(x-RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 6))

(7)

``

P := `~`[convert](gr, list, `+`)

[((2416/28239)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)^5+(1751/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)^4+(34/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)^3-(3522/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)^2+(34903/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)+1683/9413)/(x-RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)), ((2416/28239)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 2)^5+(1751/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 2)^4+(34/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 2)^3-(3522/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 2)^2+(34903/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 2)+1683/9413)/(x-RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 2)), ((2416/28239)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 3)^5+(1751/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 3)^4+(34/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 3)^3-(3522/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 3)^2+(34903/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 3)+1683/9413)/(x-RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 3)), ((2416/28239)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 4)^5+(1751/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 4)^4+(34/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 4)^3-(3522/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 4)^2+(34903/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 4)+1683/9413)/(x-RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 4)), ((2416/28239)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 5)^5+(1751/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 5)^4+(34/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 5)^3-(3522/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 5)^2+(34903/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 5)+1683/9413)/(x-RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 5)), ((2416/28239)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 6)^5+(1751/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 6)^4+(34/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 6)^3-(3522/9413)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 6)^2+(34903/56478)*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 6)+1683/9413)/(x-RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 6))]

(8)

denom(P[1])

-56478*x+56478*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)

(9)

numer(P[1])

-4832*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)^5-1751*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)^4-204*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)^3+21132*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)^2-34903*RootOf(_Z^6-4*_Z^3+9*_Z^2-1, index = 1)-10098

(10)

``


 

Download fullparfrac1.mw

 

@vv 

Thank you for your reply!

@Carl Love 

Thank you for your answer. I used the convert command to get what I wanted, but I still want to extract \alphaα, or more precisely, the minimal polynomial of \alphaα. In the output of the result, α\alphaα is not evaluated, and I want to extract the numerator and denominator (especially the multiplicity of the denominator). However, I am unsure about the data structure of the output. Do you have any ideas on how to approach this problem?
 

f := convert((x^3+2*x+1)/((x^2+1)*(x^2+2)), fullparfrac, x, true)

Sum((1/4)*_alpha/(x-_alpha), _alpha = RootOf(_Z^2+2))+Sum((-(1/2)*_alpha+1/2)/(x-_alpha), _alpha = RootOf(_Z^2+1))

(1)

_alpha

_alpha

(2)

L := `~`[convert](f, list, `+`)

[Sum((1/4)*_alpha/(x-_alpha), _alpha = RootOf(_Z^2+2)), Sum((-(1/2)*_alpha+1/2)/(x-_alpha), _alpha = RootOf(_Z^2+1))]

(3)

denom(L[1])

1

(4)

numer(L[1])

Sum((1/4)*_alpha/(x-_alpha), _alpha = RootOf(_Z^2+2))

(5)

NULL


 

Download fullparfrac.mw

I try to use this command in the procedure, but there is a problem:

"Error, (in eval/diff) non-algebraic expressions cannot be differentiated',

The procedure is the following:


polydalg := proc(p, F, f)

local x::name, d, r, DE1, ev, co, de, a, j, poly, G, R, L;

x::name := op(f); d := degree(p, x); r := PDEtools:-difforder(F);

while r < d + 1 do DE1 := lhs(F) - rhs(F);

ev := eval(DE1, op(0, f(x)) = (x -> sum(a[i]*x^i, i = 0 .. r + 1)));

co := convert(series(ev, x), polynom); de := degree(co, x);

L := [coeffs(co, x)];

j := 1;

while j < nops(L) + 1

do

if coeff(L[j], a[r + 1], 1) = 0

then j := j + 1;

else return solve(L[j], a[r + 1]);

end if;

end do;

r := r + 1;

end do;

poly := sum(coeff(p, x, i)*a[i]*x^i, i = 0 .. d);

return poly;

end proc;
 

when i want to use this procedure, 
 

G := x^3 + 3*(x^2 + x + 1)*f(x) + (x + 2)*diff(f(x), x) + x*diff(f(x), x $ 2) = 0;
B := 23*x^3 + 75*x^2 - 92*x + 6;
polydalg(B, G, f(x));

there is the error:
Error, (in eval/diff) non-algebraic expressions cannot be differentiated
 

I don't know why



 

@vv Thanks so much! Ok, next time I will post text .

Page 1 of 1