你好我对python很陌生,我正在尝试通过一组方程。我试图通过浮点数乘以四元积分的结果我的代码是:
from __future__ import division
import scipy.special as sp
from scipy import integrate
import math
Tb = 7.2
Tc = 9.3
t = Tb / Tc
n = 2*10**-6
L = 50*10**-6
W = 80*10**-9
a = 3*10**-2
s1 = W/ (2*n)
y1 = (L+(W/2)) / (2*n)
x0 = 0.015
r0 = 4*x0
s2 = (r0 / n)/1000000
print s2
y0 = (x0 / n)/1000000
def t1(t):
return t**-1*sp.kv(0, s2)
def t2(t):
return t**-1*sp.iv(0, s2)
print t2
Fk2 = (math.pi**-2) * integrate.quad(t1, s1, s2)
FI2 = (math.pi**-2) * integrate.quad(t2, s1, s2)
print Fk2 , FI2
我不断收到错误
25 print t2
---> 26 Fk2 = (math.pi**-2) * integrate.quad(t1, s1, s2)
27 FI2 = (math.pi**-2) * integrate.quad(t2, s1, s2)
28 print Fk2 , FI2
TypeError: can't multiply sequence by non-int of type 'float'
我很不确定要做什么,我试过用def t1(t)
lambda 函数替换,但又什么也没做。任何帮助都非常感谢,并在此先感谢您。