Mathematical modeling--Lingo solves linear programming problems

Production and sales of dairy products

a question restatement

1.1 Problem Background

The factory makes a production plan based on external demand and internal equipment, manpower, raw materials and other conditions, as well as the maximum profit for the production target. According to the production plan, process flow, resource constraints and cost parameters, etc., the production batch plan is made with the minimum cost as the goal. If If short-term external demand and internal resources do not change with time, a single-stage production plan can be formulated, otherwise a multi-stage production plan should be formulated.

1.2 Question raised
1.21 Question 1

Introduction to the problem : the production plan for processing dairy products, it takes 12 hours to produce A1 with a profit of 24 yuan/kg, and it takes 8 hours to produce A2 with a profit of 16 yuan/kg, 50 barrels of milk per day, 480 hours, and can only process 100kg at most A1. How to make a production plan can maximize daily profits.
(1) In order to maximize the daily profit, 35 yuan can be purchased together with milk for processing. Do I need to buy it? If you buy it, how much can you buy at most every day?
(2) Temporary workers can be hired, so what is the maximum salary that can be paid per hour?
(3) If the profit of A1 is increasing to 30 yuan/kg, should the production plan be changed?

1.22 Question Two

Introduction to the problem : On the basis of problem 1, product B can be obtained by further processing on the basis of A. After two hours, each kilogram of A1 can be processed into 0.8kg of B1. At the same time, a processing fee of 3 yuan is paid, and a profit of 44 yuan can be obtained per kilogram. . After two hours, each kilogram of A2 can be processed into 0.75kg of B2. At the same time, a processing fee of 3 yuan is paid, and a profit of 32 yuan can be obtained per kilogram. (1
) 30 yuan can add 1 barrel of milk, and 3 yuan can increase the time for 1 hour. Should it be invest? If you invest 150 yuan now, how much can you earn back?
(2) The profits of B1 and B2 often fluctuate by 10%, does it affect the plan?
(3) The contract of selling 10kg of A1 per day must be satisfied, what impact will it have on profit?

Two problem analysis

Since product profit and processing time are constant, a linear programming model can be established. Through the three linear programming model elements of decision variable, objective function and constraint conditions, it is planned, solved by LINGO, and the output is rich, and the results can be further studied by using shadow price and sensitivity analysis.

3. Description of model assumptions and symbols

3.1 Model assumptions

1. Assume that there is no waste of raw materials in production.
2. The profit per kilogram of A1 and A2 is a constant that has nothing to do with their respective output.
3. The quantity and time of processing A1 and A2 per barrel of milk are constants that have nothing to do with the respective output.
4. The profit per kilogram of A1 and A2 is a constant that has nothing to do with mutual output.
5. The amount and time of processing A1 and A2 per barrel of milk are constants that have nothing to do with mutual output.
6. The number of milk buckets for processing A1 and A2 is a real number.
7. Assume that the production rates of workers are equal.
8. Assume that the problem of different returns brought about by market fluctuations is not considered.
9. Assume that the machines produced are not faulty.
10. Assume that there is no loss of raw materials when processing from A to B.

3.2 Symbol description

insert image description here
Table 1 Symbol description

4. Model establishment and solution

4.1 Modeling solution of problem 1

Question 1)

1. Model preparation

If x1 bucket of milk produces A1, the profit can be 72 x1; if x2 buckets of milk produce A2, the profit can be 64 x2, and the daily profit is: max Z=72 x1+64 x2, based on the known information Determine the following constraints:
insert image description here##### 2. Based on the establishment of the linear programming model Based
on the constraints in the model preparation, use the graphical method to draw the constraint range as follows: the
insert image description here
objective function and the constraints are linear functions, and the feasible region is a straight line segment The contour of the objective function is a straight line surrounded by a convex polygon, so the optimal solution must be obtained at a certain vertex of the convex polygon. It can be seen from the image analysis that the optimal solution is obtained at point B(20,30).

3. Model solution

