Optimization or adaptive control