On Fri, 2021-09-03 at 02:25 -0700, Pol del Aguila Pla wrote: > I've encountered a bug in minimize_constrained where it seems that the > variable name has an effect on the result. My guess is that this happens > somewhere along the translation from symbolic to numerical function. > Attached is a minimal notebook to reproduce the bug. Run in the latest > docker image sagemath/sagemath:latest. >
minimize_constrained() is using the variables() method on your function, and variables() sorts said variables alphabetically. So, for example, sage: cm1,c0,c1 = SR.var('cm1,c0,c1') sage: f(cm1,c0,c1) = cm1 + c0 + c1 sage: f.variables() (c0, c1, cm1) The minimizer is thus not in the order that you'd expect (i.e. not in the correct order to be passed to f). I opened https://trac.sagemath.org/ticket/32511 for this. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/0bcbee79e4ceffd14dc259039e7b6a3b2c6a0b03.camel%40orlitzky.com.