本文整理汇总了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;未经允许,请勿转载。 |
请发表评论