• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python ode.constant_renumber函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sympy.solvers.ode.constant_renumber函数的典型用法代码示例。如果您正苦于以下问题:Python constant_renumber函数的具体用法?Python constant_renumber怎么用?Python constant_renumber使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: test_constant_multiple

def test_constant_multiple():
    assert constant_renumber(constantsimp(C1*2 + 2, [C1]), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(x*2/C1, [C1]), 'C', 1, 1) == C1*x
    assert constant_renumber(constantsimp(C1**2*2 + 2, [C1]), 'C', 1, 1) == C1
    assert constant_renumber(
        constantsimp(sin(2*C1) + x + sqrt(2), [C1]), 'C', 1, 1) == C1 + x
    assert constant_renumber(constantsimp(2*C1 + C2, [C1, C2]), 'C', 1, 2) == C1
开发者ID:A-turing-machine,项目名称:sympy,代码行数:7,代码来源:test_constantsimp.py


示例2: test_ode_solutions

def test_ode_solutions():
    # only a few examples here, the rest will be tested in the actual dsolve tests
    assert constant_renumber(constantsimp(C1*exp(2*x)+exp(x)*(C2+C3), x, 3), 'C', 1, 3) == \
        constant_renumber(C1*exp(x)+C2*exp(2*x), 'C', 1, 2)
    assert constant_renumber(constantsimp(Eq(f(x),I*C1*sinh(x/3) + C2*cosh(x/3)), x, 2),
        'C', 1, 2) == constant_renumber(Eq(f(x), C1*sinh(x/3) + C2*cosh(x/3)), 'C', 1, 2)
    assert constant_renumber(constantsimp(Eq(f(x),acos((-C1)/cos(x))), x, 1), 'C', 1, 1) == \
        Eq(f(x),acos(C1/cos(x)))
    assert constant_renumber(constantsimp(Eq(log(f(x)/C1) + 2*exp(x/f(x)), 0), x, 1),
        'C', 1, 1) ==  Eq(log(C1*f(x)) + 2*exp(x/f(x)), 0)
    assert constant_renumber(constantsimp(Eq(log(x*sqrt(2)*sqrt(1/x)*sqrt(f(x))\
        /C1) + x**2/(2*f(x)**2), 0), x, 1), 'C', 1, 1) == \
        Eq(log(C1*x*sqrt(1/x)*sqrt(f(x))) + x**2/(2*f(x)**2), 0)
    assert constant_renumber(constantsimp(Eq(-exp(-f(x)/x)*sin(f(x)/x)/2 + log(x/C1) - \
        cos(f(x)/x)*exp(-f(x)/x)/2, 0), x, 1), 'C', 1, 1) == \
        Eq(-exp(-f(x)/x)*sin(f(x)/x)/2 + log(C1*x) - cos(f(x)/x)*exp(-f(x)/x)/2, 0)
    u2 = Symbol('u2')
    _a = Symbol('_a')
    assert constant_renumber(constantsimp(Eq(-Integral(-1/(sqrt(1 - u2**2)*u2), \
        (u2, _a, x/f(x))) + log(f(x)/C1), 0), x, 1), 'C', 1, 1) == \
        Eq(-Integral(-1/(u2*sqrt(1 - u2**2)), (u2, _a, x/f(x))) + \
        log(C1*f(x)), 0)
    assert [constant_renumber(constantsimp(i, x, 1), 'C', 1, 1) for i in
        [Eq(f(x), sqrt(-C1*x + x**2)), Eq(f(x), -sqrt(-C1*x +
        x**2))]] == [Eq(f(x), sqrt(C1*x + x**2)),
        Eq(f(x), -sqrt(C1*x + x**2))]
开发者ID:ALGHeArT,项目名称:sympy,代码行数:26,代码来源:test_constantsimp.py


示例3: test_ode_solutions

