home *** CD-ROM | disk | FTP | other *** search
-
- (****************************************************************************
- * Evaluation Multiple Poles Meijer's G-function
- *
- *****************************************************************************)
-
- MeijerLogCase[parn_,parp_,parm_,parq_,arg_ ] :=
- Module[ {answer={},grpoles,grzero},
- grpoles = FindGroupsPoles[ parm ];
- For[ i=1,i<=Length[grpoles],i++,
- grzero = OneGroupZero[ grpoles[[i,1]],parp,{} ][[3]];
- If[ Length[grzero] != 0,
- answer = Append[answer,OrderPoles[
- Join[ Map[ {#,1}&, grpoles[[i]] ],
- Map[ {#,-1}&,grzero ]]]],
- answer = Append[answer,OrderPoles[
- Map[ {#,1}&, grpoles[[i]] ]]]
- ]
- ];
- answer =
- Apply[ Plus,Map[
- EvalResidues[#,parn,parp,parm,parq,arg]&,CountMultiple[answer] ] ];
- answer//.PolyGammaRule
- ]
-
-
- FindGroupsPoles[v_] := OneGroup[ v[[1]], Rest[v], {v[[1]]} ]
-
- FindGroupsPoles[v_] := {} /; Length[v] == 0
-
- OneGroup[ a_,{v1___,b_,v2___},c_ ] :=
- OneGroup[ a, {v1,v2}, Append[c,b] ] /; IntegerQ[Expand[a-b]]
-
- OneGroup[ a_,b_,c_ ] := Append[ FindGroupsPoles[b],c ]
-
- OneGroupZero[ a_,{v1___,b_,v2___},c_ ] :=
- OneGroupZero[ a, {v1,v2}, Append[c,b] ] /; IntegerQ[Expand[a-b]]
-
-
- OrderPoles[{c1___,a_,c2___,b_,c3___}] :=
- OrderPoles[{c1,b,c2,a,c3}] /; Expand[a[[1]]-b[[1]]] > 0
-
- OrderPoles[{c___}] := {c}
-
- CountMultiple[ v_ ] := Flatten[ Map[CountInGroup[#]&,v],1 ]
-
-
- CountInGroup[v_] :=
- Module[ {u=v,kr=0,answer={}},
- While[ Length[u] !=0,
- If[ u[[1,2]] == 1, kr += 1, kr -= 1 ];
- If[ kr > 0,
- If[Length[Rest[u]] != 0,
- If[Not[SameQ[ u[[1,1]],u[[2,1]] ]],
- PrependTo[answer,
- {kr,Expand[u[[2,1]]-u[[1,1]]],-u[[1,1]]}
- ] ],
- If[kr > 1, Return[FailInt],PrependTo[ answer,
- {kr,"Infinity",u[[1,1]]} ]]
- ]];
- u = Rest[u] ];
- answer
- ]
-
-
- EvalResidues[{order_,quantity_,at_},parn_,parp_,parm_,parq_,arg_] :=
- If[MemberQ[parm,at],
- FinalGfunToHyper[
- at,parn,parp,First[ReducePar[parm,{at}]],parq,arg],
- SpecialTransf[at,
- parn,Append[parp,at],Append[parm,at],parq,arg]
- ] /;
- order == 1 && quantity==="Infinity"
-
- SpecialTransf[at_,parn_,{v1___,b_,v2___},{v3___,a_,v4___},parq_,arg_] :=
- (-1)^(b-a) SpecialTransf[at, Append[parn,a+1],{v1,v2},{v3,v4},
- Append[parq,2 a -b + 1],arg ] /;
- IntegerQ[Expand[b-a]] && Expand[b-a] > 0
-
-
- SpecialTransf[at_,parn_,parp_,parm_,parq_,arg_] :=
- Module[ {r},
- r = ReducePar[parn,parq];
- FinalGfunToHyper[
- at,r[[1]],parp,First[ReducePar[parm,{at}]],r[[2]],arg]
- ]
-
- EvalResidues[{order_,quantity_,at_},parn_,parp_,parm_,parq_,arg_] :=
- Module[ {rr,eps},
- rr =
- Normal[ Series[
- Normal[ Apply[Series,{ Apply[ Times,
- Map[GammaRes[#,-eps,order]&,1-parn-at] ],
- {eps,0,order-1} }] ] *
- Normal[ Apply[Series,{ Apply[ Times,
- Map[GammaRes[#, eps,order]&, parm+at ] ],
- {eps,0,order-1} }] ] *
- Normal[ Apply[Series,{ Apply[ Times,
- Map[GammaResInv[#, eps,order]&, parp+at ] ],
- {eps,0,order-1} }] ] *
- Normal[ Apply[Series,{ Apply[ Times,
- Map[GammaResInv[#,-eps,order]&,1-parq-at] ],
- {eps,0,order-1} }] ] *
- Normal[ Series[Exp[-eps Log[arg]],{eps,0,order-1}]] arg^(-at),
- {eps,0,order-1}]];
- Expand[ Coefficient[ rr,eps,Exponent[rr,eps] ]]
- ]/;quantity =!= "Infinity"
-
-
- GammaRes[u_,e_,1] :=
- (-1)^(-u) /Gamma[1-u] /;IntegerQ[u] && u <= 0
-
- GammaRes[u_,e_,2] :=
- (-1)^(-u) (1 + PolyGamma[1-u] e)/Gamma[1-u] /;IntegerQ[u] && u <= 0
-
- GammaRes[0,e_,n_] := GammaRes[1,e,n]
-
- GammaRes[u_,e_,n_] :=
- (-1)^(-u) GammaRes[1,e,n] GammaRes[1,-e,n] GammaResInv[1-u,-e,n] /;
- IntegerQ[u] && u < 0
-
- GammaRes[u_,e_,n_] := Normal[ Series[Gamma[u+e],
- {If[Head[e] === Symbol,e,-e],0,n-1}] ]
-
- GammaResInv[u_,e_,n_] := Normal[ Series[1/Gamma[u+e],
- {If[Head[e] === Symbol,e,-e],0,n-1}] ]
-
-