Sliding mode optimal control for linear systems