What is this economic theory? Cost of investment vs production accounting for time? I know there has got to be a standard set of theories or formulas to chart this but I don't know how to search for it. Other than a great place like this. :)

I'm a software developer and not an economist but I need to analyze data of factories that have simple defined expense to set up, each has a specified output and a length of time to build. 

While a larger factory might have the lowest cost per unit of production and therefore be the best bang the buck (assuming the setup cost was zero), the actual setup cost might be so large that it would take a long time to actually build the factory. It is actually more economical in the long run to build less costly and lower performing factories because in the long run you will have produced more and aquire the cost of the larger factory faster. 

What I am attempting to build is a formula/program that will advise on the next most profitable move and the required time to get there. 

If you haven't guessed this is actually to be tested an ran on a game scenario. However, I have many other applications and thought this would be a good start. 

I hope that makes sense. The cost of production, the output and such are all intentionally simplistic. There's no need to account for outside/variable factors in this particular scenario. 

If you can lead me to a theory/concept, perhaps a link or two or examples of this type of analysis given as set of inputs that would be great!

Thanks!
Sorry I don't have enough reputation yet in the Economics community to comment. But the answer provided by @Alecos Papadopoulos can be illustrated further. Please feel free to move my "answer" to comments of his answer. 

With the assumption of only $F' &gt; 0$ and $F &gt; 0$ and $h' &gt; 0$, then there is a simple case where the minimization problem has no solution. Consider when $F(q) = \sqrt{q}$ and $h(x) = x$. Then the objective function becomes $1 / \sqrt{q} - \sqrt{q} - c$, and if you're considering for any $q &gt; 0$, then there is no global minimizer for this (i.e. globally decreasing for all $q &gt; 0$ and hence the minimizer is $q \to \infty$. Thus, the FOC you'd derived is not true. Indeed, the condition you'd provided would render as $4 \le 1$ --- clearly impossible. 

In general, an increasing function $F$ over a linear function (i.e. say $F(x) / x$ in your case) will not necessarily be convex. And furthermore, when you subtract off the form $h \circ F$, the resulting $-h \circ F$ could again depend on the form of $F$ (which may not have any particular geometric form you could exploit). I think what would fix this model is a form such that $F(q) / q$ is convex in $q$ and $h \circ F$ is concave, so that $-h \circ F$ is convex, then the whole problem will be convex.