Modeling a problem as a linear programming problem 
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?
 A: 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$
A: 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.
