The problem:

The mechanical workshop can produce $600$ units of part #1 or $1200$ units of part #2 per shift. The production capacity of the thermal workshop, where these parts are sent for heat treatment on the same day, allows for processing $1200$ units of part #1 or $800$ units of part #2 per shift. The prices of both parts are the same. It is necessary to determine the daily production program of parts that maximizes the company's output, given the additional condition that both workshops work one shift.

So, in the end we obtain a mathematical model of the given problem in the form of a linear programming problem, both the objective function and the constraint functions should be linear. Which can be solved using simplex method.

Simply speaking, I need the problem above to be described in linear equation with constraints.

Example (not related to the problem above):

enter image description here

  • 2
    $\begingroup$ Do you have a question about this? $\endgroup$
    – prubin
    May 8, 2023 at 17:21
  • $\begingroup$ @prubin, Yes, I have a text part with a problem described, and want to know how I can write it as a function with limitation, as provided in the example. So in the end I can take this information and solve the problem by myself. I just can't make things right while trying to implement function with limitations according to the described problem. Would appreciate your help a lot, really. $\endgroup$
    – Bohdan
    May 8, 2023 at 17:45
  • 1
    $\begingroup$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. $\endgroup$
    – Community Bot
    May 8, 2023 at 21:35
  • 1
    $\begingroup$ How is this not trivial? Why not just make 800 of #2, since that's the highest quantity that both workshops can process? $\endgroup$
    – Reinderien
    May 9, 2023 at 2:48
  • $\begingroup$ @Reinderien, so, how it would look like in linear equation with constraints? Would really appreciate your help. $\endgroup$
    – Bohdan
    May 9, 2023 at 6:17

1 Answer 1


I assume that both workshops can produce both products in a shift and the working rate is constant. That is, e.g., the mechanical workshop could produce 300 of product 1 and 600 of product 2 in a single shift. A linear program could then look as follows:

Let $x_{i}$ be the units produced of product $i$ and $p_i$ the profit earned when producing (and selling) product $i$.

Linear Program \begin{align} \ & \max z = p_1 \cdot x_{1} + p_2 \cdot x_{2} \; \\ \\\textit{S.t.}\\ \\ & \frac{x_1}{600} + \frac{x_2}{1200} \leq 1 & \tag1 \\ \\ & \frac{x_1}{1200} + \frac{x_2}{800} \leq 1 & \tag2 \\ \\ & x_{1}, x_{2} \in \mathbb{N} \tag3 \end{align}

The objective is to maximize profit. Constraints (1) and (2) ensure that the capacities of workshops are not exceeded. Constraint (3) states that the units produced must be natural numbers.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.