I am trying to formulate the following MILP:
A company produces products A and B by processing material M through a machine. The requirements and selling price of a unit of each product are given as follows:
Product A requires 5 units of M and 2 minutes of machine time to make, and sells for £25.
Product B requires 8 units of M and 6 minutes of machine time to make, and sells for £45
The company has available 120 minutes of machine time weekly at no cost. The material M, however, must be purchased from an outside vendor. The company can purchase no more than 350 units of M per week. The price is £3/unit for the first 200 units, and £2/unit afterward. Formulate the mixed integer-linear programming problem to maximise the revenue of the company.
So far I have the following: Define $x_1$ and $x_2$ to be the number of units of A and B, respectively, to be produced and sold weekly, $x_3$ the number of units of M purchased at £3/unit and $x_4$ the number purchased at £2/unit.
The cost function to be maximized is $\max z=25x_1+45x_2-3x_3-2x_4$, subject to
$2x_1+6x_2 \leqslant 120$, (constraint on machine time),
$\quad$$\qquad$ $x_3\leqslant200$, (since after 200 units, M costs £2 instead of £3),
$\quad$$x_3+x_4\leqslant350$ (constraint on unit of M purchased per week),
But I am unsure how to formulate the "if-then" constraint that would make sure that if $x_3<200$ then $x_4=0$. I think I'll need to introduce a binary variable, any hints on how to go about this would be appreciated!
I also need a constraint that says that A is made from 5 units of M, and B is made from 8, but don't know how exactly. Is the constraint $5x_1+8x_2\leqslant x_3+x_4 \quad$ i.e $\quad 5x_1+8x_2-x_3-x_4\leqslant0$ sufficient?