# PHPSimplex

## Optimizing resources with Linear Programming

### Fruit trees' problem

A farmer has a plot of land of 640m² to dedicate it to the cultivation of fruit trees: orange, pear, apple and lemon trees. He ask himself the way to distribute the surface of the land among the varieties to get the maximum benefit knowing that:

• each orange tree needs at least 16m², each pear tree 4m², each apple tree 8m² and each lemon tree 12m².
• there are 900 hours availables per year, needing each orange tree 30 hours per year, each pear tree 5 hours, each orange tree 10 hours, and each lemon tree 20 hours.
• because of drought, the farmer has restrictions for irrigation: he has been assigned with 200m³ of water per year. The yearly needs are: 2m³ per each orange tree, 3m³ per each pear tree, 1m³ per each apple tree, y 2m³ per each lemon tree.
• the unitary benefits are 50, 25, 20, and 30 € for each orange tree, pear tree, apple tree and lemon tree respectively.

Determining decision variables and expressing them algebraically:

• X1: numbers of orange trees
• X2: numbers of pear trees
• X3: numbers of apple trees
• X4: numbers of lemon trees

Determining the restrictions and expressing them as equations or inequalities in function of the decision variables. Such restrictions can be obteined from each land, work hours and water needs per tree:

• Land needs: 16·X1 + 4·X2 + 8·X3 + 12·X4 ≤ 640
• Yearly Hours needs: 30·X1 + 5·X2 + 10·X3 + 20·X4 ≤ 900
• Water needs: 2·X1 + 3·X2 + X3 + 2·X4 ≤ 200

Expressing all implicit conditions established by the origin of variables: negativeness, integer, only a few allowed values... . In this case, the restrictions are that the number of trees can't be negative and must be an integer number:

• Xi ≥ 0
• Xi are integers

Determining objective function:

• Maximize Z = 50·X1 + 25·X2 + 20·X3 + 30·X4
Copyright ©2006-2023 PHPSimplex. All rights reserved. X

PHPSimplex
Version 0.81