#*------------------------------------------------------------------- * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. * * This LIBRARY is free software; you can distribute it and/or modify * it under the therms of the ALSOC FREE LICENSE as available at * http://www.enq.ufrgs.br/alsoc. * * EMSO Copyright (C) 2004 - 2007 ALSOC, original code * from http://www.rps.eng.br Copyright (C) 2002-2004. * All rights reserved. * * EMSO is distributed under the therms of the ALSOC LICENSE as * available at http://www.enq.ufrgs.br/alsoc. * *-------------------------------------------------------------------- * Some MINLP test problems *-------------------------------------------------------------------- * Author: Edson Cordeiro do Valle, Rafael de Pelegrini Soares * \$Id\$ *--------------------------------------------------------------------*# Optimization minlp1 VARIABLES x0 as Integer(Default=0, Lower=0, Upper=1); x1 as Real(Default=0, Lower=0, Upper=1.0e10); x2 as Real(Default=0, Lower=0, Upper=1.0e10); x3 as Integer(Default=0, Lower=0, Upper=5); MINIMIZE -1*(x0 + x1 + x2); EQUATIONS (x1 - 0.5)^2 + (x2 - 0.5)^2 <= 0.25; x0 - x1 <= 0; x0 + x2 + x3 <= 2; OPTIONS Dynamic = false; NLPSolveNLA = true; NLPSolver(File = "minlp_emso", derivative_test = "second-order", print_level = 5); end Optimization minlp2 VARIABLES x as Real(Default=0, Lower=0.2, Upper=1); y1 as Integer(Default=1, Lower=0, Upper=1); y2 as Integer(Default=1, Lower=0, Upper=1); y3 as Integer(Default=0, Lower=0, Upper=1); MINIMIZE y1 + y2 + y3 + 5*x^2; EQUATIONS 3*x -y1 -y2 <= 0; -x + 0.1*y2 + 0.25* y3 <= 0; y1 + y2 + y3 >= 2; y1 + y2 + 2*(y3 - 1) >=0; OPTIONS Dynamic = false; NLPSolveNLA = true; NLPSolver(File = "minlp_emso", derivative_test = "second-order", print_level = 5); end Optimization minlp3 VARIABLES x1 as Real(Default=0, Lower=0, Upper=1e10); x2 as Real(Default=0, Lower=0, Upper=1e10); x3 as Real(Default=1, Lower=0, Upper=1e10); y1 as Integer(Default=0, Lower=0, Upper=1); y2 as Integer(Default=1, Lower=0, Upper=1); y3 as Integer(Default=0, Lower=0, Upper=1); MINIMIZE -2.9*x3 -8.9*ln(1+x1) - 10.44*ln(1+x2) + 1.8*x1 + 1.8*x2 + 3.5*y1 + y2 + 1.5*y3; EQUATIONS -y1 + 0.9*ln(1+x1) + 1.08*ln(1+x2) +0.9*x3 <=0; -10*y2 + ln(1+ x1) <=0; -10*y3 + 1.2*ln(1+x2) <=0; y2 + y3 -1 <=0; OPTIONS Dynamic = false; NLPSolveNLA = true; NLPSolver(File = "minlp_emso", derivative_test = "second-order", bonmin_algorithm = "B-BB", print_level = 5); end FlowSheet minlp_flow VARIABLES p1a as Real(Default=10, Lower=0, Upper=50); p1b as Real(Default=10, Lower=0, Upper=50); p2a as Real(Default=10, Lower=0, Upper=50); p2b as Real(Default=10, Lower=0, Upper=50); f1 as Real(Default=10, Lower=0, Upper=25); f2 as Real(Default=10, Lower=0, Upper=25); f3a as Real(Default=10, Lower=0, Upper=50); f3b as Real(Default=10, Lower=0, Upper=50); f4a as Real(Default=10, Lower=0, Upper=50); f4b as Real(Default=10, Lower=0, Upper=50); f5a as Real(Default=10, Lower=0, Upper=50); f5b as Real(Default=10, Lower=0, Upper=50); f6a as Real(Default=10, Lower=0, Upper=50); f6b as Real(Default=10, Lower=0, Upper=50); f7a as Real(Default=10, Lower=0, Upper=50); f7b as Real(Default=10, Lower=0, Upper=50); f8a as Real(Default=10, Lower=0, Upper=50); f8b as Real(Default=10, Lower=0, Upper=50); f9a as Real(Default=10, Lower=0, Upper=50); f9b as Real(Default=10, Lower=0, Upper=50); f10a as Real(Default=10, Lower=0, Upper=50); f10b as Real(Default=10, Lower=0, Upper=50); f11a as Real(Default=10, Lower=0, Upper=50); f11b as Real(Default=10, Lower=0, Upper=50); e4 as Real(Default=10, Lower=0, Upper=1); e5 as Real(Default=10, Lower=0, Upper=1); e6 as Real(Default=10, Lower=0, Upper=1); # yd as Integer(Default=1, Lower=0, Upper=1); # yf as Integer(Default=0, Lower=0, Upper=1); EQUATIONS f3a = 0.55*f1 + 0.50*f2; #mixer11: f3b = 0.45*f1 + 0.50*f2; #mixer12: f4a = e4*f3a; #splitter1 f4b = e4*f3b; #splitter2 f5a = e5*f3a; #splitter3 f5b = e5*f3b; #splitter4 f6a = e6*f3a; #splitter5 f6b = e6*f3b; #splitter6 f7a = f3a - f4a - f5a - f6a; #splitter7 f7b = f3b - f4b - f5b - f6b; #splitter8 f8a = 0.85*f4a; #flash1 f8b = 0.20*f4b; #flash2 f9a = 0.15*f4a; #flash3 f9b = 0.80*f4b; #flash4 f10a = 0.975*f5a; #distil1 f10b = 0.050*f5b; #distil2 f11a = 0.025*f5a; # distil3 f11b = 0.950*f5b; # distil4 p1a = f8a + f10a + f6a; # mixer21 p1b = f8b + f10b + f6b; # mixer22 p2a = f9a + f11a + f7a; # mixer31 p2b = f9b + f11b + f7b; # mixer32 SPECIFY f3a = 1; f4a = 1; f5a = 1; f6a = 1; f8b = 1; OPTIONS Dynamic = false; NLASolver( File = "homotopy", RelativeAccuracy = 1e-5 ); end Optimization opt_minlp_flow as minlp_flow VARIABLES yd as Integer(Default=1, Lower=0, Upper=1); yf as Integer(Default=0, Lower=0, Upper=1); MINIMIZE -35*p1a - 30*p2b + 10*f1 + 8*f2 + f4a + f4b + 4*f5a + 4*f5b + 2*yf + 50*yd; EQUATIONS f4a + f4b >= 2.5*yf; #logical1 f4a + f4b <= 25*yf;#logical2 f5a + f5b >= 2.5*yd;#logical3 f5a + f5b <= 25*yd;#logical4 p1a >= 4*p1b;#spec1 p2b >= 3*p2a;#spec2 p1a + p1b <= 15;#spec3 p2a + p2b <= 18;#spec4 FREE f3a; f4a; f5a; f6a; f8b; OPTIONS Dynamic = false; NLPSolveNLA = false; NLPSolver(#File = "complex", #File = "optpp_emso", File = "minlp_emso", bonmin_algorithm = "B-BB", bonmin_bb_log_level = 2, #Hessian_approximation = "exact", MaxIterations = 10000, RelativeAccuracy = 1e-6); end