google / jaxopt

Hardware accelerated, batchable and differentiable optimizers in JAX.
https://jaxopt.github.io
Apache License 2.0
939 stars 66 forks source link

Constraining output in ScipyRootFinding. #415

Open sagarwal-atg opened 1 year ago

sagarwal-atg commented 1 year ago

Hey,

I am using ScipyRootFinding to find the roots of a nonlinear system. I want to make sure the solution stays within some min_x and max_x.

Any advice or pointers? I checked the parameters for all solvers and nothing jumped out.

Thanks

mblondel commented 1 year ago

I don't think that's possible with ScipyRootFinding. So your root finding problem has a non-unique solution and you know that there exists a solution in [min_x, max_x]? One way would be to solve min_x ||f(x)||^2 s.t. x in [min_x, max_x] instead. We recently merged LBFGSB, which could be use for that pupose.