If we are going to invest 40000$ to bank that yields 7% (expected return), bonds that yield 9% and stock that yields 14% with the following constrains:
Expected return on investment has to be at least 5000$
Investment on stock has to be at least 10000$
Amount invested into stock cannot exceed money invested into bank or bonds.
At least 5000$ but no more than 10000 must be invested into bank
Sum of all investments must be exactly 40000$
We can see that all these constraints cannot be satisfied at the same time so we relax on 3,4 so that we minimize the sum of deviations of them and form a new model and solve it.
So initially the model is something like this, where $C_1$,$C_2$,$C_3$ are monies invested into bank, bonds and stock: \begin{align*} \operatorname{maximize}\,f(C_1, C_2,C_3) &= 0.07 C_1 + 0.09 C_2 + 0.14 C_3\\ \text{Subject to}\;\; f(C_1, C_2,C_3) &\geq 5000\\ C_3 &\geq 10000\\ C_3 &< C_2 + C_1\\ 5000 &\leq C_1 \leq 10000\\ C_1 + C_2 + C_3 &= 40000 \end{align*} How does one minimize deviation of constrains (or goals I guess in this case). Do I form OLS type of equations for the constrains?