# Greenhouse Planning and The Diet Problem

## Intro

Tonight is about greenhouse planning and the tonight. We will examine the method for solving the problem. Linear programming is the mathematical method we will use. The question is, what the heck is linear programming? It is a mathematical modeling method that works great for solving systems of linear equations. We will use create a system of linear equations that will solve our diet problem. This will be great for greenhouse planning because will know how many square feet we will need.

## Layman’s Version of Linear Programing

Linear programming would be considered a part of an undergraduate level mathematical modeling course for math major. People who are in operations research, engineering, or other related fields probably get a taste of linear programming. Having said that most people don’t know what it is or have even the slightest desire to broach the topic of mathematical modeling. After all math is supposed to be done when you leave school right :).

This however does not deny the fact how important and valuable linear programming is. So to explain it to those who don’t understand it and also to make those of you who are not so familiar more comfortable. The best way to think of it is a linear program is a collection of equations that are related in a system with linear relationships. Linear meaning line and those equations in the linear program are weighed against each other to discover the best possible decision for each variable. The easiest way to see it is by seeing a simple graph.

## The Feasible Region

What you are seeing above is the feasible region. That represents where the answer lies for the system based on whether variables are maximized or minimized. The lines are constraints for the system. All of this to say this will be the method that we will use to solve the diet problem. This will be coded in the programming language python so that it can be repeated many times quickly so that we can evaluate changes and differences quickly.

I know this seems very technical and off topic for greenhouse planning. However, the approach is to allow us to accurately calculate the diet we would like to support via our greenhouse. To get the answer we want we will use this method. That will allow us to arrive and be flexible for the future and to get the best possible option for what we are doing. This will seem much more in clear as how it fits once I share the results of the diet problem solver with you all.

## Defining The Model

So there are few things we need to decide. The first thing is what is the objective function that we are trying to solve for. In this case it would be nutrients needed. The function would look something like S = sum(x_ij*c_ij) where the x_ij’s are the number of each of the plants we are thinking of growing. The c_ij’s would be the amount of sqft used per nutrient for each plant.

## Constraint Equations

We then will need some constraint equations. One need is a minimum required amount of nutrient needed by nutrient. That ensures all dietary requirements are covered. The next constraint is total space. This can be very large to see what the model spits out. It can also can be taken down to fit what you have available. That will give you the best possible answer to solve your dietary needs while maximizing space.

Overall this will be a fairly simple but robust linear program. I am very excited to roll this out and get started to share. Please comment with any thoughts and/or suggestions you may have for this.