需要使用Python脚本(类似于INT [A + X(t)DT〕)来解决集成

需要使用Python脚本(类似于INT [A + X(t)DT〕)来解决集成

问题描述:

enter image description here需要使用Python脚本(类似于INT [A + X(t)DT〕)来解决集成

如何使用python

please opne this fig

+1

使用括号将它分解成零件 – jdoer1997

+0

是否需要symboli c还是数值积分?换句话说,给定一个函数x(t),你期望符号表达式还是数字? – agtoever

+0

我需要一个符号表达式 –

from scipy.integrate import quad 

def integrand(x): 
    return x**2 

ans, err = quad(integrand, 0, 1) 
print ans 

可以解决这个方程也可以这样做,

from scipy.integrate import quad as q 
sol,e = q(lambda x: x**2, 0, 1) 
print sol