2. Mathematical modeling of production planning

 

 

 

The objective function: max = 72 * x + 64 * y;

Restrictions:

 

  1. Material: x + y <= 50;
  2. Working time: 12 * x + 8 * y <= 480;
  3. Processing capacity: 3 * x <= 100;
  4. Non-negative constraints: x> = 0, y> = 0;

①Lingo Code:

max=72*x+64*y;
[st_1] x+y<50;
[st_2] 12*x+8*y<480;
[st_3] 3*x<100;
  
Observations have x = 20; y = 30 the maximum profit
 
 

 

 The results above!

Q1: If you can recruit workers, hourly wage up to how much? A: From the results in Figure lingo, [st_2] variables increase 1, Dual Price increase of 2, that is, the total operating time increased by 1, profit increased by 2 million, so if hired workers, wages should not be more than 2 yuan per hour

Q2: If you get 35 yuan a barrel of milk, ask buy, how much to buy? A: The need to add a variable t, the number of the need to buy a bucket of milk, you can get new code

max=72*x+64*y-35*t;
[st_1] x+y<50+t;
[st_2] 12*x+8*y<480;
[st_3] 3*x<100; 

 

Finally, the results from the screenshot (hold out) can be seen t take ten, maximum profit that can buy, buy ten barrels 

Summary: To go to think about their own problems, to find the problem hands! 

Guess you like

Origin www.cnblogs.com/lysun/p/mathematical_modeling2.html