Continuous Maximum Principle: a Study of Complex Systems Optimization