Conversion of symbolic expression to numeric one for use in quad - use lambdify?
问题 I want to convert an expression containing symbolic variables to a numeric one so that the expression may be subsequently used in an integration method 'quad'. import numpy import math as m import scipy import sympy #define constants gammaee = 5.55e-6 MJpsi = 3.096916 alphaem = 1/137 lambdasq = 0.09 Ca = 3 qOsq = 2 def qbarsq(qsq): return (qsq+MJpsi**2)/4 def xx(qbarsq, w): return 4*qbarsq/(4*qbarsq-MJpsi**2+w**2) from sympy import * x,NN,a,b,ktsq,qbarsq,w = symbols('x NN a b ktsq qbarsq w')