Comments (6)
Numerically we will not make use of any of the additional precision provided by big floats. So any fix would just truncate the coefficients .
from homotopycontinuation.jl.
Hello
I think I ran into the same issue, I have two very similar systems, but system 1 runs fine, system2 returns the same error as you. At first I thought the error has to do with constant coefficients appearing in the system, but then I generated some random polynomial and that doesn't seem to be the issue.
Maybe it has to do with the differentiate command?
using HomotopyContinuation
using DynamicPolynomials
using Random
# Set random seed
Random.seed!(134)
@polyvar x[1:2]
# Function to generate a random polynomial with BigFloat coefficients
function random_polynomial(variables, degree::Int, num_terms::Int)
polynomial = zero(BigFloat) # Initialize the polynomial with a BigFloat zero
for _ in 1:num_terms
coeff = BigFloat(rand(-10.0:0.1:10.0))
powers = rand(0:degree, length(variables))
monomial = prod(v^p for (v, p) in zip(variables, powers))
polynomial += coeff * monomial
end
return polynomial
end
# Generate two random polynomials of degree 2 with 5 terms each
poly1 = random_polynomial(x, 4, 10)
poly2 = poly1 + BigFloat(1.0) * x[1] + BigFloat(1.0) * x[2]
grad_p1 = differentiate.(poly1, x)
grad_p2 = differentiate.(poly2, x)
# Define the system of equations
system_1 = System(grad_p1)
system_2 = System(grad_p2)
# Solve the system
R1 = HomotopyContinuation.solve(system_1)
println("Result: ", R1)
R2 = HomotopyContinuation.solve(system_2)
println("Result: ", R2)
from homotopycontinuation.jl.
Hi all,
all I can say is that we never tested against BigFloat
. In principle, everything should be abstractified to an extend that allows any number type. But there is always a chance a bug slipped through. I think, one has to test all functions with BigFloat
input to understasnd what goes wrong.
@gescholt Can you try @var
instead of @polyvar
?
from homotopycontinuation.jl.
@PBrdng @var
gives the same output:
ERROR: MethodError: no method matching HomotopyContinuation.ToricHomotopy(::MixedSystem{(0xd448607d78e104ed, 1)}, ::Vector{Vector{Complex{BigFloat}}})
Closest candidates are:
HomotopyContinuation.ToricHomotopy(::S, ::Vector{ComplexF64}, ::Vector{Float64}, ::Vector{Float64}, ::StructArrays.StructVector{ComplexF64, @NamedTuple{re::Vector{Float64}, im::Vector{Float64}}, Int64}, ::Vector{ComplexF64}, ::Vector{ComplexF64}, ::Vector{ComplexF64}, ::Base.RefValue{ComplexF64}, ::Base.RefValue{ComplexF64}, ::TaylorVector{5, ComplexF64}, ::TaylorVector{4, ComplexF64}, ::TaylorVector{3, ComplexF64}) where S<:AbstractSystem
@ HomotopyContinuation ~/.julia/packages/HomotopyContinuation/NcbGJ/src/homotopies/toric_homotopy.jl:16
HomotopyContinuation.ToricHomotopy(::AbstractSystem, ::Vector{Vector{ComplexF64}})
@ HomotopyContinuation ~/.julia/packages/HomotopyContinuation/NcbGJ/src/homotopies/toric_homotopy.jl:37
from homotopycontinuation.jl.
@PBrdng, switching the method to HomotopyContinuation.solve(system_2; start_system=:total_degree)
indeed make the computation work.
from homotopycontinuation.jl.
@PBrdng, switching the method to
HomotopyContinuation.solve(system_2; start_system=:total_degree)
indeed make the computation work.
Then, the problem is the overflow in the polyhedral homotopy.
It could be, though, that BigFloats
are converted to usual floats in the implementation. Like I said, no one has ever tested this against BigFloats
.
from homotopycontinuation.jl.
Related Issues (20)
- e not defined for sqrt() HOT 6
- Converting from Nemo.fmpq_mpoly to HomotopyContinuation.Expression HOT 3
- cache_min_length failing with empty iterator HOT 1
- Seed for mondromy not working as intended
- Symbolic linear system solving not supported by ModelKit HOT 2
- find_start_pair failing on some linearly-parametrized square systems HOT 2
- `OP_POW` not defined HOT 5
- Add checkpoints for monodromy_solve
- HC fails to solve sanity check HOT 7
- Strange behaviour of numerical irreducible decomposition HOT 4
- Can't build a system with Unicode symbols in variable names HOT 2
- `Threads.resize_nthreads!` is deprecated HOT 1
- Non-real solution incorrectly certified as real
- Start System Complaints: Incorrect Rank Calculation HOT 2
- What is the best way to approximate trigonometric functions in HC HOT 2
- LaTeX pretty printing breaks for (negative) exponents HOT 2
- sing_accuracy not recognised as endgame parameter HOT 9
- Missing Solutions HOT 8
- Arblib dependencies incompatible with Oscar.jl HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homotopycontinuation.jl.