Python中的sympy.integrals.deltafunctions.deltaintegrate()
借助deltaintegrate()方法,我们可以计算 delta函数的积分,并使用该方法返回积分函数。此方法使用 delta 表达式来执行积分。
Syntax : deltaintegrate(f, x)
Return : Return the integrated function.
示例 #1:
在这个例子中我们可以看到,通过使用deltaintegrate()方法,我们可以通过使用这个方法得到一个 delta函数的积分,它会返回积分的 delta 表达式。
Python3
# import deltaintegrate
from sympy.abc import x, y, z
from sympy.integrals.deltafunctions import deltaintegrate
from sympy import sin, cos, tan, DiracDelta, Heaviside
# Using deltaintegrate() method
gfg = deltaintegrate(tan(x)*sin(x)*cos(x)*DiracDelta(x**2 - 1), x)
print(gfg)
Python3
# import deltaintegrate
from sympy.abc import x, y, z
from sympy.integrals.deltafunctions import deltaintegrate
from sympy import sin, cos, DiracDelta, Heaviside
# Using deltaintegrate() method
gfg = deltaintegrate(sin(y)*DiracDelta(x - z)*DiracDelta(y - z), y)
print(gfg)
输出 :
sin(1)*cos(1)*tan(1)*Heaviside(x – 1)/2 + sin(1)*cos(1)*tan(1)*Heaviside(x + 1)/2
示例 #2:
Python3
# import deltaintegrate
from sympy.abc import x, y, z
from sympy.integrals.deltafunctions import deltaintegrate
from sympy import sin, cos, DiracDelta, Heaviside
# Using deltaintegrate() method
gfg = deltaintegrate(sin(y)*DiracDelta(x - z)*DiracDelta(y - z), y)
print(gfg)
输出 :
sin(z)*DiracDelta(x – z)*Heaviside(y – z)