TITLE: Multivariable optimization for time to build a ship in a game, and maybe some possible application in "everyday" life
QUESTION [1 upvotes]: I precise first that english is not my monther tongue and I may will not be as clear as I would like, just ask me question if you need, thank you.

I am playing a game (Galaxy Empire) for a while, and instead of spend money to have a good power, I use mathematics as much as I can, but I'm stuck on this problem, and I'm sure it is possible it exists some cases in real life. 
What is fun with this game is that we can discover how things work like if you were a scientist searching the rules of physics. 
After read some documentation and speak with some players of my alliance I found that the time to build a ship in the game is a function of the two ressources (m, c) with have and also of the level of some buildings, I will call them A, B and C. 
I found a formula which works at a second for B and C at level 20 and 9. To get it I used a formula I found here and I just change some things and finally found, (just for your eyes pleasure):
$$T(h)=\frac{\left[\frac{m+c}{11132(B+1)}\right]}{6\times1.5^{C-4}}$$
For the moment I have not use the level of the building A, but I am sure it may helps. But nevermind for the moment it is not important for my question.

My problem :
Using my formula I try to see what happend if I change the level of one buildings (because we can have different planets) and when I compared the time in game and my theoric time the error was very big (more than 10 seconds and sometimes more). 
That's why I want to know how can I do in excel, for example, (if it is not possible I can compute it on my computer I just have not enough knowledge in maths to do it) if I make ten matrixes of time to build when the levels of my three building change (for the ressources it is not important because for a specific ship it always costs the same).
For example a matrix for time at $(A,B,C)=(15,17,5)$, an other for $(A,B,C)=(18,12,8)$ et caetera... how can I find the coefficients of the formula I think will give me the time, such as it works for every level of A, B and C? 
For example doing this and thinking my formula is something like 
$$T(h)=\frac{m+c}{\alpha(A+B+1)}\cdot \frac{1}{\beta*\gamma^{\delta C -\epsilon}}$$
Is it a way to find in average with the error I want all coefficients $\alpha, \beta, \gamma, \delta, \epsilon$ such as the time to build a ship in theory looks to be the same as in game for every combinaisons of level of A, B and C?

For the "everyday" life, it is for example you are a scientist, you are thinking of an experiment, but you have three parameters for which you cannot do anything else than do 10000 experiments in which your three parameters has a random value and you have a formula with this coefficients and you try to find the best coefficents such as it works in average for all possibilities of triplets. But you try to use the power of maths just to do 10 experiments.
Thank you in advance

REPLY [1 votes]: What you want to do is probably a least squares fit. Since you have not that many measurements and enough time to compute, I would suggest using a numerical approach like Levenberg-Marquardt. Do you have matlab or something like that at hand?
{"set_name": "stack_exchange", "score": 1, "question_id": 1618131}