Optimization of system of equations with descriptive statistics functions

28 Views Asked by At

Let's say that I have to optimize the following systems of equations and inequalities:

Being $L$ the length variable, $S$ the speed, $TotalTime$ the variable to optimize, and $C$ and $D$ given constants

$$ L = \{ L_0 L_1 ... L_n\} \\ S_0L_0 + S_1L_1 ... S_nL_n = TotalTime \\ L_0 + L_1 + ... + L_n = C \\ Var(L) \leq D $$

I wonder how should I approach a solution for this problem? Machine learning or reinforcing learning comes to my mind but still I wonder what would be the algebraic way to optimize this problem.

1

There are 1 best solutions below

0
On BEST ANSWER

Here is a sample solution for YALMIP

n = 10;
S = rand(n,1);
C = rand(1,1);
D = rand(1,1);

L = sdpvar(n,1);

totaltime = S'*L;
F = [sum(L) == C; (L-mean(L))'*(L-mean(L)) <= D; L >= 0];

optimize(F,totaltime)