%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % MIDACO 7 benchmark - Thomson problem: 100 electrons on a sphere % ---------------------------------------------------------------- % % Find the positions of 100 equal point charges on the unit sphere that % minimize the Coulomb energy, the sum of 1/distance over all 4950 pairs. % J. J. Thomson posed the problem in 1904 for his model of the atom. The % number of local minima grows exponentially with the number of charges, % and many of them lie within 0.01 % of the global minimum. % % Reference: E. D. Dolan, J. J. More and T. S. Munson, Benchmarking % optimization software with COPS 3.0, Argonne National Laboratory, % ANL/MCS-273 (2004). Best known energies: % https://en.wikipedia.org/wiki/Thomson_problem % % Variables: 200 continuous variables (spherical angles theta, phi % of each charge) % Constraints: none % Best known: F(X) = 4448.350634331 % % MIDACO setting: all parameters by default, start at % the lower bounds, the run stops when F(X) reaches 4448.3507 (FSTOP). % % This benchmark needs a full MIDACO license: the limited version % solves problems with up to 8 variables and the default parameters. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function thomson100 key = '************************************************************'; problem.func = @problem_function; problem.o = 1; % Number of objectives problem.n = 200; % Number of variables (in total) problem.ni = 0; % Number of integer variables (0 <= ni <= n) problem.m = 0; % Number of constraints (in total) problem.me = 0; % Number of equality constraints (0 <= me <= m) % x = [theta_1 phi_1 theta_2 phi_2 ... theta_100 phi_100] problem.xl = repmat([0 0 ], 1, 100); problem.xu = repmat([pi 2*pi], 1, 100); problem.x = problem.xl; % Starting point: lower bounds option.maxeval = 10000000; option.maxtime = 60*60*24; option.printeval = 1000; option.save2file = 1; option.resumable = 0; option.param( 1) = 0; % ACCURACY option.param( 2) = 2; % SEED option.param( 3) = 4448.3507; % FSTOP option.param( 4) = 0; % ALGOSTOP option.param( 5) = 0; % EVALSTOP option.param( 6) = 0; % FOCUS option.param( 7) = 0; % ANTS option.param( 8) = 0; % KERNEL option.param( 9) = 0; % ORACLE option.param(10) = 0; % PARETOMAX option.param(11) = 0; % EPSILON option.param(12) = 0; % BALANCE option.param(13) = 0; % CHARACTER option.param(14) = 0; % SURROGATE option.param(15) = 0; % PMISQP option.parallel = 0; % Serial: 0 or 1, Parallel: 2,3,4,5,6,7,8... option.paradigm = 0; % Parallel mode: 0 = parfor, 1 = vectorized [F,G] = func(X) [ solution ] = midaco( problem, option, key ); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [ f, g ] = problem_function( x ) % 100 unit charges on the unit sphere, positions from the spherical angles, % Coulomb energy = sum over all pairs of 1 / distance th = x(1:2:end); ph = x(2:2:end); P = [sin(th).*cos(ph); sin(th).*sin(ph); cos(th)]; % 3 x 100 unit vectors D2 = 2 - 2*(P'*P); % squared distances f(1) = sum(1 ./ sqrt(D2(MASK()))); % all pairs i < j g = []; end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function M = MASK() persistent K if isempty(K), K = triu(true(100), 1); end M = K; end