Aaah ok I see. My method differs slightly - what I did was to calculate the damage done by my units on the enemy directly, which in your PA / TL / AD case would be :
Damage done = Number of TL's * Ratio of TL's to PA's * Cost of Pa's ---> (Eqn. 1)
However, your Number of TL's above (NTL1) firing depends on the number you lost to the PA.
So, NTL1 = Number of TL initally - [ Number of PA * Ratio of PA on TL * Number of TL Initally / (Number of TL Initally + Number of AD Initally) ]
So then you plug that back into the Eqn. 1
Damage done = Ratio of TL's to PA's * Cost of Pa's *{ Number of TL initally - [ Number of PA * Ratio of PA on TL * Number of TL Initally / (Number of TL Initally + Number of AD Initally) ] }
Now we just fix the score going into the fight (by saying, the score of robo units is a constant times the score of the thug units) and maximise this using that as a lagrange undermined multiplier with respect to numbers of TL and AD. Since we know all the other stuff (and approximate ratios of kills etc), we get an answer out.
So for equal scores coming into the fight (1m PA attacking, ratio of TL on PA ~ 0.15, ratio of PA on TL ~ 0.3), is:
NTL0 = 1.191563736*10^6, NAD0 = 3.895750942*10^5 => Ratio of TL : AD is 0.35 : 1
For twice the score of PA compared to TL :
NTL0 = 5.379940020*10^5, NAD0 = 5.800399868*10^5 => Ratio of TL : AD is 0.93 : 1
For 80% of thug score compared to PA :
NAD0 = 4.873100734*10^5, NTL0 = 9.269034890*10^5 => Ratio of TL : AD is 0.52 : 1
For 120% of thug score compared to PA :
NTL0 = 1.459049857*10^6, NAD0 = 2.730009501*10^5 => Ratio of TL : AD is 5.4 : 1
And flak ratio keeps going down again, as you hit 160% its about 0.
A bigger graph is like so:
http://i597.photobucket.com/albums/tt58/Turnip2k/Ratios.png
Its interesting that on mine, it goes to zero much more quickly than yours, yet still displays the high exponential rise. Will look into this....
edit:
Bottom axis of graph should be 'your score as a fraction of enemies'.