Project impact analysis as an optimal control problem