MATLAB: Discrete values of optimization variable using fmincon.

dicrete optimizationnon linear model predictive control

i am trying to solve non-linear constrained optimisation problem for non-linear model predictive Control.
The optimization function I am using is fmincon.
My system is a train and i am trying to find optimal trajectory subject to limits on the maximum allowable velocity which are variable at different space instants and maximum travel time, which must be fulfilled.
The fmincon works fine but i need to find discretized values, which means my fminon should can take values just from this set [-1,0,0.5,0.75,1].
I know that fmincon is limited in this regard but is there any way to make my fmincon optimisation to just choose among these values?
Now it chooses any value between -1 and 1 and that makes the controller very slow.
Secondly my input cannot assume values like 0.001, 0.003, 0.75666, they need to be among the above mentioned values?
Any help in this regard will be really appreciated, I have been stuck for long on this issue.
Thank you

Best Answer

There's no reason to use FMINCON for a problem it wasn't built for. Try using ga() instead, with the IntCon option. You would, of course, remap your dictionary of values [-1,0,0.5,0.75,1] to integers, but that should be simple.