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.Thu, 03 Jun 2021 02:50:34 +0200min-max-ing a function with sagehttps://ask.sagemath.org/question/57427/min-max-ing-a-function-with-sage/Suppose S is a family of k matrices. Then, given formal variables x[0], ... , x[k], consider the expression min(x[0] * S[0] + ... + x[k-1]*S[k-1]). I want to maximize the value of this expression with respect to the constraints x[0],...x[k] >= 0 and x[0] + ... + x[k] = 1.
This is the corresponding mathematica code:
\[Beta][T_] :=
With[{vars = Array[x, Length[T]]},
Maximize[{Min[Total[MapThread[Times, {vars, T}]]], (And @@ Thread[vars >=0])&& Total[vars] == 1},vars]
]
How can I define this in sage?
I have thought of using `sage.numerical.optimize.minimize_constrained` but I do not particularly like it because it (unlike mathematica) seems to give inexact values.chlamydomonasThu, 03 Jun 2021 02:50:34 +0200https://ask.sagemath.org/question/57427/