%AK Specify parameters in a vector that can be read in separately to avoid %updating code every optimization %Can enter this vector differently if pulling in from other files, etc. % p = [1500 85.8 0.4477 1.805 0.1269 0.003 3.1046 2.5E-7 195.73 1.626 ... %10 values % 0.0467 0.015 0.106 0.16 0.258 0.0208 0.0396 794.07 1.24 484.44 ... %10 values % 0.0917 0.08 0.716 394 8.1285 996.83 0.1678 1 0.771 0.0045]; %10 values % lowbounds = [1500,0.2,0.15,0.01,0.1,0.0005,0.01,2.5e-07,100,0.05,... %10 values % 0.001,0.015,0.1,0.05,0.1,0.001,0.01,100,0.5,5,... %10 values % 0.01,0.08,0.001,150,1,100,0.001,1,0.5,0.001]; %10 values % upbounds = [1500,250,0.8,50,0.5,0.05,10,3.5e-05,300,10,... %10 values % 1,0.015,5,0.5,10,0.1,0.1,800,1.5,500,... %10 values % 0.5,0.08,1,450,10,1000,1,1,1.5,0.01]; %10 values % % %Bounds as specified by code % lowbounds = [1500,0.2,0.15,0.01,0.1,0.0005,0.01,2.5e-07,150,0.05,... %10 values % 0.001,0.015,0.1,0.05,0.1,0.001,0.01,100,0.5,50,... %10 values % 0.01,0.08,0.001,5,1,50,0.001,1,0.5,0.001,... %10 values % 0.1]; % upbounds = [1500,250,0.8,50,0.5,0.05,10,3.5e-05,250,80,... %10 values % 1,0.015,1,0.5,1,0.1,0.1,800,1.5,1000,... %10 values % 0.5,0.08,1,450,10,1000,1,1,1.5,0.01,... %10 values % 0.5]; %Bounds as specified by code slight alteration to p(16) and p(20) to see if %the drop out of the mito can be reduced lowbounds = [1500,0.2,0.15,0.01,0.1,0.0005,0.01,2.5e-07,150,0.05,... %10 values 0.001,0.015,0.1,0.05,0.1,0.01,0.01,100,0.5,50,... %10 values 0.01,0.08,0.001,5,1,50,0.001,1,0.5,0.001,... %10 values 0.1]; upbounds = [1500,250,0.8,50,0.5,0.05,10,3.5e-05,250,80,... %10 values 1,0.015,1,0.5,1,0.1,0.1,800,1.5,500,... %10 values 0.5,0.08,1,450,10,1000,1,1,1.5,0.01,... %10 values 0.5]; %specify the size of the population popsize = 8500; %Develop the initial population M = zeros(popsize,length(lowbounds)); for i = 1:popsize for j = 1:length(lowbounds) M(i,j) = 10^(log10(lowbounds(j)) + rand*(log10(upbounds(j)) ... - log10(lowbounds(j)))); end end %Need to perform minimization of parameter sets %*******Sets options for running the genetic algorithm %-------------------------------------------------------------------------- %Added output into the output of ga on March 2, 2015 %PopulationSize specifies the size of the population %IniialPopulation is used to seed the genetic algorithm %PlotFcns is an array of handles to functions that plot data computed by % the algorithm % options = gaoptimset('PopulationSize',popsize,'Generations',100, ... % 'InitialPopulation',M,'PlotFcns', ... % {@gaplotbestf,@gaplotscores,@gaplotstopping,@gaplotdistance}); % % [pmin,Smin,exitflag,output] = ga(@AK_Optimization_ToMinimize_20151021_Revised10_PMCA_PeakHeight,... % length(lowbounds),[],[],[],[],lowbounds,upbounds,[],options); %*******Sets options for running the fmincon %-------------------------------------------------------------------------- %This enables plotting of the results % options = optimset('PlotFcns',{@optimplotfval,@optimplotstepsize}); % % Try running fmincon: find minimum of constrained nonlinear multivariable % % function % % [pminf,Smin,exitflag,output]=fmincon(@AK_Optimization_ToMinimize_20151021_Revised10_PMCA_PeakHeight,... % pmin,[],[],[],[],lowbounds,upbounds,[],options); % %********Sets options for running the patternsearch %-------------------------------------------------------------------------- %This enables plotting of the results options = psoptimset('PlotFcns',{@psplotbestf,@psplotmeshsize}); [pminp,Smin,exitflag,output] = ... patternsearch(@AK_Optimization_ToMinimize_20151021_Revised10_PMCA_PeakHeight, ... pminf,[],[],[],[],lowbounds,upbounds,[],options); % % %*******Sets options for running the simulannealbnd %-------------------------------------------------------------------------- %Find minimum of function using simulated annealing algorithm %This enables plotting of the results % options = saoptimset('PlotFcns',... % {@saplotbestf,@saplotbestx,@saplotf,@saplottemperature}); % % [pmin,Smin,exitflag,output] = simulannealbnd(@AK_Optimization_ToMinimize_20150319_All3,... % pmin,lowbounds,upbounds,options);