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.
Here is a sample solution for YALMIP