I'm not an expert, so wait for further posts. Only some hints: Unfortunately Polybios treatise about the phalanx is lost. In his history you can find only a few remarks. From later times there are some tactical manuals about phalanx warfare, I've only read so far in the "Taktika" from Asklepiodotos (1st c. BC). Some aspects of the command structure are mentioned there.