ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 16 Oct 2013 20:23:38 +0200Minimize returns vector with incorrect orderhttps://ask.sagemath.org/question/10616/minimize-returns-vector-with-incorrect-order/Minimize seems to be returning a vector ordered as if the input variables were sorted in alphabetical order, rather than in the order passed in. For example:
RVxayaxc = minimize( FAllaac(xa, ya, xc), [ixa,iya,ixc])
[ixa,iya,ixc], RVxayaxc
Gives the following. Note that the last two items are now reversed.
([107.048000000000,61.9900000000000,1.47700000000000],(107.075509604,1.47442809821,61.9967170491))
Is there any way to either avoid this or get the variable names for each item in the result?Wed, 16 Oct 2013 20:03:14 +0200https://ask.sagemath.org/question/10616/minimize-returns-vector-with-incorrect-order/Comment by kcrisman for <p>Minimize seems to be returning a vector ordered as if the input variables were sorted in alphabetical order, rather than in the order passed in. For example: </p>
<pre><code>RVxayaxc = minimize( FAllaac(xa, ya, xc), [ixa,iya,ixc])
[ixa,iya,ixc], RVxayaxc
</code></pre>
<p>Gives the following. Note that the last two items are now reversed.</p>
<pre><code>([107.048000000000,61.9900000000000,1.47700000000000],(107.075509604,1.47442809821,61.9967170491))
</code></pre>
<p>Is there any way to either avoid this or get the variable names for each item in the result?</p>
https://ask.sagemath.org/question/10616/minimize-returns-vector-with-incorrect-order/?comment=16923#post-id-16923Note that you are minimizing, and that the two are not *exactly* reversed, but the numbers are indeed different. Without knowing the function, it's hard to say whether this is actually wrong. Also, various algorithms may start at a point but then do some semi-random jumps to seek a minimum... Anyway, a little more detail is probably necessary for us to help. Thanks!Wed, 16 Oct 2013 20:23:38 +0200https://ask.sagemath.org/question/10616/minimize-returns-vector-with-incorrect-order/?comment=16923#post-id-16923