Using Lingo software to solve the linear programming problem can get the following results:
insert image description here
insert image description here

Therefore, among the three resources, there is no surplus of raw materials, no surplus of time, and when the surplus of processing capacity is 40, the surplus of constraint "resources" is zero, which is an effective constraint, and 20 barrels of milk produce A1, 30 barrels of milk produce A2, and the maximum profit is 3360 yuan.
It can be seen from the running results that if the raw material increases by 1 unit, the profit will increase by 48, if the time increases by 1 unit, the profit will increase by 2, and a CPCT of zero means that the increase in processing capacity will not affect the profit.
Since 35<48, when you can buy a bucket of milk for 35 yuan, you should buy it. The wages paid by individuals employing temporary workers are at most 2 yuan per hour.
Lingo sensitivity analysis , the allowable variation range of the objective function coefficient when the optimal solution remains unchanged, the constraint conditions remain unchanged, the x1 coefficient range (64,96), the x2 coefficient range (48,72), and the x1 coefficient increases from 24 3=72 to 30 3=90, within the allowable range. A1 profit increased to 30 yuan/kg, without changing the production plan.
Interpretation of results:
insert image description here

When the shadow price is meaningful, the allowable change range of the right end is constrained, the objective function remains unchanged, the raw material is increased by 10 at most, and the time is increased by 53 at most, which is a sufficient condition.
So you can buy 1 barrel of milk for 35 yuan, and you can buy up to 10 barrels per day.

question (2)

1. Model preparation

50 barrels of milk, 480h, up to 100kgA1, make a production plan to maximize the net profit every day.
Let x1 barrel of milk produce A1, set x2 barrel of milk to produce A2, x3 barrel of milk to produce B1, set x4 barrel of milk to produce B2, x5kg of A1 to process B1, x6kg of A2 to process B2, then the daily profit is: The information determines the following constraints:
insert image description here

2. Establishment based on linear programming model

According to the constraint conditions in the model preparation, the solution is as follows using Lingo:
insert image description here

168 kgA2 and 19.2 kgB1 are sold every day, and the profit is 3460.8 (yuan). 8 barrels of milk are processed into A1, 42 barrels of milk are processed into A2, and all 24kg of A1 obtained are processed into B1. All are tight constraints except processing capacity.

3. Model solution

insert image description here

Therefore, adding 1 barrel of milk will increase the profit by 37.92, and increasing the time by 1 hour will increase the profit by 3.26. If you invest 150 yuan and add 5 barrels of milk, you can earn back 189.6 yuan (more than the profit increase of increasing time).
Sensitivity analysis : B1 profit drops by 10%, exceeding the allowable range of the X3 coefficient, B2 profit increases by 10%,
exceeding X4 coefficient allowable range, fluctuations have an impact on the plan, B1 and B2 have 10% fluctuations in profit, and the Whether the plan is affected. The production plan should be re-formulated. For example, if the coefficient of x3 is changed to 39.6, the result will be greatly changed.
insert image description here

Interpretation of the results : When x1 increases by one unit from 0, the optimal objective function value will decrease by 1.68, the company's profit will decrease by 1.68×10=16.8 (yuan), and the optimal profit will be 3460.8 – 16.8 = 3444.

5. Evaluation of the model

5.1 Advantages of the model

1. Through mathematical relationship derivation, the accuracy of the model is high;
2. The establishment of the model is based on dynamic programming model, geometric model and other theories, using the principles of mathematics and probability
, and the obtained data and accuracy are more rigorous and precise.
3. The model assumes a variety of situations, eliminates external influences as much as possible, and introduces fewer errors. 4. The overall framework
of this paper is relatively complete from the study of model mechanism to model establishment, model solution, model verification, and model
sensitivity analysis. .

5.2 Disadvantages of the model

The analysis method is relatively targeted, and there are some errors when it is extended to real life. Reduced Cost is meaningful and conditional (not given by LINGO).

Guess you like

Origin blog.csdn.net/YouWan797411/article/details/130837858