def test_ode_solutions():
    # only a few examples here, the rest will be tested in the actual dsolve tests
    assert constant_renumber(constantsimp(C1*exp(2*x) + exp(x)*(C2 + C3), [C1, C2, C3])) == \
        constant_renumber((C1*exp(x) + C2*exp(2*x)))
    assert constant_renumber(
        constantsimp(Eq(f(x), I*C1*sinh(x/3) + C2*cosh(x/3)), [C1, C2])
        ) == constant_renumber(Eq(f(x), C1*sinh(x/3) + C2*cosh(x/3)))
    assert constant_renumber(constantsimp(Eq(f(x), acos((-C1)/cos(x))), [C1])) == \
        Eq(f(x), acos(C1/cos(x)))
    assert constant_renumber(
        constantsimp(Eq(log(f(x)/C1) + 2*exp(x/f(x)), 0), [C1])
        ) == Eq(log(C1*f(x)) + 2*exp(x/f(x)), 0)
    assert constant_renumber(constantsimp(Eq(log(x*sqrt(2)*sqrt(1/x)*sqrt(f(x))
        /C1) + x**2/(2*f(x)**2), 0), [C1])) == \
        Eq(log(C1*sqrt(x)*sqrt(f(x))) + x**2/(2*f(x)**2), 0)
    assert constant_renumber(constantsimp(Eq(-exp(-f(x)/x)*sin(f(x)/x)/2 + log(x/C1) -
        cos(f(x)/x)*exp(-f(x)/x)/2, 0), [C1])) == \
        Eq(-exp(-f(x)/x)*sin(f(x)/x)/2 + log(C1*x) - cos(f(x)/x)*
           exp(-f(x)/x)/2, 0)
    assert constant_renumber(constantsimp(Eq(-Integral(-1/(sqrt(1 - u2**2)*u2),
        (u2, _a, x/f(x))) + log(f(x)/C1), 0), [C1])) == \
        Eq(-Integral(-1/(u2*sqrt(1 - u2**2)), (u2, _a, x/f(x))) +
        log(C1*f(x)), 0)
    assert [constantsimp(i, [C1]) for i in [Eq(f(x), sqrt(-C1*x + x**2)), Eq(f(x), -sqrt(-C1*x + x**2))]] == \
        [Eq(f(x), sqrt(x*(C1 + x))), Eq(f(x), -sqrt(x*(C1 + x)))]
开发者ID:asmeurer,项目名称:sympy,代码行数:25,代码来源:test_constantsimp.py


示例4: test_constant_function

def test_constant_function():
    assert constant_renumber(constantsimp(sin(C1), x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(f(C1), x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(f(C1, C1), x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(f(C1, C2), x, 2), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(f(C2, C1), x, 2), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(f(C2, C2), x, 2), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(f(C1, x), x, 1), 'C', 1, 2) == f(C1, x)
    assert constant_renumber(constantsimp(f(C1, y), x, 1), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(f(y, C1), x, 1), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(f(C1, y, C2), x, 2), 'C', 1, 2) == C1
开发者ID:ALGHeArT,项目名称:sympy,代码行数:11,代码来源:test_constantsimp.py


示例5: test_constant_power_as_base

def test_constant_power_as_base():
    assert constant_renumber(constantsimp(C1**C1, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(Pow(C1,C1), x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1**C1, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1**C2, x, 2), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(C2**C1, x, 2), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(C2**C2, x, 2), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(C1**y, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1**x, x, 1), 'C', 1, 1) == C1**x
    assert constant_renumber(constantsimp(C1**2, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1**(x*y), x, 1), 'C', 1, 1) == C1**(x*y)
开发者ID:ALGHeArT,项目名称:sympy,代码行数:11,代码来源:test_constantsimp.py


示例6: test_constant_power_as_base

def test_constant_power_as_base():
    assert constant_renumber(constantsimp(C1**C1, [C1])) == C1
    assert constant_renumber(constantsimp(Pow(C1, C1), [C1])) == C1
    assert constant_renumber(constantsimp(C1**C1, [C1])) == C1
    assert constant_renumber(constantsimp(C1**C2, [C1, C2])) == C1
    assert constant_renumber(constantsimp(C2**C1, [C1, C2])) == C1
    assert constant_renumber(constantsimp(C2**C2, [C1, C2])) == C1
    assert constant_renumber(constantsimp(C1**y, [C1, y])) == C1
    assert constant_renumber(constantsimp(C1**x, [C1])) == C1**x
    assert constant_renumber(constantsimp(C1**2, [C1])) == C1
    assert constant_renumber(
        constantsimp(C1**(x*y), [C1])) == C1**(x*y)
开发者ID:asmeurer,项目名称:sympy,代码行数:12,代码来源:test_constantsimp.py


示例7: test_constant_function

def test_constant_function():
    assert constant_renumber(constantsimp(sin(C1), [C1])) == C1
    assert constant_renumber(constantsimp(f(C1), [C1])) == C1
    assert constant_renumber(constantsimp(f(C1, C1), [C1])) == C1
    assert constant_renumber(constantsimp(f(C1, C2), [C1, C2])) == C1
    assert constant_renumber(constantsimp(f(C2, C1), [C1, C2])) == C1
    assert constant_renumber(constantsimp(f(C2, C2), [C1, C2])) == C1
    assert constant_renumber(
        constantsimp(f(C1, x), [C1])) == f(C1, x)
    assert constant_renumber(constantsimp(f(C1, y), [C1, y])) == C1
    assert constant_renumber(constantsimp(f(y, C1), [C1, y])) == C1
    assert constant_renumber(constantsimp(f(C1, y, C2), [C1, C2, y])) == C1
开发者ID:asmeurer,项目名称:sympy,代码行数:12,代码来源:test_constantsimp.py


示例8: test_constant_add

def test_constant_add():
    assert constant_renumber(constantsimp(C1 + C1, [C1]), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1 + 2, [C1]), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(2 + C1, [C1]), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1 + y, [C1, y]), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1 + x, [C1]), 'C', 1, 1) == C1 + x
    assert constant_renumber(constantsimp(C1 + C1, [C1]), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1 + C2, [C1, C2]), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(C2 + C1, [C1, C2]), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(C1 + C2 + C1, [C1, C2]), 'C', 1, 2) == C1
