0
$\begingroup$

I know that on fist glance this seems as already explained problem on many internet places, but I haven't found solution anywhere. Anyway, here is my function:

$$F=\sum_{i=0}^N |S_i|$$ where $$S_i=\sum_{j=0}^M A_kX_j$$ for k=1, 2, ...N*M, and $A_k$ are constants.

The goal is to minimize function F, where $X_j$ is variable, including conditions:

$$|S_i|\le B_i$$ for every i and $$\sum_{j=0}^M X_j=C$$ where $B_i$ and C are constants.

It would be helpful to know what part of mathematics is dealing with these problems, or even better to understand algorithm how to write program code.

Thanks in advance.

$\endgroup$
  • $\begingroup$ A few comments: Your definition of $S_i$ is not dependent on $i$, and I'm pretty sure you are looking for linear programming as a method. $\endgroup$ – Don Thousand Mar 28 at 13:41
0
$\begingroup$

Introduce a new variable $q_i$ to represent and replace every $|S_i|$ term, and add the constraint $-q_i \leq S_i \leq q_i$. With that, you have a linear program and when you optimize, you will have $q_i = |S_i|$ at the optimum (otherwise it would be possible to improve the solution by decreasing $q_i$)

$\endgroup$
  • $\begingroup$ Thanks for your effort, you solved my problem. I was aware of this replacement, but I mess up constraints. Now optimisation is working. $\endgroup$ – Dusan Presic Mar 29 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.