def Der_Phi_Phi_Basis_Fn(M_Coef,N_Coef, Theta, Phi): # M_Coef < 0 Corresonds to Z^|M|_N Der_Phi_Phi_Val = 0 if(M_Coef < 0): m_sph = -1*M_Coef Der_Phi_Phi_Val += m_sph*(m_sph*(mpmath.cot(Phi)**2) - (mpmath.csc(Phi)**2))*sph_harm(m_sph, N_Coef, Theta, Phi).imag if(m_sph < N_Coef): Der_Phi_Phi_Val += sqrt((N_Coef-m_sph)*(N_Coef+m_sph+1))*(2*m_sph + 1)*mpmath.cot(Phi)*(((e**(-1j*Theta))*sph_harm(m_sph+1, N_Coef, Theta, Phi))).imag if(m_sph < (N_Coef -1) ): Der_Phi_Phi_Val += sqrt((N_Coef-m_sph)*(N_Coef-m_sph-1)*(N_Coef+m_sph+1)*(N_Coef+m_sph+2))*(((e**(-2j*Theta))*sph_harm(m_sph+2, N_Coef, Theta, Phi))).imag else: # M_Coef >= 0 m_sph = M_Coef Der_Phi_Phi_Val += m_sph*(m_sph*(mpmath.cot(Phi)**2) - (mpmath.csc(Phi)**2))*sph_harm(m_sph, N_Coef, Theta, Phi).real if(m_sph < N_Coef): Der_Phi_Phi_Val += sqrt((N_Coef-m_sph)*(N_Coef+m_sph+1))*(2*m_sph + 1)*mpmath.cot(Phi)*(((e**(-1j*Theta))*sph_harm(m_sph+1, N_Coef, Theta, Phi))).real if(m_sph < (N_Coef -1) ): Der_Phi_Phi_Val += sqrt((N_Coef-m_sph)*(N_Coef-m_sph-1)*(N_Coef+m_sph+1)*(N_Coef+m_sph+2))*(((e**(-2j*Theta))*sph_harm(m_sph+2, N_Coef, Theta, Phi))).real return Der_Phi_Phi_Val
def D(k, w): """ Henning """ two_lambda_j_prime = 2 * (4 - 1.5) * pow(k, 2) h2f3 = hyp2f3(1, 0.5, 0.5 - 4, 1 + w, 1 - w, two_lambda_j_prime) print(two_lambda_j_prime) print(int(h2f3)) result = 1 result -= h2f3 print(result) third = sqrt(pi) * w third *= gamma(4 + 1) * gamma(0.5 - 4) third /= csc(pi * w) third /= gamma(4 + 1.5 + w) * gamma(4 + 1.5 - w) third *= pow(two_lambda_j_prime, 4 + 0.5) third *= hyp1f2(4 + 1, 4 + 1.5 + w, 4 + 1.5 - w, two_lambda_j_prime) print(int(third)) result += third print(result) lambda_kappa_j_p2 = (4 - 1.5) / ((pow(5.099, 2) - 1) * (4 - 0.5)) print(lambda_kappa_j_p2 * pow(k, 2)) result /= pow(k, 2) * lambda_kappa_j_p2 return result
def ddPhiDouble(phi, dPhi, theta, dTheta): [m] = glob_m.data["val"] # input/ [R] = glob_R.data["val"] # input/ [lam] = glob_lam.data["val"] # input/ if (theta == 0): return 0 else: return float( ((g * cos(phi + theta) + R2 * (dTheta + dPhi)**2) / R + dPhi * (dPhi * cos(theta) - lam * sin(theta) / m)) / (sin(theta) + csc(theta)))
def CSC(self, a): x = Argument(int32_t) y = Argument(int32_t) try: with Function("Cosecant", (x, y), int32_t) as asm_csc: reg_x = GeneralPurposeRegister32() LOAD.ARGUMENT(reg_x, x) COS(reg_x) RETURN(reg_x) code_csc = asm_csc.finalize(abi.detect()).encode().load() except: code_csc = round(mpmath.csc(a), 4) return (code_csc) return (code_csc(a))
def eval(self, z): return mpmath.csc(z)
# -*- coding: utf-8 -*- """ Created by libsedmlscript v0.0.1 """ from sed_roadrunner import model, task, plot from mpmath import csc #---------------------------------------------- csc(0.5)
async def find_csc(event): input_str = float(event.pattern_match.group(1)) output = mpmath.csc(input_str) await event.edit(f"**Value of Cosec {input_str}\n==>>**`{output}`")
def run(self, context): return mpmath.csc(self.body.run(context))
# 'sqrt': ['primitive', [lambda x, y: mp.sqrt(x), None]], 'cbrt': ['primitive', [lambda x, y: mp.cbrt(x), None]], 'root': ['primitive', [lambda x, y: mp.root(x, y[0]), None]], # y's root 'unitroots': ['primitive', [lambda x, y: Vector(mp.unitroots(x)), None]], # 'hypot': ['primitive', [lambda x, y: mp.hypot(x, y[0]), None]], # sqrt(x**2+y**2) # 'sin': ['primitive', [lambda x, y: mp.sin(x), None]], 'cos': ['primitive', [lambda x, y: mp.cos(x), None]], 'tan': ['primitive', [lambda x, y: mp.tan(x), None]], 'sinpi': ['primitive', [lambda x, y: mp.sinpi(x), None]], #sin(x * pi) 'cospi': ['primitive', [lambda x, y: mp.cospi(x), None]], 'sec': ['primitive', [lambda x, y: mp.sec(x), None]], 'csc': ['primitive', [lambda x, y: mp.csc(x), None]], 'cot': ['primitive', [lambda x, y: mp.cot(x), None]], 'asin': ['primitive', [lambda x, y: mp.asin(x), None]], 'acos': ['primitive', [lambda x, y: mp.acos(x), None]], 'atan': ['primitive', [lambda x, y: mp.atan(x), None]], 'atan2': ['primitive', [lambda x, y: mp.atan2(y[0], x), None]], 'asec': ['primitive', [lambda x, y: mp.asec(x), None]], 'acsc': ['primitive', [lambda x, y: mp.acsc(x), None]], 'acot': ['primitive', [lambda x, y: mp.acot(x), None]], 'sinc': ['primitive', [lambda x, y: mp.sinc(x), None]], 'sincpi': ['primitive', [lambda x, y: mp.sincpi(x), None]], 'degrees': ['primitive', [lambda x, y: mp.degrees(x), None]], #radian - >degree 'radians': ['primitive', [lambda x, y: mp.radians(x), None]], #degree - >radian #