Home
Getting Started with CPLEX for MATLAB
Contents
1. The toolbox options are listed in the following table Options corresponding to the MATLAB Optimization Toolbox Diagnostics Display MaxIter Simplex BranchStrategy MaxNodes MaxTime NodeDisplayInterval NodeSearchStrategy Tol Fun TolXInteger TolRLPFun on off off iter final notify refer to cplex Param simplex limits iterations refer to cplex Param 1pmethod refer to cplex Param qpmethod refer to cplex Param mip strategy startal gorithm refer to cplex Param mip strategy variableselect refer to cplex Param mip imits nodes refer to cplex Param timelimit refer to cplex Param mip interval refer to cplex Param mip strategy nodeselect refer to cplex Param simplex tolerances optimal ity refer to cplex Param mip tolerances integrality refer to cplex Param simplex tolerances optimality These options can be set using the toolbox function optimset For example the following code turns on the optimizer output and sets a node limit of 400 options cplexoptimset Diagnostics on MaxNodes 400 Alternatively these options can be set directly on the fields of the structure For example the following code has the same result as the previous one 10 Getting Started with CPLEX for MATLAB options cplexoptimset options Diagnostics on options MaxNodes 400 The current and default values of the options can be queried with the function optimget If you nee
2. Programming tips As you model and solve mathematical programming problems you may find it useful to refer to the documentation to find answers to your questions As you model and solve mathematical programming problems with CPLEX for MATLAB you may find it useful to refer to the documentation to find answers to your questions Some common questions are answered in this documentation as well as the CPLEX User s Manual available in your CPLEX distribution How do I use the MATLAB sparse matrix format with the CPLEX for MATLAB functions and classes Either sparse or dense format can be used in the connector in all places where double matrices and vectors are accepted as arguments How do I understand and deal with my infeasible or unbounded model The section Infeasibility and unboundedness of the CPLEX User s Manual documents tools to help you analyze the source of the infeasibility in a model the preprocessing reduction parameter for distinguishing infeasibility from unboundedness the conflict refiner for detecting minimal sets of mutually contradictory bounds and constraints and FeasOpt for repairing infeasibilities How do I obtain a pool of multiple solutions The section Discrete optimization gt Solution pool generating and keeping multiple solutions of the CPLEX User s Manual introduces the solution pool for storing multiple solutions to a mixed integer programming problem MIP and explains techniques for generating and
3. Toolbox The toolbox provides functions for solving a variety of mathematical programming problems The CPLEX for MATLAB Toolbox provides functions for solving a variety of mathematical programming problems The toolbox functions are designed to take a model description as input and produce a solution as output For example x cplexIp f Aineq bineq Aeq beq 1b ub finds the minimum of a linear programming problem specified by min f x st Aineq x lt bineq Aeq x beq lb lt x lt ub The toolbox provides the functions cplexlp cplexqp and cplexbilp to solve linear programming problems LP quadratic programming problems QP and binary integer programming problems BILP The toolbox provides functions that support the solution of the basic problem types handled by CPLEX are e cplexlp for linear programming problems LP e cplexgp for quadratic programming problems QP and e cplexbilp for binary integer programming problems BILP Functions that support the solution of additional problem types handled by CPLEX are provided These functions are e cplexqcp for quadratically constrained programming problems QCP e cplexmilp for mixed integer linear programming problems MIP e cplexmigp for mixed integer quadratic programming problems MIQP and e cplexmiqcp for mixed integer quadratically constrained mixed integer programming problems MIQCP The solution of least square problems is supported through the f
4. all IBM ILOG CPLEX Optimization Studio Getting Started with CPLEX for MATLAB M Copyright notice Describes general use restrictions and trademarks related to this document and the software described in this document Copyright IBM Corp 1987 2011 US Government Users Restricted Rights Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp Trademarks IBM the IBM logo ibm com WebSphere and ILOG are trademarks or registered trademarks of International Business Machines Corp in many jurisdictions worldwide Other product and service names might be trademarks of IBM or other companies A current list of IBM trademarks is available on the Web at Copyright and trademark information http www ibm com legal copytrade shtml Adobe the Adobe logo PostScript and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and or other countries Linux is a registered trademark of Linus Torvalds in the United States other countries or both UNIX is a registered trademark of The Open Group in the United States and other countries Microsoft Windows Windows NT and the Windows logo are trademarks of Microsoft Corporation in the United States other countries or both Java and all Java based trademarks and logos are trademarks or registered trademarks of Oracle and or its affiliates Other company product or service names may be trad
5. managing those solutions How do I get this difficult model to solve The section Programming considerations gt Tuning tool of the User s Manual documents the tuning tool a utility to aid you in improving the performance of your optimization applications analyzes a model or a group of models and suggests a suite of parameter settings for you to use that provide better performance than the default parameter settings for your model or group of models How do I invoke parallel threads to solve my model faster The section Advanced programming techniques gt Parallel optimizers of the CPLEX User s Manual documents the CPLEX parallel optimizers How do I set algorithm control parameters The CPLEX Parameters Reference Manual lists all of the parameters and explains their settings To learn about setting parameters when using the toolbox functions see the function cplexoptimset For information about setting parameters while using the Cplex class API see Cplex Param How do I check the consistency of my data There is a consistency check which can be controlled by the datacheck parameter The default value of datacheck is off which can improve the performance in the case of valid model data If the datacheck is on then a detailed error message will be displayed in the case of invalid data For information about setting parameters see Cplex Param and cplexoptimset Copyright IBM Corp 1987 2011 15 Printed in USA
6. US ACTION ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE end of acknowledgement of use of dtoa routine of the gdtoa package Copyright IBM Corporation 1987 2011 US Government Users Restricted Rights Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp Contents Chapter 1 Introduction Chapter 2 Installation of CPLEX for MATLAB i aie ee et ate Chapter 3 Integration with MATLAB Chapter 4 Using CPLEX for MATLAB Copyright IBM Corp 1987 2011 Chapter 5 Overview of the CPLEX for MATLAB APIs F CPLEX for MATLAB Toolbox Cplex Class API Chapter 6 Programming tips iii iv Getting Started with CPLEX for MATLAB Chapter 1 Introduction An overview of CPLEX for MATLAB CPLEX for MATLAB is an extension to IBM ILOG CPLEX Optimizers that allows a user to define optimization problems and solve them within MATLAB Thus a student or practitioner who is using MATLAB can easily solve optimization problems within that framework Copyright IBM Corp 1987 2011 1 2 Getting Started with CPLEX for MATLAB Chapter 2 Installation of CPLEX for MATLAB Install and set up IBM ILOG CPLEX Optimization Studio before using the CPLEX connector for MATLAB If you have not yet set up CPLEX first follow those procedures for installation before you begin using the CPLEX connector for MATLAB Instructions for installation are available
7. at the IBM Support Portal under the topic Choose your task Installation Copyright IBM Corp 1987 2011 3 4 Getting Started with CPLEX for MATLAB Chapter 3 Integration with MATLAB The menu items and windows used to solve optimization models are described CPLEX for MATLAB should be integrated into your MATLAB environment in order for you to take full advantage of its features When you have installed CPLEX for MATLAB and set the paths as described in the readme html file a new item is added to the Toolboxes section of the MATLAB Start Button You can use the items on this menu to find more help about using CPLEX In addition the online manuals for CPLEX for MATLAB have been added to the MATLAB Product Help available from the drop down menu Help gt Product Help Within the MATLAB Command Window inline help is available for the CPLEX classes and functions For example typing help cplexlp will display information about the function cplex1p Copyright IBM Corp 1987 2011 5 6 Getting Started with CPLEX for MATLAB Chapter 4 Using CPLEX for MATLAB Presents an overview of how to solve an optimization problem IBM ILOG CPLEX Optimizers provides a tool for solving optimization or mathematical programming problems The most basic mathematical programming problem is commonly referred to as Linear Programming LP problem The basic form of an LP problem is Maximize or Minimize f x subject to Aeq
8. cted to take integer values in the solution The standard MATLAB vector and matrix format is used for the elements of data that you need to provide For example the CPLEX for MATLAB Toolbox function cplexlp solves the problem specified by min f x st Aineq x lt bineq Aeq x beq lb lt x lt ub where f bineq beq 1b and ub are MATLAB vectors and Aineq and Aeq are MATLAB matrices The vector x returned by the function call x cplexip f Aineq beq Aeq beq 1b ub contains the optimal solution to the specified linear programming problem Provided in CPLEX for MATLAB is both a toolbox of functions and a class API The toolbox contains functions for solving optimization problems where the input matrices are provided to the function and results returned With the class API objects can be created and those objects carry a state The benefits of using the Cplex class API include the ability to e build up a model by manipulating a Cplex object e use computation methods such as Cplex solve and Cplex refineConflict that modify the object so results can be queried as needed e perform restarts after manipulation e attach an output parser a GUI with stop buttons and other controls 8 Getting Started with CPLEX for MATLAB Chapter 5 Overview of the CPLEX for MATLAB APIs CPLEX for MATLAB provides two APIs for solving mathematical programming problems the toolbox functions and the Cplex class CPLEX for MATLAB
9. d to use CPLEX parameters that do not correspond to the options in the MATLAB Optimization Toolbox you can create a structure which contains all of the CPLEX parameters For example to set a node limit of 400 and instruct CPLEX to use traditional branch and cut style search opt cplexoptimset cplex opt mip limits nodes 400 opt mip strategy search 1 Tip If you are already familiar with the names of parameters in the Interactive Optimizer then you quickly recognize names of parameters in CPLEX for MATLAB For example the command set mip limits nodes 1 in the Interactive Optimizer corresponds to opt mip limits nodes 1 in the CPLEX for MATLAB Toolbox where opt was created with the line opt optimset cplex To assist in setting parameters auto completion of parameter names is available in the MATLAB environment Cplex Class API Describes the Cplex class While the CPLEX for MATLAB Toolbox functions provide the ability to solve a multitude of mathematical programming problems the toolbox design does not support restart To enable users to use decomposition algorithms the Cplex Class API is also provided in CPLEX for MATLAB The Cplex class stores the model and provides methods for the solution analysis manipulation and reading writing of the model file All of the data associated with the problem is stored in the properties of a Cplex object These class properties are standard MATLAB data structu
10. emarks or service marks of others Further acknowledgements IBM ILOG CPLEX states these additional registered trademarks and acknowledgements Additional registered trademarks Python is a registered trademark of the Python Software Foundation MATLAB is a registered trademark of The MathWorks Inc Acknowledgement of use dtoa routine of the gdtoa package IBM ILOG CPLEX acknowledges use of the dtoa routine of the gdtoa package available at http www netlib org fp The author of this software is David M Gay All Rights Reserved Copyright C 1998 1999 by Lucent Technologies Permission to use copy modify and distribute this software and its documentation for any purpose and without fee is hereby granted provided that the above copyright notice appears in all copies and that both that the copyright notice and this permission notice and warranty disclaimer appear in supporting documentation and that the name of Lucent or any of its entities not be used in advertising or publicity pertaining to distribution of the software without specific written prior permission LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS WHETHER IN AN ACTION OF CONTRACT NEGLIGENCE OR OTHER TORTIO
11. plex refineConflict Cplex refineMipStartConflict Cplex terminate The following methods are provided to solve set and query parameters Cplex tuneParam Cplex setDefault Cplex getChgParam Although a model can be modified by manipulating the MATLAB data structures directly the following functions are provided to make modifications easier Cplex addCols Cplex addRows Cplex delCols Cplex del Rows Cplex addSOSs Cplex addQCs Cplex addIndicators Setting and querying parameters in the CPLEX Class API To set parameters using the CPLEX Class API you set the current values of the fields in the Param structure property of the Cplex class For example to set a node limit of 400 and instruct CPLEX to use traditional branch and cut style search 12 Getting Started with CPLEX for MATLAB cpx Param mip limits nodes Cur 400 cpx Param mip strategy search Cur 1 Tip If you are already familiar with the names of parameters in the Interactive Optimizer then you quickly recognize names of parameters in CPLEX for MATLAB For example the command set mip limits nodes 1 in the Interactive Optimizer corresponds to cpx Param mip imits nodes Cur 1 in the CPLEX Class API where cpx is an instance of the Cplex class To assist in setting parameters auto completion of parameter names is available in the MATLAB environment Chapter 5 Overview of the CPLEX for MATLAB APIs 13 14 Getting Started with CPLEX for MATLAB Chapter 6
12. res and can be manipulated directly within MATLAB However modifying the problem using methods provided in the Cplex class enforces consistency such as ensuring that vectors are of the proper length The documentation of the Cplex class provides an introduction of properties and methods of the Cplex class in more detail The properties of the Cplex class include Cplex Model stores the data of the model Cplex Solution stores the solution of the model Cplex Param stores the parameters options of the model Cplex Start stores the start of the LP model Cplex MipStart stores the start of the MIP model Cplex InfoCal lback pointer to an informational callback Cplex Conflict stores the conflict information of a conflicted model Cplex Order stores the priority order information Chapter 5 Overview of the CPLEX for MATLAB APIs 11 Cplex DisplayFunc pointer to a function which provides control of display of output The following informative methods are provided Cplex getVersion returns the CPLEX version Cplex getProbType returns the problem type of the model The following methods are provided for reading from and writing to files Cplex readModel Cplex writeModel Cplex readBasis Cplex writeBasis Cplex readMipStart Cplex writeMipStart Cplex readParam Cplex writeParam Cplex writeConflict The following methods are provided to solve and analyze the model solution and mipstart Cplex solve Cplex populate Cplex feasOpt C
13. unctions e cplexIsqlin for linearly constrained least squares problems e cplexlsqmilp for linearly constrained mixed integer least squares problems e cplexlsqbilp for linearly constrained binary integer least squares problems e cplexIsqmiqcp for quadratically constrained mixed integer least squares problems e cplexlsqqcp for quadratically constrained programming problems e cplexIsqnonneglin for nonnegative least squares problems Copyright IBM Corp 1987 2011 9 e cplexlsqnonnegmilp for nonnegative mixed integer least squares problems e cplexlsqnonnegmiqcp for nonnegative quadratically constrained mixed integer least squares problems and e cplex sqnonnegqcp for nonnegative quadratically constrained programming problems The advantage of the toolbox design is that you can reuse your code where you had used MATLAB Optimization Toolbox functions to solve linear programming quadratic programming binary integer programming linearly constrained least squares and nonnegative least squares problems Setting and querying parameters in the CPLEX for MATLAB Toolbox Options also called parameters can be set to control the solution of problems The toolbox provides two types of options input One type corresponds to the MATLAB Optimization Toolbox options and the other type is the CPLEX parameters You can use either or both of these types of options If you use both the CPLEX parameters will override the MATLAB options
14. x beq Aineq x lt bineq with these bounds lt x lt u where Aeq and Aineq are matrices f beq bineq 1 and u are vectors such that the upper bounds u i and lower bounds 1 i may be positive infinity negative infinity or any real number Both sparse and dense format can be used in all places where matrices vectors are used The elements of data you provide as input for this LP problem are Objective function coefficients f Constraint coefficients Aeq Aineq Righthand sides beq bineq Upper and lower bounds The optimal solution that CPLEX computes and returns is Variables x CPLEX for MATLAB can also solve several extensions to LP e Quadratic Programming QP problems where the LP objective function is expanded to include quadratic terms e Quadratically Constrained Programming QCP problems that include quadratic terms among the constraints In fact CPLEX can solve Second Order Cone Programming SOCP problems e Mixed Integer Programming MIP problems where any or all of the LP QP or QCP variables are further restricted to take integer values in the optimal solution and where MIP itself is extended to include constructs like Special Ordered Sets SOS semi continuous variables and indicator variables Copyright IBM Corp 1987 2011 7 e Least Squares LSQ problems where the objective is to minimize a norm The problem can be constrained linearly or quadratically and the variables may be restri
Download Pdf Manuals
Related Search
Related Contents
MANUEL D`UTILISATION Clifford concept 50x Automobile Alarm User Manual Content Client User Manual Manuel d`utilisation Nokia 6700 classic Allied Telesis 595 User's Manual Kenwood KDV-7241 User's Manual 取扱説明書 - ご家庭のお客さま/大阪ガス ins. ay-1200-2100 invert User Manual - Topaz Labs I-7550 user manual Copyright © All rights reserved.
Failed to retrieve file