Ask Your Question
1

min-max-ing a function with sage

asked 2021-06-03 02:51:11 +0200

chlamydomonas gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-06-03 09:07:36 +0200

tmonteil gravatar image

You should have a look at MILP in Sage:

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-06-03 02:50:34 +0200

Seen: 284 times

Last updated: Jun 03 '21