Current location - Education and Training Encyclopedia - Graduation thesis - Using MATLAB to solve the linear programming problem of mathematical modeling of tree planting.
Using MATLAB to solve the linear programming problem of mathematical modeling of tree planting.
Set up digging holes, planting trees and watering. Boys have 1, x2, x3, and girls have y 1, y2, y3.

Only by watering and playing with water can a tree bear a good load.

Maximum 25x3+15y3

0 & lt= x 1+x2+x3 & lt; = 30

0 & lt= y 1+y2+y3 & lt; = 20

20x 1+ 10y 1 & gt; = 30 x2+20 y2 & gt; = 25x 3+ 15y 3 & gt; = 0

matlab:

f =[0 0-25 0 0- 15];

a =[ 1 1 1 0 0; - 1 - 1 - 1 0 0 0; 0 0 0 1 1 1; 0 0 0 - 1 - 1 - 1;

-20 30 0 - 10 20 0; 0 -30 25 0 -20 15; 0 0 -25 0 0 - 15; ];

b =[30; 0; 20; 0; 0; 0; 0];

Lb = zero (6,1);

& gt& gt[x fval] = linprog(f,A,b,[],[],lb)

Optimization terminated.

x =

17.5000

0.0000

12.5000

0.0000

17.5000

2.5000

fval =

-350.0000