enter image description here


Let $x_{ij}$ be the amount of money we invest for a period of $j$ months. We want to maximize the total cash at end of month 4 (or beginning of month 5). We have that objective function is

$$ z = 1.001 x_{11} + 1.005 x_{12} + 1.01 x_{13} + 1.02 x_{14} $$

Now, as for the constraints, i find this tricky. Can I have some tips or suggestions as to how to find a set of constraints for this LP formulation?


Denote by

$m_i\ $ : Cash at the beginning of month $i$ before investment, but after bills
$n_i\ \ $ : Cash at the beginning of month $i$ after investment

$p_i$ : Revenue minus bills at beginning of month $i$

$a_i\,$ : 1-month investment at the beginning of month $i$
$b_i\ $ : 2-month investment at the beginning of month $i$
$c_i\,$ : 3-month investment at the beginning of month $i$
$d_i\,$ : 4-month investment at the beginning of month $i$

Then the $p_i$s are constants equal to


The $m$s and $n$s are not choices, so each of them implies an equality constraint in addition to the non-negativity:

$m_1=400+p_1\\m_2=n_1+p_2+1.001 a_1\\m_3=n_2+p_3+1.001 a_2+1.005 b_1\\m_4=n_3+p_4+1.001 a_3+1.005 b_2+1.01 c_1\\m_5=n_4+p_5+1.001 a_4+1.005 b_3+1.01 c_2+1.02 d_1$


$m_1\geq 0,m_2\geq 0,m_3\geq 0,m_4\geq 0,m_5\geq 0,n_1\geq 0,n_2\geq 0,n_3\geq 0,n_4\geq 0$

The $a,b,c,d$s are choices and don't even need non-negativity constraints.

The variables are

And the utility function is
$z = m_5$

  • 1
    $\begingroup$ we like to use the first letters of the alphabet for constants; n/m for dimensions, and the last letters for variables $\endgroup$ – LinAlg Sep 2 '18 at 22:50

The constraints are $(400-x-y-z-w)+400+1.001x-600=0$ at the beginning of the first month assuming the interest is paid at the beginning of the month on investments and the investments are all made at the beginning of month $0$ (see below for justification the latter assumption, in short this is because the interest amounts are such that it makes sense to only consider equality constraints). The second month gives rise to constraint $800+1.005y-500=0$, the third, $300+1.01z-500=0$ and the 4th month gives $300+1.02w-250=T$ where $T$ is the end amount to be maximized. The problem is simplified by the fact that the interest amounts are all increasing in the number of months, this lead to equality constraints rather than inequality constraints.


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.