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

Better warning/error message for monodromy_solve when start solution is wrong/bad #618

Closed
TorkelE opened this issue Feb 6, 2025 · 7 comments

Comments

@TorkelE
Copy link

TorkelE commented Feb 6, 2025

I try to find steady states using monodromy (from a case where I know one solution, but there are two additional ones):

using HomotopyContinuation
@var X Y k1 k2 k3 k4 
polys = [
    -k1*Y + 0.5*k2*X^2
    -X*k4 + 2*k1*Y - 0.5*k2*X^2 - Y*X*k3
]
sys = HomotopyContinuation.System(polys; parameters = [k1 ,k2, k3, k4])

p_vals = [8.0, 2.0, 1.0, 1.5]
ss_init = [4.5, 6.0]
mres = monodromy_solve(sys, ss_init, p_vals)

Here I get a:

┌ Warning: None of the provided solutions is a valid start solution.
└ @ HomotopyContinuation ~/.julia/packages/HomotopyContinuation/HdN5z/src/monodromy.jl:806

In this case I flipped it, and it should have been ss_init = [6.0, 4.5]. I presume that the problem is that the start solution does not solve the system (with the correct one, everything works flawlessly). However, it might be useful to have a note that this is the reason (if Homotopy Continuation knows this to bet he case).

@PBrdng
Copy link
Collaborator

PBrdng commented Feb 10, 2025

I presume that the problem is that the start solution does not solve the system

Exactly, thats the reason. Doesn't the warning message

Warning: None of the provided solutions is a valid start solution.

say this explicitly? What do you suggest otherwise?

@TorkelE
Copy link
Author

TorkelE commented Feb 10, 2025

Basically, it would be an improvement (a mild improvement, this is not a biggie) to explicitly say that it is due to the solutions not actually being solutions to the system. I.e. I was uncertain if they were not valid because they had the wrong format or some other issue.

@PBrdng
Copy link
Collaborator

PBrdng commented Feb 12, 2025

What about

Warning: None of the provided solutions is a valid start solution (F(x) ≠ 0).

@TorkelE
Copy link
Author

TorkelE commented Feb 12, 2025

Yes, that'd be perfect

@saschatimme
Copy link
Member

It's also a non-valid start solution if the Jacobian doesn't have full column rank

@PBrdng
Copy link
Collaborator

PBrdng commented Feb 12, 2025

True.

"None of the provided solutions is a valid start solution (F(x) ≠ 0 or det JF(x) = 0)"?

@PBrdng
Copy link
Collaborator

PBrdng commented Feb 14, 2025

See #622

@PBrdng PBrdng closed this as completed Feb 14, 2025
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

3 participants