当前位置: 首页>>代码示例>>Python>>正文


Python Eq.doit方法代码示例

本文整理汇总了Python中sympy.Eq.doit方法的典型用法代码示例。如果您正苦于以下问题:Python Eq.doit方法的具体用法?Python Eq.doit怎么用?Python Eq.doit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sympy.Eq的用法示例。


在下文中一共展示了Eq.doit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Eq

# 需要导入模块: from sympy import Eq [as 别名]
# 或者: from sympy.Eq import doit [as 别名]
subs = {}
eqs = []

# rate of x
rate_expr = k_f*Y*(Z-x) - k_b*x
rate_eq = Eq(Derivative(x,t), rate_expr)
eqs.append(rate_eq)

integrand = 1/rate_expr
inte_eq_lhs = Integral(integrand.subs({x: chi}), (chi,0,x))
inte_eq_rhs = Integral(1, (tau,0,t))
inte_eq = Eq(inte_eq_lhs, inte_eq_rhs)
eqs.append(inte_eq)

expl_in_x_eq = inte_eq.doit().simplify()
eqs.append(expl_in_x_eq)

expl_in_t_eq = Eq(x, solve(expl_in_x_eq, x)[0])
eqs.append(expl_in_t_eq)

alt_expl_in_t = Z*k_f*Y/(k_f*Y+k_b)*(1-exp(-t*(k_f*Y+k_b)))
assert (expl_in_t_eq.rhs - alt_expl_in_t).simplify() == 0

alt_expl_in_t_eq = Eq(x, alt_expl_in_t)
eqs.append(alt_expl_in_t_eq)


def main():
    # GENERATES WITHOUT ARGUMENTS: rev_unary_1.tex rev_unary_rate.tex rev_unary_k_b.c rev_unary_K_eq.c
    from sympy.printing.latex import latex
开发者ID:bjodah,项目名称:stopped_flow,代码行数:32,代码来源:rev_unary.py

示例2: Eq

# 需要导入模块: from sympy import Eq [as 别名]
# 或者: from sympy.Eq import doit [as 别名]
eqs = []

# rate of x

rate_expr = k_f * (Y - x) * (Z - x)
rate_eq = Eq(Derivative(x, t), rate_expr)
eqs.append(rate_eq)

integrand = k_f / rate_expr
inte_eq_lhs = Integral(integrand.subs({x: chi}), (chi, 0, x))
inte_eq_rhs = Integral(k_f, (tau, 0, t))
inte_eq = Eq(inte_eq_lhs, inte_eq_rhs)
eqs.append(inte_eq)

expl_in_x_eq = inte_eq.doit(manual=True).simplify()
eqs.append(expl_in_x_eq)

expl_in_t_eq = Eq(x, solve(expl_in_x_eq, x)[0])

alt_expl_in_t = Y * (1 - exp(k_f * t * (Z - Y))) / (Y / Z - exp(k_f * t * (Z - Y)))
assert (alt_expl_in_t - expl_in_t_eq.rhs).simplify() == 0
alt_expl_in_t_eq = Eq(x, alt_expl_in_t)
eqs.append(alt_expl_in_t_eq)


def main():
    # GENERATES WITHOUT ARGUMENTS: irrev_binary_1.tex irrev_binary_2.tex irrev_binary_rate.tex irrev_binary_k_b.c irrev_binary_K_eq.c
    from sympy.printing.latex import latex

    open("irrev_binary_1.tex", "wt").write(as_align_env(eqs[:2]))
开发者ID:cagus,项目名称:stopped_flow,代码行数:32,代码来源:irrev_binary.py


注:本文中的sympy.Eq.doit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。