The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Rational functions Polynomial expansion.....[partfrac or cpartfrac]:
08-20-2015, 09:57 AM (This post was last modified: 08-24-2015 01:58 AM by toshk.)
Post: #1
Rational functions Polynomial expansion.....[partfrac or cpartfrac]:
    coded to Solve!
    Prime Solve!
Don't have Hp prime to test it......but works on virtual fine.

PHP Code:
#pragma mode( separator(.,;) integer(h32) )
Residue1();
Residue2();
#cas
Residues(f)
BEGIN
local n
,a,ms,M1,denmnummm:=0;
L1:={};L0:={};L3:={};L4:={};L2:={};
f:=exact(f);
f1:=numer(f);
f2:=denom(f);
numm:=coeff(numer(expand(f)));
denm:=coeff(denom(expand(f)));
IF 
degree(numm)>=degree(denmTHEN a:=quo(numm,denm); else a:=0;END;
M1:=proot(denm);
M1:=sort(M1);
ms:=size(M1);
L0:=(mat2list(M1));
A:=0;B:=1;
REPEAT ms:=size(L0); L2:=remove(L0(1),L0); ms2:=size(L2);A:=ms-ms2;
IF 
A==OR A==0 then Residue1();else Residue2();end;
UNTIL size(L0)==0;
msgbox("F(x)=(r1/(x-p1))+(r2/x-p2)+.....+K[polynomial]");
msgbox("if p1=p2=!p3,then F(x)=(r1/(x-p1)^2)+r2/(x-p2)+r3/(x-p3)+....+K[polynomial]");
return{
r=list2mat(L4,1),p=trn(M1),k=a};
END;
#end

#cas
Residue1()
BEGIN
local n
,fa,derf,derfa
derf:=diff(f2,x);
fa:=subst(f1,x=L0(1));
derfa:=subst(derf,x=L0(1));
n:=fa/derfa;
L4(B):=n;
B++;
L0:=L2;
END;
#end

#cas
Residue2()
BEGIN
local n
,ffa,c,ff1,ff2;
c:=A;
ff2:=subst(simplify(f*(x-L0(1))^c),x,L0(1)); L4(B):=ff2B++;
ff1:=simplify(f*(x-L0(1))^c);
FOR 
n FROM 1 TO A-1 STEP 1 DO
ff1:=simplify(diff(ff1,x));
ffa:=1/(A-1)!*subst(ff1,x=L0(1));
L4(B):=ffa;
B++;
end;
L0:=L2;
END;
#end 
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Rational functions Polynomial expansion.....[partfrac or cpartfrac]: - toshk - 08-20-2015 09:57 AM



User(s) browsing this thread: 1 Guest(s)