Constrained Transient Optimization Using B-Splines Functions as Control Inputs