Control of complex systems