Modeling a problem as a linear programming problem

linear programming

enter image description here

Attempt

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?

Best Answer

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

$p_1=400-600\\p_2=800-500\\p_3=300-500\\p_4=300-250\\p_5=0$

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$

$n_1=m_1-a_1-b_1-c_1-d_1\\n_2=m_2-a_2-b_2-c_2\\n_3=m_3-a_3-b_3\\n_4=m_4-a_4$

$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
$m_1,m_2,m_3,m_4,m_5,n_1,n_2,n_3,n_4,a_1,a_2,a_3,a_4,b_1,b_2,b_3,c_1,c_2,d_1$

And the utility function is
$z = m_5$