-
Notifications
You must be signed in to change notification settings - Fork 32
Closed
Description
I have a project where I generate lots of models and find their steady states using HC. However, I find that quite often I get HC errors for various inputs. Here is one example:
using DynamicPolynomials
import HomotopyContinuation
HomotopyContinuation.@var X1 X2 X3
poly1 = HomotopyContinuation.System([
-0.18704475670296675*X3 - 0.023748976311324048*X3^4 - 2.1429687752634874*(X2^3)*X3 - 0.6874329414442399*(X1^3)*X3 + 7.8759081760412375*(X1^3)*(X2^3) - 0.2720916404005911*(X2^3)*(X3^4) - 0.08728300610911549*(X1^3)*(X3^4) - 7.8759081760412375(X1^3)*(X2^3)*X3 - (X1^3)*(X2^3)*(X3^4),
-6.3789556272117505*X1 + 2.2623861285717575*X3^3 - 2.2623861285717575*X1*X3^3 - 2.8195698102334017X1^4 - (X1^4)*X3^3,
-0.8988646055564954*X2 - 0.41957276727278686*X2*X3^3 - 2.1423330484461474*(X1^3)*X2 + (X1^3)*X3^3 - (X1^3)*X2*X3^3
])
result = HomotopyContinuation.solve(poly1) # Works
# Same input, but with `DynamicPolynomials.Polynomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, MultivariatePolynomials.Graded{MultivariatePolynomials.LexOrder}, Float64}` type
poly2 = DynamicPolynomials.Polynomial{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, MultivariatePolynomials.Graded{MultivariatePolynomials.LexOrder}, Float64}[
-0.18704475670296675*X3 - 0.023748976311324048*X3^4 - 2.1429687752634874*(X2^3)*X3 - 0.6874329414442399*(X1^3)*X3 + 7.8759081760412375*(X1^3)*(X2^3) - 0.2720916404005911*(X2^3)*(X3^4) - 0.08728300610911549*(X1^3)*(X3^4) - 7.8759081760412375(X1^3)*(X2^3)*X3 - (X1^3)*(X2^3)*(X3^4),
-6.3789556272117505*X1 + 2.2623861285717575*X3^3 - 2.2623861285717575*X1*X3^3 - 2.8195698102334017X1^4 - (X1^4)*X3^3,
-0.8988646055564954*X2 - 0.41957276727278686*X2*X3^3 - 2.1423330484461474*(X1^3)*X2 + (X1^3)*X3^3 - (X1^3)*X2*X3^3
]
result = HomotopyContinuation.solve(poly2) # ERROR: ArgumentError: reducing over an empty collection is not allowed; consider supplying `init` to the reducerSo, things work for poly1 but not poly2. The only difference is that poly2 have a specific type designated (which is the type of the polynomial when I generated it from my reaction system model).
Metadata
Metadata
Assignees
Labels
No labels