This paper presents the mathematical model used to optimizing the costs of the works and of the consumption of energy included in the materials necessary to carry out an irrigation canal. The results obtained by means of linear programming have been applied in the site, savings of 8% over the planned ones being obtained.