%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % 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 speed_reducer key = '************************************************************'; problem.func = @problem_function; problem.o = 1; % Number of objectives problem.n = 7; % Number of variables (in total) problem.ni = 0; % Number of integer variables (0 <= ni <= n) problem.m = 11; % Number of constraints (in total) problem.me = 0; % Number of equality constraints (0 <= me <= m) problem.xl = [2.6 0.7 17 7.3 7.3 2.9 5]; problem.xu = [3.6 0.8 28 8.3 8.3 3.9 5.5]; problem.x = problem.xl; % Starting point: lower bounds option.maxeval = 1000; option.maxtime = 60*60*24; option.printeval = 1; option.save2file = 1; option.resumable = 0; option.param( 1) = 0.0001; % ACCURACY option.param( 2) = 0; % SEED option.param( 3) = 2994.4244658*1.0001; % 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 ) % Objective: weight of the speed reducer f(1) = 0.7854*x(1)*x(2)^2*(3.3333*x(3)^2 + 14.9334*x(3) - 43.0934) ... - 1.508*x(1)*(x(6)^2 + x(7)^2) + 7.4777*(x(6)^3 + x(7)^3) ... + 0.7854*(x(4)*x(6)^2 + x(5)*x(7)^2); % Constraints G(X) >= 0 g(1) = 1 - 27/(x(1)*x(2)^2*x(3)); % bending stress of the teeth g(2) = 1 - 397.5/(x(1)*x(2)^2*x(3)^2); % surface stress g(3) = 1 - 1.93*x(4)^3/(x(2)*x(6)^4*x(3)); % deflection of shaft 1 g(4) = 1 - 1.93*x(5)^3/(x(2)*x(7)^4*x(3)); % deflection of shaft 2 g(5) = 1 - sqrt((745*x(4)/(x(2)*x(3)))^2 + 16.9e6)/(110*x(6)^3); % stress in shaft 1 g(6) = 1 - sqrt((745*x(5)/(x(2)*x(3)))^2 + 157.5e6)/(85*x(7)^3); % stress in shaft 2 g(7) = 1 - x(2)*x(3)/40; g(8) = 1 - 5*x(2)/x(1); g(9) = 1 - x(1)/(12*x(2)); g(10) = 1 - (1.5*x(6) + 1.9)/x(4); g(11) = 1 - (1.1*x(7) + 1.9)/x(5); end