Design of an optimal controller for a discrete-time system subject to previewable demand | Synapse