%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % MIDACO solves Multi-Objective Mixed-Integer Non-Linear Problems: % % % Minimize F_1(X),... F_O(X) where X(1,...N-NI) is CONTINUOUS % and X(N-NI+1,...N) is DISCRETE % % subject to G_j(X) = 0 (j=1,...ME) equality constraints % G_j(X) >= 0 (j=ME+1,...M) inequality constraints % % and bounds XL <= X <= XU % % % The problem statement of this example is given below. You can use % this example as template to run your own problem. To do so: Replace % the objective functions 'F' (and in case the constraints 'G') given % here with your own problem and follow the below instruction steps. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function rc34_dg_phase_balancing key = '************************************************************'; problem.func = @problem_function; problem.o = 1; % Number of objectives problem.n = 118; % Number of variables (in total) problem.ni = 0; % Number of integer variables (0 <= ni <= n) problem.m = 108; % Number of constraints (in total) problem.me = 108; % Number of equality constraints (0 <= me <= m) problem.xl = -ones(1,118); problem.xu = ones(1,118); problem.x = problem.xl; % Starting point: lower bounds option.maxeval = 1000000; option.maxtime = 60*60*24; option.printeval = 100; option.save2file = 1; option.resumable = 0; option.param( 1) = 1e-08; % ACCURACY option.param( 2) = 0; % SEED option.param( 3) = 1e-4; % 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) = 2; % 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 ) persistent Y PL QL if isempty(Y) [Y, PL, QL] = network_data; end x = x(:); a = exp(2i*pi/3); % three-phase slack buses 1,2,3 V = [1; a^2; a; complex(x(1:27), x(28:54))]; % bus voltages Psp = [0; 0; 0; x(55:81)]; % active power injections Qsp = [0; 0; 0; x(82:108)]; % reactive power injections DG = [9 16 21 24 30]; % buses of the 5 DG units Pdg = zeros(30,1); Pdg(DG) = x(109:113); % active power of the DG units Qdg = zeros(30,1); Qdg(DG) = x(114:118); % reactive power of the DG units I = Y*V; % bus currents spI = conj((Psp + 1i*Qsp)./V); % currents of the injections dP = Psp - Pdg - PL; % active power balance dQ = Qsp - Qdg - QL; % reactive power balance k = 4:30; % Equality constraints G(X) = 0: the 4 x 27 power flow equations g = [real(I(k) - spI(k)); imag(I(k) - spI(k)); dP(k); dQ(k)].'; % Objective: zero and negative sequence current of the slack buses f(1) = abs(I(1) + I(2) + I(3)) + abs(I(1) + a^2*I(2) + a*I(3)); end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [ Y, PL, QL ] = network_data % 30-bus network of the CEC 2020 power system problems (data set % FunctionPS1). Admittance matrix Y = G + jB: the branches give the % off-diagonal entries [bus i, bus j, G(i,j), B(i,j)] ... BR = [ ... 1 2 -3.4282621 4.7178534; 1 3 -4.1629294 4.5034951; 1 4 -9.6299132 12.345501; 1 5 2.5874565 -2.6060661; 1 6 3.7024985 -2.9248491; 1 10 -1.8274714e-09 0; 1 19 -1.9817024 5.7118876; 1 20 0.84080564 -2.1117873; 1 21 0.46043091 -1.578646; 2 3 -4.6015053 4.6356556; 2 4 2.5874565 -2.6060661; 2 5 -8.4945254 12.223676; 2 6 1.8828908 -2.3923205; 2 11 -7.5019133 6.899684; 2 12 2.5000364 -1.0376535; 2 19 0.84080564 -2.1117873; 2 20 -1.7352519 5.4125776; 2 21 0.21857809 -1.2056816; 3 4 3.7024985 -2.9248491; 3 5 1.8828908 -2.3923205; 3 6 -8.9802283 12.262079; 3 11 2.5000364 -1.0376535; 3 12 -7.4501318 6.9313313; 3 19 0.46043091 -1.578646; 3 20 0.21857809 -1.2056816; 3 21 -1.5345195 5.1061795; 4 5 -2.5874565 2.6060661; 4 6 -3.7024985 2.9248491; 5 6 -1.8828908 2.3923205; 7 28 -3.0457856e-09 0; 8 29 -3.0457856e-09 0; 9 30 -11.30056 11.456142; 10 13 -3.0457856e-09 0; 11 12 -6.6667637 2.767076; 11 14 -12.503189 11.499473; 11 15 4.1667273 -1.7294225; 12 14 4.1667273 -1.7294225; 12 15 -12.416886 11.552219; 14 15 -4.1667273 1.7294225; 16 28 -7.4259886 2.8343215; 17 29 -1.1421696e-09 0; 18 30 -1.1421696e-09 0; 19 20 -6.7116853 11.532668; 19 21 -7.4131254 10.719934; 19 22 -17.857001 13.442684; 19 23 4.1892684 -5.197306; 19 24 1.8651053 -4.254573; 19 25 -3.9634048 11.423775; 19 26 1.6816113 -4.2235745; 19 27 0.92086182 -3.157292; 19 28 -12.416886 11.552219; 19 30 4.1667273 -1.7294225; 20 21 -4.8450026 8.814351; 20 22 4.1892684 -5.197306; 20 23 -19.810121 14.001285; 20 24 4.1892684 -5.197306; 20 25 1.6816113 -4.2235745; 20 26 -3.4705037 10.825155; 20 27 0.43715618 -2.4113633; 20 29 -3.0457856e-09 0; 21 22 1.8651053 -4.254573; 21 23 4.1892684 -5.197306; 21 24 -17.857001 13.442684; 21 25 0.92086182 -3.157292; 21 26 0.43715618 -2.4113633; 21 27 -3.0690389 10.212359; 21 28 4.1667273 -1.7294225; 21 30 -12.503189 11.499473; 22 23 -4.1892684 5.197306; 22 24 -1.8651053 4.254573; 23 24 -4.1892684 5.197306; 25 26 -1.6816113 4.2235745; 25 27 -0.92086182 3.157292; 26 27 -0.43715618 2.4113633; 28 30 -4.1667273 1.7294225 ]; % ... and the diagonal [G(i,i), B(i,i)] of the buses DI = [ ... 11.611616 -18.057389; 17.731691 -24.535938; 17.96488 -24.29959; 9.6299133 -12.345501; 8.4945255 -12.223676; 8.9802285 -12.262079; 3.0457856e-09 0; 3.0457856e-09 0; 11.30056 -11.456142; 4.873257e-09 0; 20.005102 -18.399157; 19.867018 -18.48355; 3.0457856e-09 0; 12.503189 -11.499473; 12.416886 -11.552219; 7.425992 -2.8343215; 1.1421696e-09 0; 1.1421696e-09 0; 36.218998 -42.130566; 25.01588 -30.239018; 34.963751 -40.260696; 17.857003 -13.442684; 19.810123 -14.001285; 17.857003 -13.442684; 3.9634051 -11.423775; 3.470504 -10.825155; 3.0690392 -10.212359; 19.842878 -14.38654; 7.2337408e-09 0; 23.803749 -22.955616 ]; % loads of the buses: active and reactive power PL = [0 0 0 -0.016 -0.012 -0.012 0 0 ... -0.017 0 -0.017 0 0 -0.023 0 -0.0128 ... 0 0 -0.0402 -0.0451 -0.0672 -0.0485 -0.0068 -0.029 ... 0 0 0 0 0 0]'; QL = [0 0 0 -0.011 -0.009 -0.009 0 0 ... 0.002 0 -0.0125 0 0 -0.0132 0 -0.0086 ... 0 0 -0.023 -0.0258 -0.0439 0.001 0.014 -0.0012 ... 0 0 0 0 0 0]'; Y = zeros(30); for k = 1:size(BR,1) Y(BR(k,1),BR(k,2)) = complex(BR(k,3), BR(k,4)); Y(BR(k,2),BR(k,1)) = Y(BR(k,1),BR(k,2)); end Y = Y + diag(complex(DI(:,1), DI(:,2))); end