Skip to content Skip to sidebar Skip to footer

Sympy Fails To Integrate The Product Of A Piecewise Continuous Function And A Complex Function Across The Discontinuity

If I do: from sympy import * x, L = symbols('x L', real=True) f = Piecewise((1, x<=0), (-1, x<1), (0, True)) g = exp(-x * 1j) integrate(f * g, (x, 0, L)) I get: Piecewise(

Solution 1:

I guess it's not implemented yet. It probably doesn't know how to deal with the case where both limits are symbolic. You should report it.

A workaround is integrate(f*g, (x, 0, L)) - integrate(f*g, (x, 0, L/2)).


Post a Comment for "Sympy Fails To Integrate The Product Of A Piecewise Continuous Function And A Complex Function Across The Discontinuity"