0

Newbie in python, wondering what would be the best strategy for the below I have plotted the below function. z-n is an array (the n terms of a sequence in fact). Theta and r are mesh grids others are single values iv is the modified bessel function of the order v

def density_core_screening_n(theta, I, omega, mu_1, g1, r1, r, b, z_n):
    m1 = cmath.sqrt(complex(0, omega * mu_1 * g1))
    phi_I = 2*pi/3
    j_c_n_s = m1*I/(2*pi*r1)*iv(0, m1*r)/iv(1, m1*r1) 
    for i in range(1, len(z_n), 1):
        theta_n = complex(cos(phi_I),sin(phi_I))*np.cos(i*(theta+11*pi/6))+complex(cos(2*phi_I),sin(2*phi_I))*np.cos(i*(theta+pi/6))
        j_c_n_s = j_c_n_s -m1*I/(pi*r1)*(r1/b)**(i)*iv(i, m1*r)/iv(i-1, m1*r1)*z_n[i-1]*theta_n
    return j_c_n_s.real

The plot works perfectly with polar projection. I would like to integrate the function multiplied by its conjugate on the mesh. Shall I investigate to express explicitly the function and use integrate.quad ?
Or is there any way to use the mesh and the array j_c_n_s computed ?

Thks !

What I did :

search in the scipy lib what can be use for integration look in scipy the bessel functions descriptions splitting the sum is not that easy due to the sum and the square

I would like to know if there is any clever way to do the integration

hecube
  • 1
  • 1

0 Answers0