Skip to content
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

Problems with complex numbers (or perhaps just with SpecialFunctions?) #17

Open
rulatir opened this issue Jan 13, 2019 · 1 comment
Open

Comments

@rulatir
Copy link

rulatir commented Jan 13, 2019

using SpecialFunctions
f(x,y) = abs(zeta(x + y*im))
r = Eq(f, 1)
plot(r)
ERROR: MethodError: no method matching AbstractFloat(::ImplicitEquations.OInterval)
Closest candidates are:
  AbstractFloat(::Real, ::RoundingMode) where T<:AbstractFloat at rounding.jl:185
  AbstractFloat(::T<:Number) where T<:Number at boot.jl:725
  AbstractFloat(::Bool) at float.jl:250
  ...
Stacktrace:
 [1] float(::ImplicitEquations.OInterval) at ./float.jl:269
 [2] float(::Complex{ImplicitEquations.OInterval}) at ./complex.jl:967
 [3] zeta(::Complex{ImplicitEquations.OInterval}) at /home/rulatir/.julia/packages/SpecialFunctions/fvheQ/src/gamma.jl:512
 [4] f(::ImplicitEquations.OInterval, ::ImplicitEquations.OInterval) at ./REPL[84]:1
 [5] compute_fxy(::ImplicitEquations.Pred, ::ImplicitEquations.Region, ::Int64, ::Int64, ::Int64, ::Int64, ::Int64, ::Int64) at /home/rulatir/.julia/packages/ImplicitEquations/0nm3T/src/intervals.jl:307
 [6] compute(::ImplicitEquations.Pred, ::ImplicitEquations.Region, ::Int64, ::Int64, ::Int64, ::Int64, ::Int64, ::Int64) at /home/rulatir/.julia/packages/ImplicitEquations/0nm3T/src/intervals.jl:316
 [7] RefinePixels(::ImplicitEquations.Pred, ::Array{ImplicitEquations.Region,1}, ::Int64, ::Int64, ::Int64, ::Int64, ::Int64, ::Int64, ::Array{ImplicitEquations.Region,1}, ::Array{ImplicitEquations.Region,1}, ::Array{ImplicitEquations.Region,1}) at /home/rulatir/.julia/packages/ImplicitEquations/0nm3T/src/tupper.jl:80
 [8] GRAPH(::ImplicitEquations.Pred, ::Int64, ::Int64, ::Int64, ::Int64, ::Int64, ::Int64) at /home/rulatir/.julia/packages/ImplicitEquations/0nm3T/src/tupper.jl:69
 [9] macro expansion at /home/rulatir/.julia/packages/ImplicitEquations/0nm3T/src/plot_recipe.jl:152 [inlined]
 [10] apply_recipe(::Dict{Symbol,Any}, ::ImplicitEquations.Pred) at /home/rulatir/.julia/packages/RecipesBase/Uz5AO/src/RecipesBase.jl:275
 [11] _process_userrecipes(::Plots.Plot{Plots.PyPlotBackend}, ::Dict{Symbol,Any}, ::Tuple{ImplicitEquations.Pred}) at /home/rulatir/.julia/packages/Plots/PGn1u/src/pipeline.jl:83
 [12] _plot!(::Plots.Plot{Plots.PyPlotBackend}, ::Dict{Symbol,Any}, ::Tuple{ImplicitEquations.Pred}) at /home/rulatir/.julia/packages/Plots/PGn1u/src/plot.jl:178
 [13] #plot#132(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::ImplicitEquations.Pred) at /home/rulatir/.julia/packages/Plots/PGn1u/src/plot.jl:57
 [14] plot(::ImplicitEquations.Pred) at /home/rulatir/.julia/packages/Plots/PGn1u/src/plot.jl:51
 [15] top-level scope at none:0
@jverzani
Copy link
Owner

Hmm, a few things need doing:

  • I added a float method, so that part isn't the issue
  • In general, the user would need to add a method like SpecialFunctions.zeta(o::ImplicitEquations) =... to call zeta on the IntervalArithmetic piece. But this fails, as IntervalArithmetic doesn't have the method, so that too would be needed.

Sorry, all a bit unsatisfying. I'd suggest trying https://github.com/JuliaIntervals/IntervalConstraintProgramming.jl though you might bump into the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants