# Linear Programming Production Process Constraint Relationship

Objective function is to maximize profit. Decision variables is how much qty of $$C$$ and $$D$$ to produce?

Raw material can produce either $$A$$ or $$B$$.

Product $$C$$ requires an input of qty $$A$$ and $$\frac{1}{2}B$$. Product $$D$$ requires an input of qty $$2A$$ and $$B$$. Cost to produce $$A$$ is $$2$$ and $$B$$ is $$4$$.

In the constraint, if I put $$A + \frac{1}{2}B=C$$, the program will set $$B$$ to 0 as its cost is higher.

How to write the constraint so that $$C$$ must consist exactly the qty ratio of $$A$$ and $$\frac{1}{2}B$$?

• I suggest that you add a constraint of the form 2A-B=0, then you always have enough A and B to produce C and D. – sqlman Sep 24 '19 at 19:59
• I want to add that , for processes, it is crucial to have a constraint to link the output to the input such as Output <= Input – Mel Sep 26 '19 at 16:48

If you write $$A+\frac{B}{2} = C$$, it means that to produce $$1$$ unit of $$C$$ you can either use $$1$$ unit of $$A$$ or half a unit of $$B$$.
What you want is $$1$$ unit of $$A$$ AND half a unit of $$B$$, so you need to write the constraint the other way around : \begin{align} C &= A \\ C &= 2B \end{align}