Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How simplify bessel function ?

Hello,

I'm studying Helmholtz equation in cylindrical coordinates. I'm using a solution of the scalar Helmholtz equation to build a vector field that could be a solution of the vector Helmholtz equation.

Here is my code with an orthonormal basis in a 3D manifold with cylindrical coordinates. Normally, SVH should be equal to 0 (actually, it is), but Sage doesn't simplify. I've used the simplify function, but it doesn't work. Can someone help me?

%display latex

from sage.manifolds.operators import *

E = Manifold(3,coordinates='cylindrical', name='E') # 3D Manifold in cylindrical coord

Ecyl.<r,ph,z> = E.chart(r'r:(0,+oo) ph:(0,2*pi):\phi z')

k = var('k')

assume(k>=0)

to_orthonormal = E.automorphism_field() # Orthonormal basis q

to_orthonormal[0,0] = 1

to_orthonormal[1,1] = 1/r

to_orthonormal[2,2] = 1

q = Ecyl.frame().new_frame(to_orthonormal, 'q')

E.set_default_frame(q)

eta = E.metric(name='eta', latex_name=r'\eta') #Minkowski metric

eta[0,0] = 1

eta[1,1] = 1

eta[2,2] = 1

h = E.scalar_field(bessel_J(0,sqrt(k^2)r)cos(0z)cos(0*ph), name='h') #Helmholtz equation solution in cylindrical coord

k2 = -h.laplacian(eta)*h^(-1) # Determination of k^2

H = h(rq[0]+z*q[2]) #Definition of a vector field H such that O is a vectorial Helmholtz equation solution

O = H.curl(metric=eta)

SHV = O.laplacian(eta) + k2*O

SHV.display()

Sage solution : -1/4((2bessel_J(2, kr)bessel_J(1, kr) - bessel_J(3, kr)bessel_J(0, kr) + bessel_J(1, kr)bessel_J(0, kr))k^3r^2 - 2(2bessel_J(1, kr)^2 - bessel_J(2, kr)bessel_J(0, kr) + bessel_J(0, kr)^2)k^2r + 4kbessel_J(1, kr)bessel_J(0, kr))z/(r^2bessel_J(0, kr))

How simplify bessel function ?

Hello,

I'm studying Helmholtz equation in cylindrical coordinates. I'm using a solution of the scalar Helmholtz equation to build a vector field that could be a solution of the vector Helmholtz equation.

Here is my code with an orthonormal basis in a 3D manifold with cylindrical coordinates. Normally, SVH should be equal to 0 (actually, it is), but Sage doesn't simplify. I've used the simplify function, but it doesn't work. Can someone help me?

%display latex

latex from sage.manifolds.operators import *

E = Manifold(3,coordinates='cylindrical', name='E') # 3D Manifold in cylindrical coord

coord Ecyl.<r,ph,z> = E.chart(r'r:(0,+oo) ph:(0,2*pi):\phi z')

z') k = var('k')

assume(k>=0)

var('k') assume(k>=0) to_orthonormal = E.automorphism_field() # Orthonormal basis q

q to_orthonormal[0,0] = 1

1 to_orthonormal[1,1] = 1/r

1/r to_orthonormal[2,2] = 1

1 q = Ecyl.frame().new_frame(to_orthonormal, 'q')

E.set_default_frame(q)

'q') E.set_default_frame(q) eta = E.metric(name='eta', latex_name=r'\eta') #Minkowski metric

metric eta[0,0] = 1

1 eta[1,1] = 1

1 eta[2,2] = 1

1 h = E.scalar_field(bessel_J(0,sqrt(k^2)r)cos(0z)cos(0*ph), E.scalar_field(bessel_J(0,sqrt(k^2)*r)*cos(0*z)*cos(0*ph), name='h') #Helmholtz equation solution in cylindrical coord

coord k2 = -h.laplacian(eta)*h^(-1) # Determination of k^2

k^2 H = h(rq[0]+z*q[2]) h*(r*q[0]+z*q[2]) #Definition of a vector field H such that O is a vectorial Helmholtz equation solution

solution O = H.curl(metric=eta)

H.curl(metric=eta) SHV = O.laplacian(eta) + k2*O

SHV.display()

k2*O SHV.display()

Sage solution : -1/4((2bessel_J(2, kr)bessel_J(1, kr)

-1/4*((2*bessel_J(2, k*r)*bessel_J(1, k*r) - bessel_J(3, kr)bessel_J(0, kr) k*r)*bessel_J(0, k*r) + bessel_J(1, kr)bessel_J(0, kr))k^3r^2 k*r)*bessel_J(0, k*r))*k^3*r^2 - 2(2bessel_J(1, kr)^2 2*(2*bessel_J(1, k*r)^2 - bessel_J(2, kr)k*r)*bessel_J(0, k*r) + bessel_J(0, kr) + bessel_J(0, kr)^2)k^2r + 4kbessel_J(1, kr)bessel_J(0, kr))z/(r^2bessel_J(0, kr))

k*r)^2)*k^2*r + 4*k*bessel_J(1, k*r)*bessel_J(0, k*r))*z/(r^2*bessel_J(0, k*r))