Redian新闻
>
solve equations of integrals in python (转载)
avatar
solve equations of integrals in python (转载)# JobHunting - 待字闺中
l*9
1
【 以下文字转载自 Statistics 讨论区 】
发信人: light009 (light009), 信区: Statistics
标 题: solve equations of integrals in python
发信站: BBS 未名空间站 (Fri Mar 21 12:21:31 2014, 美东)
I need to solve system equations of integrals in python 3.2.
from sympy import S, Eq, solve, integrals
import sympy as sym
import scipy.integrate as integ
x, b, c, m, v, L, u = S('x, b, c, m, v, L, u'.split())
equations = [Eq(m, integ.quad(xf(x, b, c), L, u))]
def xf(x, b,c):
return x*f(x,b,c)
def f(x, b, c):
return g(x, b,c) * (x/b)**(c-1) * sym.exp(-x/b)
def g(x, b, c):
c = 1+c // TypeError: unsupported operand type(s) for +: 'int' and '
tuple'
L = 1
u = 10
ff1 = b*g1(c, L/b)
def g1(a,z):
x = symbols('x')
return sym.integrate(x**(a-1) * sym.exp(-2*x), (x,z, sym.oo))
Any help would be appreciated !
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。