-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lambdifying a parametric integral leads to integrand symbol not being defined #461
Comments
Yeah, the issue is that though
I'd guess this will only work if you call |
x, a, b = symbols("x,a,b", real=true)
res = SymPy.integrate(abs(sin(2π * x)), (x, a, b))
I = SymPy.lambdify(res; use_julia_code=true)
@show res
@show SymPy.free_symbols(res)
@show I(0, 1)
So I've tried to be smart and add x, a, b = symbols("x,a,b", real=true)
res = x + SymPy.integrate(abs(sin(2π * x)), (x, a, b))
I = SymPy.lambdify(res; use_julia_code=true)
@show res
@show SymPy.free_symbols(res)
@show I(0, 1, 0)
How do you get around this problem? |
That is a tricky one. It isn't supported in the underlying sympy library either:
The issue is the I was hoping this issue would be the one that got me to follow the lead of |
Attempting to evaluate
fn(5)
leads to errorUndefVarError: t not defined
. However, this should not be the case, since the only free symbol inex
isw
. The same error occurs if I don't try to replaceIntegral
with thequadgk
numerical.Attempting to fix this by replacing the final two lines with
leads to error
MethodError: no method matching iterate(::Symbol)
with corresponding stack traceThe text was updated successfully, but these errors were encountered: