From d19794fb80a271a4c885ed90f97cfc12baa012f2 Mon Sep 17 00:00:00 2001 From: Harpreet Date: Wed, 31 Aug 2016 11:10:22 +0530 Subject: intfminimax examples added --- help/intfmincon.xml | 291 +++++++++++++++++++++++++++++++++++++++++++++++++++ help/intfminimax.xml | 223 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 514 insertions(+) create mode 100644 help/intfmincon.xml create mode 100644 help/intfminimax.xml (limited to 'help') diff --git a/help/intfmincon.xml b/help/intfmincon.xml new file mode 100644 index 0000000..a09a18a --- /dev/null +++ b/help/intfmincon.xml @@ -0,0 +1,291 @@ + + + + + + + + intfmincon + Solves a constrainted multi-variable mixed integer non linear programming problem + + + + + Calling Sequence + + xopt = intfmincon(f,x0,intcon,A,b) + xopt = intfmincon(f,x0,intcon,A,b,Aeq,beq) + xopt = intfmincon(f,x0,intcon,A,b,Aeq,beq,lb,ub) + xopt = intfmincon(f,x0,intcon,A,b,Aeq,beq,lb,ub,nlc) + xopt = intfmincon(f,x0,intcon,A,b,Aeq,beq,lb,ub,nlc,options) + [xopt,fopt] = intfmincon(.....) + [xopt,fopt,exitflag]= intfmincon(.....) + [xopt,fopt,exitflag,gradient]=intfmincon(.....) + [xopt,fopt,exitflag,gradient,hessian]=intfmincon(.....) + + + + + + Parameters + + f : + a function, representing the objective function of the problem + x0 : + a vector of doubles, containing the starting values of variables. + intcon : + a vector of integers, represents which variables are constrained to be integers + A : + a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + b : + a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + Aeq : + a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + beq : + a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + lb : + Lower bounds, specified as a vector or array of double. lb represents the lower bounds elementwise in lb ≤ x ≤ ub. + ub : + Upper bounds, specified as a vector or array of double. ub represents the upper bounds elementwise in lb ≤ x ≤ ub. + nlc : + a function, representing the Non-linear Constraints functions(both Equality and Inequality) of the problem. It is declared in such a way that non-linear inequality constraints are defined first as a single row vector (c), followed by non-linear equality constraints as another single row vector (ceq). Refer Example for definition of Constraint function. + options : + a list, containing the option for user to specify. See below for details. + xopt : + a vector of doubles, containing the the computed solution of the optimization problem. + fopt : + a scalar of double, containing the the function value at x. + exitflag : + a scalar of integer, containing the flag which denotes the reason for termination of algorithm. See below for details. + gradient : + a vector of doubles, containing the Objective's gradient of the solution. + hessian : + a matrix of doubles, containing the Objective's hessian of the solution. + + + + + Description + +Search the minimum of a mixed integer constrained optimization problem specified by : +Find the minimum of f(x) such that + + + +\begin{eqnarray} +&\mbox{min}_{x} +& f(x) \\ +& \text{subject to} & A*x \leq b \\ +& & Aeq*x \ = beq\\ +& & c(x) \leq 0\\ +& & ceq(x) \ = 0\\ +& & lb \leq x \leq ub \\ +& & x_i \in \!\, \mathbb{Z}, i \in \!\, I +\end{eqnarray} + + + +The routine calls Bonmin for solving the Bounded Optimization problem, Bonmin is a library written in C++. + + +The options allows the user to set various parameters of the Optimization problem. +It should be defined as type "list" and contains the following fields. + +Syntax : options= list("IntegerTolerance", [---], "MaxNodes",[---], "MaxIter", [---], "AllowableGap",[---] "CpuTime", [---],"gradobj", "off", "hessian", "off" ); +IntegerTolerance : a Scalar, a number with that value of an integer is considered integer.. +MaxNodes : a Scalar, containing the Maximum Number of Nodes that the solver should search. +CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take. +AllowableGap : a Scalar, to stop the tree search when the gap between the objective value of the best known solution is reached. +MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take. +gradobj : a string, to turn on or off the user supplied objective gradient. +hessian : a Scalar, to turn on or off the user supplied objective hessian. +Default Values : options = list('integertolerance',1d-06,'maxnodes',2147483647,'cputime',1d10,'allowablegap',0,'maxiter',2147483647,'gradobj',"off",'hessian',"off") + + + +The exitflag allows to know the status of the optimization which is given back by Ipopt. + +exitflag=0 : Optimal Solution Found +exitflag=1 : InFeasible Solution. +exitflag=2 : Objective Function is Continuous Unbounded. +exitflag=3 : Limit Exceeded. +exitflag=4 : User Interrupt. +exitflag=5 : MINLP Error. + + + +For more details on exitflag see the Bonmin documentation, go to http://www.coin-or.org/Bonmin + + + + + + + Examples + + + + + Examples + + + + + Examples + + + + + Examples + + + + + Authors + + Harpreet Singh + + + diff --git a/help/intfminimax.xml b/help/intfminimax.xml new file mode 100644 index 0000000..afb81a2 --- /dev/null +++ b/help/intfminimax.xml @@ -0,0 +1,223 @@ + + + + + + + + intfminimax + Solves minimax constraint problem + + + + + Calling Sequence + + xopt = intfminimax(fun,x0,intcon) + xopt = intfminimax(fun,x0,intcon,A,b) + xopt = intfminimax(fun,x0,intcon,A,b,Aeq,beq) + xopt = intfminimax(fun,x0,intcon,A,b,Aeq,beq,lb,ub) + xopt = intfminimax(fun,x0,intcon,A,b,Aeq,beq,lb,ub,nonlinfun) + xopt = intfminimax(fun,x0,intcon,A,b,Aeq,beq,lb,ub,nonlinfun,options) + [xopt, fval] = intfminimax(.....) + [xopt, fval, maxfval]= intfminimax(.....) + [xopt, fval, maxfval, exitflag]= intfminimax(.....) + + + + + + Parameters + + fun: + The function to be minimized. fun is a function that accepts a vector x and returns a vector F, the objective functions evaluated at x. + x0 : + a vector of double, contains initial guess of variables. + A : + a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + intcon : + a vector of integers, represents which variables are constrained to be integers + b : + a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b. + Aeq : + a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + beq : + a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq. + lb : + a vector of double, contains lower bounds of the variables. + ub : + a vector of double, contains upper bounds of the variables. + nonlinfun: + function that computes the nonlinear inequality constraints c⋅x ≤ 0 and nonlinear equality constraints c⋅x = 0. + xopt : + a vector of double, the computed solution of the optimization problem. + fopt : + a double, the value of the function at x. + maxfval: + a 1x1 matrix of doubles, the maximum value in vector fval + exitflag : + The exit status. See below for details. + output : + The structure consist of statistics about the optimization. See below for details. + lambda : + The structure consist of the Lagrange multipliers at the solution of problem. See below for details. + + + + + Description + +intfminimax minimizes the worst-case (largest) value of a set of multivariable functions, starting at an initial estimate. This is generally referred to as the minimax problem. + + + +\min_{x} \max_{i} F_{i}(x)\: \textrm{such that} \:\begin{cases} +& c(x) \leq 0 \\ +& ceq(x) = 0 \\ +& A.x \leq b \\ +& Aeq.x = beq \\ +& lb \leq x \leq ub +& x_i \in \!\, \mathbb{Z}, i \in \!\, I +\end{cases} + + + +Currently, intfminimax calls intfmincon which uses the bonmin algorithm. + + +max-min problems can also be solved with intfminimax, using the identity + + + +\max_{x} \min_{i} F_{i}(x) = -\min_{x} \max_{i} \left( -F_{i}(x) \right) + + + +The options allows the user to set various parameters of the Optimization problem. +It should be defined as type "list" and contains the following fields. + +Syntax : options= list("IntegerTolerance", [---], "MaxNodes",[---], "MaxIter", [---], "AllowableGap",[---] "CpuTime", [---],"gradobj", "off", "hessian", "off" ); +IntegerTolerance : a Scalar, a number with that value of an integer is considered integer.. +MaxNodes : a Scalar, containing the Maximum Number of Nodes that the solver should search. +CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take. +AllowableGap : a Scalar, to stop the tree search when the gap between the objective value of the best known solution is reached. +MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take. +gradobj : a string, to turn on or off the user supplied objective gradient. +hessian : a Scalar, to turn on or off the user supplied objective hessian. +Default Values : options = list('integertolerance',1d-06,'maxnodes',2147483647,'cputime',1d10,'allowablegap',0,'maxiter',2147483647,'gradobj',"off",'hessian',"off") + + +The objective function must have header : + +F = fun(x) + +where x is a n x 1 matrix of doubles and F is a m x 1 matrix of doubles where m is the total number of objective functions inside F. +On input, the variable x contains the current point and, on output, the variable F must contain the objective function values. + + +By default, the gradient options for intfminimax are turned off and and intfmincon does the gradient opproximation of objective function. In case the GradObj option is off and GradConstr option is on, intfminimax approximates Objective function gradient using numderivative toolbox. + + +If we can provide exact gradients, we should do so since it improves the convergence speed of the optimization algorithm. + + + + + +The exitflag allows to know the status of the optimization which is given back by Ipopt. + +exitflag=0 : Optimal Solution Found +exitflag=1 : InFeasible Solution. +exitflag=2 : Objective Function is Continuous Unbounded. +exitflag=3 : Limit Exceeded. +exitflag=4 : User Interrupt. +exitflag=5 : MINLP Error. + + + +For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/bonmin/ + + + + + + + Examples + + + + + Examples + + + + + Authors + + Harpreet Singh + + + -- cgit