Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
1

Residue calculation in Sagemath

asked 2 years ago

Anupamsage gravatar image

updated 2 years ago

I have done the following calculation in maple, I want to know if we can do it in Sagemath and write a code using the recursive definition. We construct a family of meromorphic function Wg,n(z1,z2,,zn). We consturct it recursively. The intial data given is the following.

y(z)=2sinh1(z/(2a)1/2)(z2+2a)1/2

where sinh(z) is sine hyperbolic funciton can be defined directly in maple as it is.

K(z):=1z(y(z)y(z))1/2az2+1/6z290a+z4378a223z628350a3+263z8935550a4133787z101277025750a5+157009z123831077250a616215071z14976924698750a7+2689453969z16389792954801250a8+O(z18)

K(z) we define using sinh(z) and take the Taylor series expansion to study the few terms.

Let W0,2(z1,z2):=1/(z1z2)2

Having this initial data we can construct a tower of Wg,n(z1,z2,,zn) as follows. Let me give few examples that I have computed by hand in maple.

Let's give some examples of how to generate families of functions W1,1=Resz=0K(z)1zz1W0,2(z,z)=1/24z12+3az14

Taking residue at z=0 means collecting the 1/z ceofficients. W0,3(z1,z2,z3)=Resz=0K(z)1zz1(W0,2(z1,z)W0,2(z2,z)+W0,2(z2,z)W0,2(z1,z))=az22z32z12

W1,2(z1,z2)=Resz=0K(z)1zz1(W0,3(z,z,z2)+W0,2(z,z2)W1,1(z)+W0,2(z,z2)W1,1(z))= 1/8(2az12+5a2)z24+(2az14+3a2z12)z22+5a2z14z16z26

So let's define Wg,n(z1,z2,,zn) in general by taking the residue of Wg1,n1(z,)Wg2,n2(z,)+Wg1,n+1()
along with the product K(z)1zz1. Wg1,n1(z1,z2,,zn1) represent meromorphic functions in n1 variables. And the sum is taken over all such possible combinations. And in case of Wg1,n+1(z,z,z2zn).

In general, if we can write a code where we can give the initial data and then will compute Wg,n(z1,z2,,zn). It should be a recursive definition. I maple I cannot compute more than (3,1) tuples. But with effective Dynamical programming, we definitely can do more. If someone shows me how to do the initial computation in sagemath, then I will try to write the general programme.

Preview: (hide)

Comments

@Anupamsage : your notation is ambiguous (unbalanced parentheses) ; could you check ?

EDIT : Edited, corrected and given as an answer.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2 years ago )

I have edited it now.

Anupamsage gravatar imageAnupamsage ( 2 years ago )

2 Answers

Sort by » oldest newest most voted
0

answered 2 years ago

dan_fulea gravatar image

updated 2 years ago

It is hard to understand in one breath what you have tried and what you finally want.

Here is a simple piece of code getting the residue for that W1,1, in code W11. The further implementation has from the point of view of the programmer nothing new to show up. Since i hate (typing) 2a i will use b instead.

var('z,b,z1');
assume(b > 0);

y = lambda z: 2*arcsinh( z / b ) / sqrt(z^2 + b^2)
K = lambda z: 1 / z / (y(z) - y(-z))
W02 = lambda z1, z2: 1/(z1 - z2)^2
W11 = lambda z1: ( K(z) / (z - z1) * W02(z, -z) ).residue(z == 0).canonicalize_radical()

print(f'W11(z1) = {W11(z1)}')

This prints:

W11(z1) = -1/48*(3*b^2 + 2*z1^2)/z1^4

There is nothing new involved while taking residues when implementing all the needed recursion. (Please provide code in a follow-up question, if something does not work on the path. Please try to reduce the questions to one issue each, and best this issue is of programatical nature.)

Preview: (hide)
link

Comments

Thanks will do that

Anupamsage gravatar imageAnupamsage ( 2 years ago )

I was computing as you shown for W12, though having correct answer for W11 and W03 I am not getting correct answer for W12, I have posted the question with the code here https://ask.sagemath.org/question/626... I have to use substiution function.

Anupamsage gravatar imageAnupamsage ( 2 years ago )
0

answered 2 years ago

Emmanuel Charpentier gravatar image

updated 2 years ago

I suppose that you meant :

y(z)=2arsinh(z2a)z2+2a

What's the point of working the Taylor series when the analytic answer is available ? Run :

var("z, a")
y(z)=sqrt(arcsinh(z/(2*a))/sqrt((z^2+2*a))

then :

sage: Poles=[u.rhs() for u in y(z).denominator().solve(z)] ; Poles
[-sqrt(2)*sqrt(-a), sqrt(2)*sqrt(-a)]
sage: [maxima_calculus.residue(y(z), z, u)._sage_() for u in Poles]
[0, 0]

BTW,

sage: (sinh(z).exponentialize()==x).solve(z)
[z == log(x - sqrt(x^2 + 1)), z == log(x + sqrt(x^2 + 1))]

No need for Taylor series here either, but a need for branch choice...

HTH,

Preview: (hide)
link

Comments

y(z)=2sinh1(z/(2a)1/2)(z2+2a)1/2

this is the function , so the sqroot on the numerator is on the inside of arcsinh

Anupamsage gravatar imageAnupamsage ( 2 years ago )

Can you confirm that you meant :

z  2arsinh(12za)z2+2a

In which case, K is :

z  12z(arsinh(12za)z2+2aarsinh(12za)z2+2a)

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2 years ago )

I meant arcsinh(z/(2a)) there is no square root over z inside the arcsinh.

Anupamsage gravatar imageAnupamsage ( 2 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2 years ago

Seen: 723 times

Last updated: May 17 '22