Using different optimization methods

The architechture of the residual calculation routine "eseOptObjective" allows easy integretion into existing optimization routines, you may change the script to use the optimization routine that suits your problem best.

Here is an example of using MATLAB built-in genetic algorithm ("ga") for optimization based on demo two. Replace Line 0046-0048 with the following code:

 gaoptions = gaoptimset('OutputFcn', @esePlotga, ...
     'Display', 'iter',  'PopInitRange', ...
     global_opt_model.bounds,  'PopulationSize', 500);
[ x_new, fval ] = ga(@eseOptObjective, 8, [],[],[],[],...
global_opt_model.bounds(1,:), ... global_opt_model.bounds(2,:),[],gaoptions)

You may need to change the population size and initial parameter range for faster convergence. Genetic algorithm does not depend on the selection of initial values, but it requires intensive computational power; therefore, using the distributed computation framework is recommended.