%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. %In this code, we are trying to fit the old T cell data with only allowing %two parameters to change: V_crac, and V_pmca clock = clock % %First, load in results from the Tcell model fit %'AK_fmincon_20150412_TCell_oldbounds_10000.mat' % %Second, set p2 = pminf load('20151120_20151119_RedParam_TCell_1400_1','pmin'); % p3(1) = pmin(2); %V_serca p3(1) = pmin(3); %K_serca p3(2) = pmin(4); %Vpmca p3(3) = pmin(7); % Vcrac p3(4) = pmin(9); %K_stim p3(5) = pmin(13); %K_ip3 p3(6) = pmin(15); %K_IP3prod p3(7) = pmin(16); %K_IP3deg p3(8) = pmin(18); %Kmitin %X Vcrac - need %X Kip3deg X %X Kip3 X %X Kip3prod X %X Kserca X %X Vpmca - need %X Kstim X %X Kmitin - need %Previous runs showed these % Kserca X % kIP3Prod X % Kstim X % Vserca X - remove % kIP3deg X % Kip3 X %Bounds as specified before, but only for the 5 specified above lowbounds = [0.15,0.01,0.01,150,... %10 values 0.1,0.1,0.01,100]; upbounds = [0.8,50,10,250,... %10 values 1,1,0.1,800]; % 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 280]; % 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 420]; %specify the size of the population popsize = 2100; %Develop the initial population M = zeros(popsize,length(lowbounds)); r = rand(popsize,length(lowbounds)); %Alters population by +/- 20% for i = 1:popsize for j = 1:length(lowbounds) M(i,j) = 0.8*p3(j)+0.4.*r(i,j).*(p3(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_20151123_TCellOLD_DiffS_8Var_5,... length(lowbounds),[],[],[],[],lowbounds,upbounds,[],options); %*******Sets options for running the fmincon %-------------------------------------------------------------------------- %This enables plotting of the results % options = optimset('MaxFunEvals',6000,'PlotFcns',{@optimplotfval,@optimplotstepsize}); % % % Try running fmincon: find minimum of constrained nonlinear multivariable % % % function % % % % %Here, load in pmin % % from AK_ga_20150610_TCellOLD_2param_1000.mat % % [p3minf,Smin,exitflag,output]=fmincon(@AK_Optimization_ToMinimize_20150624_TCellOLD_DiffS_8Var,... % pmin,[],[],[],[],lowbounds,upbounds,[],options); % %********Sets options for running the patternsearch %-------------------------------------------------------------------------- %This enables plotting of the results % options = psoptimset('PlotFcns',{@psplotbestf,@psplotmeshsize}); % % % %Here, load in pminf from % % from AK_fmincon_20150411_TCell_oldbounds_1000_2 % % [p3minp,Smin,exitflag,output] = ... % patternsearch(@AK_Optimization_ToMinimize_20150623_TCellOLD_DiffS_5Var, ... % p3minf,[],[],[],[],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_20150331_TCell,... % pmin,lowbounds,upbounds,options);