借助於ratint_logpart()方法,我們可以通過使用Lazard Rioboo Trager算法實現不定理有理函數的積分,並返回積分多項式。
用法:ratint_logpart(f, g, x, t=None)
返回:返回集成函數。
範例1:
在此示例中,我們可以看到,通過使用ratint_logpart()方法,我們可以使用Lazard Rioboo Trager算法計算不確定的有理積分。
Python3
# import ratint_logpart
from sympy.integrals.rationaltools import ratint_logpart
from sympy.abc import x
from sympy import Poly
# Using ratint_logpart() method
gfg = ratint_logpart(Poly(1, x, domain='ZZ'),
Poly(x*2 + x + 1, x, domain='ZZ'), x)
print(gfg)
輸出:
[(Poly(3*x + 1, x, domain=’ZZ’), Poly(-3*_t + 1, _t, domain=’ZZ’))]
範例2:
Python3
# import ratint_logpart
from sympy.integrals.rationaltools import ratint_logpart
from sympy.abc import x, y
from sympy import Poly
# Using ratint_logpart() method
gfg = ratint_logpart(Poly(10, y, domain='ZZ'),
Poly(y**2 - 3*y - 2, y, domain='ZZ'), y)
print(gfg)
輸出:
[(Poly(y - 17*_t/20 - 3/2, y, domain=’QQ[_t]’), Poly(-17*_t**2 + 100, _t, domain=’ZZ’))]
相關用法
注:本文由純淨天空篩選整理自Jitender_1998大神的英文原創作品 sympy.integrals.rationaltools.ratint_logpart() in python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。