1 | initial version |
The "minimize" wrapper has better Sage integration (e.g. symbolic gradients). The equivalent of the above example would be something like
sage: var("x, y")
(x, y)
sage: f = x^2 + y^2 - 1
sage: g = x - y^2
sage: eqs = f, g
sage: minimize(norm(vector(eqs)), [1.0, 1.0])
Divide-by-zero encountered: rhok assumed large
Warning: Desired error not necessarily achieveddue to precision loss
Current function value: 0.000000
Iterations: 57
Function evaluations: 124
Gradient evaluations: 123
(0.61803398875, 0.786151377757)
So if you wanted a one-liner, something along those lines might do it.