Relatively optimal control and its linear implementation