-
Notifications
You must be signed in to change notification settings - Fork 156
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
Groebner requirement error even though Groebner is loaded. #1370
Comments
I guess there is a bug in handling tuples, since the following "works": julia> symbolic_solve([eq1, eq2], [RisoP, RisoN]) "works" in quotation because it fails later with the familiar monomial ordering error: julia> symbolic_solve([eq1, eq2], [RisoP, RisoN])
[ Info: Assuming (R2*RisoN + R2*RisoP + R3*RisoN + R3*RisoP + RisoN*RisoP) != 0
[ Info: Assuming (R1*R2*RisoN + R1*R2*RisoP + R1*R3*RisoN + R1*R3*RisoP + R1*RisoN*RisoP + R2*RisoN*RisoP + R3*RisoN*RisoP) != 0
ERROR: DomainError with Invalid monomial ordering.:
Stacktrace:
[1] map_variables(vars::Vector{Num}, varmap::Dict{DynamicPolynomials.Variable{…}, Int64})
@ Groebner ~/Groebner.jl/src/monomials/orderings.jl:347
[2] ordering_transform(ord::Lex{false, Num}, varmap::Dict{DynamicPolynomials.Variable{…}, Int64})
@ Groebner ~/Groebner.jl/src/monomials/orderings.jl:355
[3] io_convert_polynomials_to_ir(polynomials::Vector{DynamicPolynomials.Polynomial{…}}, options::Groebner.KeywordArguments)
@ GroebnerDynamicPolynomialsExt ~/Groebner.jl/ext/GroebnerDynamicPolynomialsExt.jl:32
[4] groebner0(polynomials::Vector{DynamicPolynomials.Polynomial{…}}, options::Groebner.KeywordArguments)
@ Groebner ~/Groebner.jl/src/groebner/groebner.jl:9
[5] #groebner#214
@ ~/Groebner.jl/src/interface.jl:110 [inlined]
[6] groebner_basis(polynomials::Vector{Num}; ordering::Lex{false, Num}, kwargs::@Kwargs{})
@ SymbolicsGroebnerExt ~/.julia/packages/Symbolics/8MbnV/ext/SymbolicsGroebnerExt.jl:45
[7] solve_zerodim(eqs::Vector{Num}, vars::Vector{Num}; dropmultiplicity::Bool, warns::Bool)
@ SymbolicsGroebnerExt ~/.julia/packages/Symbolics/8MbnV/ext/SymbolicsGroebnerExt.jl:209
[8] solve_zerodim
@ ~/.julia/packages/Symbolics/8MbnV/ext/SymbolicsGroebnerExt.jl:174 [inlined]
[9] solve_multivar(eqs::Vector{Num}, vars::Vector{Num}; dropmultiplicity::Bool, warns::Bool)
@ SymbolicsGroebnerExt ~/.julia/packages/Symbolics/8MbnV/ext/SymbolicsGroebnerExt.jl:311
[10] solve_multivar
@ ~/.julia/packages/Symbolics/8MbnV/ext/SymbolicsGroebnerExt.jl:310 [inlined]
[11] symbolic_solve(expr::Vector{Equation}, x::Vector{Num}; dropmultiplicity::Bool, warns::Bool)
@ Symbolics ~/.julia/packages/Symbolics/8MbnV/src/solver/main.jl:204
[12] symbolic_solve(expr::Vector{Equation}, x::Vector{Num})
@ Symbolics ~/.julia/packages/Symbolics/8MbnV/src/solver/main.jl:145
[13] top-level scope
@ REPL[15]:1
Some type information was truncated. Use `show(err)` to see complete types. Seems we really ought to revisit Symbolics.groebner_basis 😅 |
The issue is that Symbolics.jl/ext/SymbolicsGroebnerExt.jl Line 37 in c31c3fd
and I turn to hacky shenanigans to alleviate that (#1324). EDIT: @n0rbed maybe the solver has some internal function to convert to DP.jl polynomials and maintain a map of vartiables that we can use instead of symbol_to_poly ? |
Im afraid we'll still need the Symbolic version of the polys. we go back and forth a lot between both types. If you have the time, can you try running solve_zerodim or a portion of it on a DP? if no Symbolic equation is needed then this is good yes |
Recall that we call symbolic_solve on univariate expressions in solve_zerodim. Whence I think translating to DP.jl in solve_zerodim is challenging. |
It seems in the long run the solver would benefit from robust functions
that
We use PolyForm and it currently does not do 2. in a conveniet way (or at least I did not manage to make it always work). |
https://discourse.julialang.org/t/getting-the-symbolic-solution-of-system-of-equations-using-modelingtoolkit/122786/3
solve_multivar using Groebner is broken
[0c5d862f] Symbolics v6.21.0
The text was updated successfully, but these errors were encountered: