Algorithms of construction for optimal solution in modular models of economic growth