Deterministic stochastic optimal control