示例#1
0
 def get_A(self, c2,c1,rank):
     A = zeros((self.nmax, self.nmax),dtype=complex)
     type = self.particle.type
     m = 1
     for i in range(self.nmax):
         for k in range(self.nmax):
             l = i + m
             n = k + m
             cv_l = get_cv(m, l, c2, type)
             cv_n = get_cv(m, n, c1, type)
             if (self.particle.spheroid):
                 func = lambda nu: ang1_cv(m, l, c2, cv_l, type, nu)[0] * ang1_cv(m, n, c1, cv_n, type, nu)[0]
                 A[i][k] = spheroidal.quad(func, -1, 1) * rad_cv(m, l, c2, type, rank, self.particle.psi)[0]
             else:
                 func = lambda nu: spheroidal.get_a_function(m, l, c2, rank, self.particle)(nu) * ang1_cv(m, n, c1, cv_n, type, nu)[0]
                 A[i][k] = spheroidal.quad(func, -1, 1)
     return mat(A)
 def get_A(self, c2, c1, rank):
     A = zeros((self.nmax, self.nmax), dtype=complex)
     type = self.particle.type
     m = 1
     for i in range(self.nmax):
         for k in range(self.nmax):
             l = i + m
             n = k + m
             cv_l = get_cv(m, l, c2, type)
             cv_n = get_cv(m, n, c1, type)
             if (self.particle.spheroid):
                 func = lambda nu: ang1_cv(m, l, c2, cv_l, type, nu)[
                     0] * ang1_cv(m, n, c1, cv_n, type, nu)[0]
                 A[i][k] = spheroidal.quad(func, -1, 1) * rad_cv(
                     m, l, c2, type, rank, self.particle.psi)[0]
             else:
                 func = lambda nu: spheroidal.get_a_function(
                     m, l, c2, rank, self.particle)(nu) * ang1_cv(
                         m, n, c1, cv_n, type, nu)[0]
                 A[i][k] = spheroidal.quad(func, -1, 1)
     return mat(A)
    def get_A(self, function):
        A = zeros((self.nmax, self.nmax), dtype=complex)
        m = 1
        for i in range(self.nmax):
            for k in range(self.nmax):
                n = i + m
                l = k + m
                func = lambda nu: function(m, n,l)(nu) * \
                                   spheroidal.metric_phi(nu, self.particle) *\
                                   spheroidal.get_integral_metric(self.particle)(nu)

                A[i][k] = spheroidal.quad(func, -1, 1)
        return mat(A)
示例#4
0
    def get_A(self,function):
        A = zeros((self.nmax, self.nmax), dtype=complex)
        m = 1
        for i in range(self.nmax):
            for k in range(self.nmax):
                n = i + m
                l = k + m
                func = lambda nu: function(m, n,l)(nu) * \
                                   spheroidal.metric_phi(nu, self.particle) *\
                                   spheroidal.get_integral_metric(self.particle)(nu)

                A[i][k] = spheroidal.quad(func, -1, 1)
        return  mat(A)
 def __get_Z(self, z_function, c2, c1, rank):
     Z = zeros((self.nmax, self.nmax), dtype=complex)
     type = self.particle.type
     m = 1
     for i in range(self.nmax):
         for k in range(self.nmax):
             l = i + m
             n = k + m
             cv_l = get_cv(m, l, c2, type)
             cv_n = get_cv(m, n, c1, type)
             func = lambda nu: z_function(m, l, c2, cv_l, rank, self.particle)(nu) *\
                               ang1_cv(m, n, c1, cv_n, type, nu)[0] * spheroidal.metric_phi(nu, self.particle)\
                               * spheroidal.get_integral_metric(self.particle)(nu)
             Z[i][k] = spheroidal.quad(func, -1, 1)
     return mat(Z)
示例#6
0
 def __get_Z(self,z_function,c2,c1, rank):
     Z = zeros((self.nmax, self.nmax),dtype=complex)
     type = self.particle.type
     m = 1
     for i in range(self.nmax):
         for k in range(self.nmax):
             l = i + m
             n = k + m
             cv_l = get_cv(m, l, c2, type)
             cv_n = get_cv(m, n, c1, type)
             func = lambda nu: z_function(m, l, c2, cv_l, rank, self.particle)(nu) *\
                               ang1_cv(m, n, c1, cv_n, type, nu)[0] * spheroidal.metric_phi(nu, self.particle)\
                               * spheroidal.get_integral_metric(self.particle)(nu)
             Z[i][k] = spheroidal.quad(func, -1, 1)
     return mat(Z)
示例#7
0
    def get_BRi(self):
        Br = zeros((self.nmax, self.nmax), dtype=complex)
        type = self.particle.type
        m = 1
        for i in range(self.nmax):
            for k in range(self.nmax):
                n = i + m
                l = k + m
                cv_l = get_cv(m, l, self.c2, type)
                cv_n = get_cv(m, n, self.c1, type)
                func = lambda nu: (spheroidal.get_a_function(m, l, self.c2, cv_l, 1, self.particle)(nu) * \
                                  spheroidal.get_b_function(m, n, self.c1, cv_n, 1, self.particle)(nu) - \
                                  spheroidal.get_c_function(m, l, self.c2, cv_l, 1, self.particle)(nu) * \
                                  spheroidal.get_a_function(m, n, self.c1, cv_n, 1, self.particle)(nu)) * spheroidal.metric_phi(nu, self.particle)\
                                  * spheroidal.get_integral_metric(self.particle)(nu)

                Br[i][k] = spheroidal.quad(func, -1, 1)
        return -1j * mat(Br)
    def get_BRi(self):
        Br = zeros((self.nmax, self.nmax), dtype=complex)
        type = self.particle.type
        m = 1
        for i in range(self.nmax):
            for k in range(self.nmax):
                n = i + m
                l = k + m
                cv_l = get_cv(m, l, self.c2, type)
                cv_n = get_cv(m, n, self.c1, type)
                func = lambda nu: (spheroidal.get_a_function(m, l, self.c2, cv_l, 1, self.particle)(nu) * \
                                  spheroidal.get_b_function(m, n, self.c1, cv_n, 1, self.particle)(nu) - \
                                  spheroidal.get_c_function(m, l, self.c2, cv_l, 1, self.particle)(nu) * \
                                  spheroidal.get_a_function(m, n, self.c1, cv_n, 1, self.particle)(nu)) * spheroidal.metric_phi(nu, self.particle)\
                                  * spheroidal.get_integral_metric(self.particle)(nu)

                Br[i][k] = spheroidal.quad(func, -1, 1)
        return  -1j * mat(Br)