0
$\begingroup$

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$?

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – sqlman Sep 24 '19 at 19:59
  • $\begingroup$ 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 $\endgroup$ – Mel Sep 26 '19 at 16:48
0
$\begingroup$

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}

$\endgroup$
  • $\begingroup$ Thank you ! you're right ! $\endgroup$ – Mel Sep 26 '19 at 16:45

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.