I am using pattern search specifically Mesh Adaptive Direct Search for solving a combined control and design problem with 2 design variables and 1 control variable discretized into 20 points between time 0 and 1.
I get a different answer every time. Is it possible to change the options from stochastic to deterministic so that I get the same optimum function value each time?
Also, I use ODE1 for simulation of the dynamic equation. I need to interpolate those simulated points into 20 equispaced points corresponding to the 20 equispaced time stamps. For interpolation, I am using interp1. I get all other values correct but the first value and the last value seems to be odd since the first value is very high and the last value is very low with respect to the other values. I appreciate any help in resolving this.