小编Nil*_*as 的帖子

用scipy整合方程

from scipy.integrate import quad

def integrand(a, b):
    return a * x ** 2 + b

a = 2
b = 1

I = quad(integrand, 0, 1, args=(a,b))
I
Run Code Online (Sandbox Code Playgroud)

这是我的计划.当我试图运行它时,它显示错误:

integrand () takes 2 positional arguments but 3 were given ....
Run Code Online (Sandbox Code Playgroud)

当只有两个变量时,我不明白为什么要求3个参数,即ab.

谁能帮我?任何人都可以澄清我的怀疑吗?

python scipy

5
推荐指数
1
解决办法
66
查看次数

标签 统计

python ×1

scipy ×1