Like I said it is a bit crude
Have added number of ticks to allow it to calculate how many ships you can build in a number of ticks, I don't know how accurate it is, but I've tried to ensure that it errs on the low side to ensure that its always possible to build that number of ships in the time. This is not a straight calc due to the (total_resources_spent^1/2)*LN(total_resources_spent^2) part, if any math wiz can come up with a non-interrative solution to this, I'd be mighty impressed.