开发者ID:A-turing-machine,项目名称:sympy,代码行数:10,代码来源:test_constantsimp.py


示例9: test_constant_power_as_exp

def test_constant_power_as_exp():
    assert constant_renumber(constantsimp(x**C1, x, 1), 'C', 1, 1) == x**C1
    assert constant_renumber(constantsimp(y**C1, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(x**y**C1, x, 1), 'C', 1, 1) == x**C1
    assert constant_renumber(constantsimp((x**y)**C1, x, 1), 'C', 1, 1) == (x**y)**C1
    assert constant_renumber(constantsimp(x**(y**C1), x, 1), 'C', 1, 1) == x**C1
    assert constant_renumber(constantsimp(x**C1**y, x, 1), 'C', 1, 1) == x**C1
    assert constant_renumber(constantsimp(x**(C1**y), x, 1), 'C', 1, 1) == x**C1
    assert constant_renumber(constantsimp((x**C1)**y, x, 1), 'C', 1, 1) == (x**C1)**y
    assert constant_renumber(constantsimp(2**C1, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(S(2)**C1, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(exp(C1), x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(exp(C1+x), x, 1), 'C', 1, 1) == C1*exp(x)
    assert constant_renumber(constantsimp(Pow(2, C1), x, 1), 'C', 1, 1) == C1
开发者ID:ALGHeArT,项目名称:sympy,代码行数:14,代码来源:test_constantsimp.py


示例10: test_constant_add

def test_constant_add():
    assert constant_renumber(constantsimp(C1 + C1, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1 + 2, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(2 + C1, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1 + y, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1 + x, x, 1), 'C', 1, 1) == C1 + x
    assert constant_renumber(constantsimp(C1 + x + y + x*y + 2, x, 1), 'C', 1, 1) == \
        C1 + x*(y + 1)
    assert constant_renumber(constantsimp(C1 + x + 2**x + y + 2, x, 1), 'C', 1, 1) == \
        C1 + x + 2**x
    assert constant_renumber(constantsimp(C1 + C1, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1 + C2, x, 2), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(C2 + C1, x, 2), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(C1 + C2 + C1, x, 2), 'C', 1, 2) == C1
开发者ID:ALGHeArT,项目名称:sympy,代码行数:14,代码来源:test_constantsimp.py


示例11: test_constant_mul

def test_constant_mul():
    # We want C1 (Constant) below to absorb the y's, but not the x's
    assert constant_renumber(constantsimp(y*C1, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(x*C1, x, 1), 'C', 1, 1) == x*C1
    assert constant_renumber(constantsimp(C1*y, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1*x, x, 1), 'C', 1, 1) == x*C1
    assert constant_renumber(constantsimp(2*C1, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1*2, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(y*C1*x, x, 1), 'C', 1, 1) == C1*x
    assert constant_renumber(constantsimp(x*y*C1, x, 1), 'C', 1, 1) == x*C1
    assert constant_renumber(constantsimp(y*x*C1, x, 1), 'C', 1, 1) == x*C1
    assert constant_renumber(constantsimp(C1*y*(y + 1), x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(y*C1*(y + 1), x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(x*(y*C1), x, 1), 'C', 1, 1) == x*C1
    assert constant_renumber(constantsimp(x*(C1*y), x, 1), 'C', 1, 1) == x*C1
    assert constant_renumber(constantsimp(C1*(x*y), x, 1), 'C', 1, 1) == C1*x
    assert constant_renumber(constantsimp((x*y)*C1, x, 1), 'C', 1, 1) == x*C1
    assert constant_renumber(constantsimp((y*x)*C1, x, 1), 'C', 1, 1) == x*C1
    assert constant_renumber(constantsimp(y*(y + 1)*C1, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1*x*y, x, 1), 'C', 1, 1) == C1*x
    assert constant_renumber(constantsimp(x*C1*y, x, 1), 'C', 1, 1) == x*C1
    assert constant_renumber(constantsimp((C1*x)*y, x, 1), 'C', 1, 1) == C1*x
    assert constant_renumber(constantsimp(y*(x*C1), x, 1), 'C', 1, 1) == x*C1
    assert constant_renumber(constantsimp((x*C1)*y, x, 1), 'C', 1, 1) == x*C1
    assert constant_renumber(constantsimp(C1*x*y*x*y*2, x, 1), 'C', 1, 1) == C1*x**2
    assert constant_renumber(constantsimp(C1*x*y*z, x, 1), 'C', 1, 1) == C1*x
    assert constant_renumber(constantsimp(C1*x*y**2*sin(z), x, 1), 'C', 1, 1) == C1*x
    assert constant_renumber(constantsimp(C1*C1, x, 1), 'C', 1, 1) == C1
    assert constant_renumber(constantsimp(C1*C2, x, 2), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(C2*C2, x, 2), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(C1*C1*C2, x, 2), 'C', 1, 2) == C1
    assert constant_renumber(constantsimp(C1*x*2**x, x, 1), 'C', 1, 1) == C1*x*2**x
开发者ID:ALGHeArT,项目名称:sympy,代码行数:32,代码来源:test_constantsimp.py


示例12: test_constant_function_multiple

def test_constant_function_multiple():
    # The rules to not renumber in this case would be too complicated, and
    # dsolve is not likely to ever encounter anything remotely like this.
    assert constant_renumber(constantsimp(f(C1, C1, x), x, 1), 'C', 1, 1) == f(C1, C1, x)
开发者ID:ALGHeArT,项目名称:sympy,代码行数:4,代码来源:test_constantsimp.py


示例13: test_constant_repeated

def test_constant_repeated():
    assert C1 + C1*x == constant_renumber( C1 + C1*x, 'C', 1, 3)
开发者ID:A-turing-machine,项目名称:sympy,代码行数:2,代码来源:test_constantsimp.py


示例14: test_constant_mul

def test_constant_mul():
    # We want C1 (Constant) below to absorb the y's, but not the x's
    assert constant_renumber(constantsimp(y*C1, [C1])) == C1*y
    assert constant_renumber(constantsimp(C1*y, [C1])) == C1*y
    assert constant_renumber(constantsimp(x*C1, [C1])) == x*C1
    assert constant_renumber(constantsimp(C1*x, [C1])) == x*C1
    assert constant_renumber(constantsimp(2*C1, [C1])) == C1
    assert constant_renumber(constantsimp(C1*2, [C1])) == C1
    assert constant_renumber(constantsimp(y*C1*x, [C1, y])) == C1*x
    assert constant_renumber(constantsimp(x*y*C1, [C1, y])) == x*C1
    assert constant_renumber(constantsimp(y*x*C1, [C1, y])) == x*C1
    assert constant_renumber(constantsimp(C1*x*y, [C1, y])) == C1*x
    assert constant_renumber(constantsimp(x*C1*y, [C1, y])) == x*C1
    assert constant_renumber(constantsimp(C1*y*(y + 1), [C1])) == C1*y*(y+1)
    assert constant_renumber(constantsimp(y*C1*(y + 1), [C1])) == C1*y*(y+1)
    assert constant_renumber(constantsimp(x*(y*C1), [C1])) == x*y*C1
    assert constant_renumber(constantsimp(x*(C1*y), [C1])) == x*y*C1
    assert constant_renumber(constantsimp(C1*(x*y), [C1, y])) == C1*x
    assert constant_renumber(constantsimp((x*y)*C1, [C1, y])) == x*C1
    assert constant_renumber(constantsimp((y*x)*C1, [C1, y])) == x*C1
    assert constant_renumber(constantsimp(y*(y + 1)*C1, [C1, y])) == C1
    assert constant_renumber(constantsimp((C1*x)*y, [C1, y])) == C1*x
    assert constant_renumber(constantsimp(y*(x*C1), [C1, y])) == x*C1
    assert constant_renumber(constantsimp((x*C1)*y, [C1, y])) == x*C1
    assert constant_renumber(constantsimp(C1*x*y*x*y*2, [C1, y])) == C1*x**2
    assert constant_renumber(constantsimp(C1*x*y*z, [C1, y, z])) == C1*x
    assert constant_renumber(constantsimp(C1*x*y**2*sin(z), [C1, y, z])) == C1*x
    assert constant_renumber(constantsimp(C1*C1, [C1])) == C1
    assert constant_renumber(constantsimp(C1*C2, [C1, C2])) == C1
    assert constant_renumber(constantsimp(C2*C2, [C1, C2])) == C1
    assert constant_renumber(constantsimp(C1*C1*C2, [C1, C2])) == C1
    assert constant_renumber(constantsimp(C1*x*2**x, [C1])) == C1*x*2**x
开发者ID:asmeurer,项目名称:sympy,代码行数:32,代码来源:test_constantsimp.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python ode.constantsimp函数代码示例发布时间:2022-05-27
下一篇:
Python inequalities.solve_univariate_inequality函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap