On Tuesday, April 2, 2019 at 7:36:32 AM UTC-7, Christopher Duston wrote:
>
> I have been doing a demo of Maple, and have run into something it cannot
> do that I need for my work. I thought I would toss it over here, and see if
> Sage can do it.
>
> I want to determine the residue of integrals of the type exp(-z/A)/z^n,
> where n is an integer and A is a constant. I was told by someone on the
> help forums at Maple that "Maple cannot compute the residue at a pole with
> symbolic order", referring to the unspecified integer n.
>
> I think based on the result:
sage: var("z,A,n")
sage: assume(n,"integer")
sage: fz=exp(-z/A)/z^n
sage: fz.series(z,3)
(1/(0^n)) + (-0^(n - 1)*n/0^(2*n) - 1/(0^n*A))*z + (-1/2*0^(n -
2)*n^2/0^(2*n) + 1/2*0^(n - 2)*n/0^(2*n) + 0^(2*n - 2)*n^2/0^(3*n) + 0^(n -
1)*n/(0^(2*n)*A) + 1/2/(0^n*A^2))*z^2 + Order(z^3)
the answer is no. You can ask for fz.residue(z==0), but that will base its
result on the answer above and thus return 0. It would be better if we'd
get an error instead.
Knowing where the n comes into the expression does allow us to get a
non-symbolic expression that does the right thing:
sage: res=lambda n:exp(z/A).series(z,n).coefficient(z,n-1)
and basically shows you one place where this would need work: We'd need to
somehow get the formal power series for exp(z):
sage: sum(z^n/factorial(n),n,0,oo,hold=True)
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.