Using IBM CPLEX Optimization Studio with MathWorks MATLAB

Similar documents
IBM ILOG CPLEX Optimization Studio Getting Started with CPLEX for MATLAB. Version 12 Release 6

IBM ILOG CPLEX Optimization Studio Getting Started with CPLEX for MATLAB. Version 12 Release 7 IBM

WebSphere Partner Gateway v6.2.x: EDI TO XML Transformation With FA

Advanced Integration Services In IBM Business Process Manager


Broadcasting in IBM Sterling File Gateway

Best Practices for memory management in Cast Iron 7.X

How to Successfully Set Up the WebSphere ILOG Rule Team Server

Application Editioning in WebSphere 8.5

Release notes for CPLEX

WebSphere Flat File Adapter V7.5 - What's New?

Getting Started with WebSphere MQ Message Bindings in WebSphere Process Server and WebSphere Enterprise Service Bus

Team Support and Versioning with ClearCase and CVS in WebSphere Business Modeler V7

BPM 7.5 Deployments and Troubleshooting

Ask the Experts DataPower Topics on Networking, MQFTE, Regular Expressions, DataPower Timeouts and ODBC Technologies

Troubleshooting IBM Business Monitor

DataPower integration with Multi-instance MQ Queue Managers

Packaging and Deploying Java Based Solutions to WebSphere Message Broker V7

InfoSphere Guardium 9.1 TechTalk Reporting 101

Understanding WebSphere Business Monitor Failed Events Manager

Troubleshooting Tips and Hints for WebSphere JDBC Adapter

Migrating from JRules to Operational Decision Manager

Monitoring DataPower with ITCAM for SOA, ITCAM Agent for DataPower, and WAMC

Troubleshooting and Resolving Issues with the Intelligent Management Plugin

IBM WebSphere Transformation Extender for the Absolute Beginner

WebSphere Data Interchange 3.3 Installation / Migration for Multiplatform

SCREEN COMBINATION FEATURE IN HATS 7.0

[CONFIGURE NEW PAYMENT METHOD IN STORE FRONT]

Troubleshooting SCA Problems in WebSphere Process Server Open Mic

WebSphere Enterprise Service Bus (ESB): Developing Complex Scenarios Simply

Ask the Experts JNDI Naming configuration and problem determination

Understanding the WASService with the WASServiceCMD Tool in WebSphere Application Server

Security Improvements on Cast Iron

Script Libraries in WebSphere Application Server V7

Simplifying Migrations with the WebSphere Application Server Migration Toolkit

IBM Social Rendering Templates for Digital Data Connector

Reducing MIPS Using InfoSphere Optim Query Workload Tuner TDZ-2755A. Lloyd Matthews, U.S. Senate

WebSphere Transformation Extender Utility Commands (Part III)

Insights into WebSphere Process Server Tracing

WebSphere Integration Developer v Mediation Module

AD406: What s New in Digital Experience Development with IBM Web Experience Factory

Ask the Experts MQ Clustering Gotchas! Avoiding Cluster Administration Errors

Best Practices for Installing WebSphere Application Server V7 Feature Packs

Processing Segmented Messages in DataPower using MQ V7

Using Hive for Data Warehousing

WP710 Language: English Additional languages: None specified Product: WebSphere Portal Release: 6.0

Best Practices for WebSphere Application Server Product Updates

WebSphere Data Interchange (WDI) for z/os - Converting from a DB2 DBRM Based Plan to a DB2 Package Based Plan

Build and Deploy Stored Procedures with IBM Data Studio

IBM Lotus Notes in XenApp Environments

Introduction to Customizing the WebSphere Commerce Data Service Layer

Using SSL to Connect to a WebSphere Application Server with a WebSphere MQ Queue Manager

Configuration Migration for WebSphere Application Server

An Overview of WebSphere MQ Telemetry and How to Utilize MQTT for Practical Solutions

What s New in CPLEX Optimization Studio ?

MSS VSOC Portal Single Sign-On Using IBM id IBM Corporation

WebSphere Application Server V7.0 Centralized Installation Manager

Empowering DBA's with IBM Data Studio. Deb Jenson, Data Studio Product Manager,

Upgrading the DOORS and Change integration data to the OSLC-CM integration

Upgrading to IBM WebSphere Portal and Web Content Manager V8.5

How to Modernize the IMS Queries Landscape with IDAA

WebSphere MQ Serviceability: Solving Problems Effectively

Hands-on Lab Session 9909 Introduction to Application Performance Management: Monitoring. Timothy Burris, Cloud Adoption & Technical Enablement

Ask the Experts. Understanding HA Manager, WLM and ORB in WebSphere Application Server. 06 October IBM Software Group

Integrate IBM Rational Application Developer and IBM Security AppScan Source Edition

Troubleshooting WebSphere Process Server: Integration with LDAP systems for authentication and authorization

IBM Application Performance Analyzer for z/os Version IBM Corporation

Understanding scan coverage in AppScan Standard

Hands-on Lab Session 9020 Working with JSON Web Token. Budi Darmawan, Bluemix Enablement

WebSphere Application Server 6.1 Virtual member manager

Monitoring DataPower revisited: ITCAM for SOA 7.2, ITCAM Agent for DataPower 7.1, and WAMC 5.0

IBM Support Technical Exchange. Agenda

WebSphere Transformation Extender Utility Commands (Part II)

WebSphere MQ Clustering New Features in MQ V7.1 / V Distributed

WebSphere MQ Triggering Concepts and Problem Determination

ISAM Federation STANDARDS AND MAPPINGS. Gabriel Bell IBM Security L2 Support Jack Yarborough IBM Security L2 Support.

IBM i2 Analyze ibase Connector Deployment Guide. Version 4 Release 1 IBM

Troubleshooting of SIB Messaging Engine Failover Problems in a Clustered Environment

HATS APPLICATION DEVELOPMENT FOR A MOBILE DEVICE

New System Management Components in WebSphere Application Server V7

Innovate 2013 Automated Mobile Testing

Hands-on Lab Session 9011 Working with Node.js Apps in IBM Bluemix. Pam Geiger, Bluemix Enablement

IBM Software. IBM Forms V8.0. Forms Experience Builder - Portal Integration. Lab Exercise

Setup domino admin client by providing username server name and then providing the id file.

IBM ILOG CPLEX Optimization Studio CPLEX Parameters Reference. Version 12 Release 7 IBM

Track 3 Session 5. IBM Notes Browser Plug-in:Leverage your IBM Notes Application investment in a Browser. Stefan Neth

Understanding Flexible Management in WebSphere Application Server V7

Using Hive for Data Warehousing

Smart Transformation. Smart Transformation. Ravi Indukuri IBM Commerce

Accessing Hadoop Data Using Hive

IBM Infrastructure Suite for z/vm and Linux: Introduction IBM Tivoli OMEGAMON XE on z/vm and Linux

Disk Space Management of ISAM Appliance

IBM Workplace TM Collaboration Services

IBM i 7.3 Features for SAP clients A sortiment of enhancements

IBM Lotus Instant Messaging Gateway

Appendix A MATLAB s Optimization Toolbox Algorithms

TIBCO LogLogic Unity Release Notes

IBM Integration Bus v9.0 Introduction and What s new?

Using Hive for Data Warehousing

IBM Db2 Event Store Simplifying and Accelerating Storage and Analysis of Fast Data. IBM Db2 Event Store

Transcription:

IBM Software Group Using IBM CPLEX Optimization Studio with MathWorks MATLAB Adrian Curic (curica@us.ibm.com) Technical Support Engineer, Level 2 23 October 2014

Agenda IBM Software Group Explain the architecture of CPLEX to MATLAB connector. Illustrate how to model and solve an optimization problem. Offer troubleshooting and solutions for some common errors. 2

Interaction between IBM ILOG CPLEX and MathWorks MATLAB 3

Overview CPLEX IBM Software Group Product of IBM. A tool for solving mathematical optimization problems. Minimize or maximize linear and convex quadratic objectives. Components: CPLEX Interactive Optimizer. Class libraries: Concert Technology and CPLEX Callable Library. Python API for CPLEX. Tools for infeasible model analysis. 4

Overview IBM Software Group MATLAB Product of The MathWorks, Inc. High-level language and interactive environment for numerical computation, visualization, and programming. Widely used for technical computing. 5

Overview IBM Software Group CPLEX connector for MATLAB A high-performance interactive environment allowing computation, visualization and programming for solving mathematical scripts. Two API for solving mathematical optimization problems: The MATLAB Toolbox. Special CPLEX class defined the MATLAB language. 6

Setting Up CPLEX for MATLAB Connector installation location (for a 64bit system): <CPLEX install dir>\cplex\matlab\x64_win64 Contains header m files, parsed p files and mex files for the CPLEX class and toolbox. >> addpath ( <CPLEX install dir>\cplex\matlab\x64_win64 ) <CPLEX install dir>\cplex\examples\src\matlab Contains MATLAB examples for the CPLEX API utilization. >> addpath ( <CPLEX install dir>\cplex\examples\src\matlab ) Save the path for the next session: >>savepath 7

Online help in MATLAB Online help is available from MATALAB Help > Product Help on the MATLAB toolbar. 8

Online help in MATLAB Toolbox and CPLEX API help from command prompt. 9

Model and solve an optimization problem with CPLEX for MATLAB connector 10

CPLEX toolbox functions Solve mathematical optimization model. Objective minimization sense only. Linear programming, quadratic programming, mixed integer and least square problems. x = cplexlp(f,aineq,beq,aeq,beq,lb,ub) solves the mathematical optimization problem: min f*x st. Aineq*x <= bineq Aeq*x = beq lb <= x <= ub 11

CPLEX toolbox functions Arguments: Matrices and vectors with problem data. Options structure to control solution process. Returns: Solution vectors (x, lambda). Objective function value. Exit flag. Solution statistics. 12

CPLEX toolbox functions example cplexlpex.m function cplexlpex % Use the function cplexlp to solve a linear programming problem % % The LP problem solved in this example is % Maximize x1 + 2 x2 + 3 x3 % Subject to % - x1 + x2 + x3 <= 20 % x1-3 x2 + x3 <= 30 % Bounds % 0 <= x1 <= 40 % 0 <= x2 % 0 <= x3 13

CPLEX toolbox functions example cplexlpex.m try % Since cplexlp solves minimization problems and the problem % is a maximization problem, negate the objective f = [-1-2 -3]'; Aineq = [-1 1 1; 1-3 1]; bineq = [20 30]'; lb = [0 0 0]'; ub = [40 inf inf]'; % Toolbox options are set with the function cplexoptimset options = cplexoptimset; options.display = 'on'; [x, fval, exitflag, output] = cplexlp... (f, Aineq, bineq, [], [], lb, ub, [], options); fprintf ('\nsolution status = %s\n', output.cplexstatusstring); fprintf ('Solution value = %f\n', fval); disp ('Values ='); disp (x'); catch m disp(m.message); end end 14

CPLEX toolbox, further help Function descriptions available through MATLAB online help or CPLEX online documentation: http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r6/index.jsp CPLEX > CPLEX for MATLAB > Function reference For MATLAB Cplex Class API applications, MATLAB Toolbox the names of parameters resemble the names in the CPLEX Interactive Optimizer. CPLEX > Parameters of CPLEX > List of CPLEX parameters To maintain compatibility with the MATLAB Optimization Toolbox, a number of parameters may be set using the MATLAB Optimization Toolbox parameter names: options = cplexoptimset('maxnodes', 400);. 15

CPLEX Class API Mathematical optimization problems are modeled by special objects. The objects carry persistent state information. A model can be build gradually by manipulating a CPLEX object. Computation methods such as Cplex.solve() and Cplex.refineConflict() can modify the object so results can be queried as needed. Restarts can be performed after manipulation. Possible to attach an output parser, a GUI with stop buttons, and other controls. 16

CPLEX Class API Access to advanced CPLEX features: Conflict refinement. FeasOpt. Solution pools. Parameter tuning. InfoCallback. Reading and writing of problem and solution files. 17

CPLEX Class API - example lpex1.m % Initialize the CPLEX object cplex = Cplex('lpex1'); % Now populate the problem with the data % Use arrays to populate the model cplex.model.sense = 'maximize'; cplex.model.obj = [1; 2; 3]; cplex.model.lb = [0; 0; 0]; cplex.model.ub = [40; inf; inf]; cplex.model.a = [-1 1 1; 1-3 1]; cplex.model.lhs = [-inf; -inf]; cplex.model.rhs = [20; 30]; % Optimize the problem cplex.solve(); % Write the solution fprintf ('\nsolution status %s\n',cplex.solution.statusstring); fprintf ('Solution value = %f\n',cplex.solution.objval); disp ('Values = '); disp (cplex.solution.x'); 18

CPLEX class API, further help The following methods are provided to solve and analyze the model, solution and mipstart: Cplex.solve Cplex.populate Cplex.feasOpt Cplex.terminate Cplex.refineConflict For reading and writing to files: Cplex.readModel, Cplex.readSolution, Cplex.readMipStart, Cplex.readParam, Cplex.writeConflict Cplex.writeModel Cplex.writeSolution Cplex.writeMipStart Cplex.writeParam CPLEX Class API information available through MATLAB online help or CPLEX online documentation: http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r6/index.jsp CPLEX > CPLEX for MATLAB > Function reference > Class List > CPLEX Class Reference CPLEX > CPLEX for MATLAB > Getting Started with CPLEX for MATLAB > Overview of the CPLEX for MATLAB APs 19

Troubleshooting common issues 20

CPLEX connector functions and help pages are not enabled in MATLAB Cause: the CPLEX connector home directory was not correctly added to the MATLAB path. Make sure you enclose the directory by quotation marks if you are using a special character in the path (such as the space in Program files ). Typical path on a Windows system: >> addpath ( C:\Program Files\IBM\ILOG\CPLEX_Studio126\matlab\x64_win64 ) Typical path on a Linux system: >> addpath ( usr/ibm/ilog/cplex_studio126/matlab/ ) 21

CPLEX connector crashes during solve Cause: if input data is invalid, the CPLEX MATLAB connector might crash. If you turn on the datacheck parameter, CPLEX can report the data error first. Cplex.BooleanParam.DataCheck For more information, see: http://pic.dhe.ibm.com/infocenter/cosinfoc/v 12r6/index.jsp?topic=%2Filog.odms.cplex.hel p%2fcplex%2fmatlab%2ftopics%2fgs_param.html 22

Conclusion 23

Additional WebSphere Product Resources Learn about upcoming WebSphere Support Technical Exchange webcasts, and access previously recorded presentations at: http://www.ibm.com/software/websphere/support/supp_tech.html Discover the latest trends in WebSphere Technology and implementation, participate in technically-focused briefings, webcasts and podcasts at: http://www.ibm.com/developerworks/websphere/community/ Join the Global WebSphere Community: http://www.websphereusergroup.org Access key product show-me demos and tutorials by visiting IBM Education Assistant: http://www.ibm.com/software/info/education/assistant View a webcast replay with step-by-step instructions for using the Service Request (SR) tool for submitting problems electronically: http://www.ibm.com/software/websphere/support/d2w.html Sign up to receive weekly technical My Notifications emails: http://www.ibm.com/software/support/einfo.html 24

Connect with us! 1. Get notified on upcoming webcasts Send an e-mail to isesuppt@us.ibm.com with subject line iste subscribe to get a list of mailing lists and to subscribe 2. Tell us what you want to learn Send us suggestions for future topics or improvements about our webcasts to isesuppt@us.ibm.com 3. Be connected! Connect with us on Facebook 25

Join the Client Success Essentials Community Easily find important Support resources Connect with the Experts Support Technical Exchanges Ask the Experts Sessions Product Support Newsletters Blog & Forums Training videos, IEA modules Event Readiness Proactive Services Offerings Essential Links to key sites IBM Support Portal Client Success Portal Fix Central http://ibm.biz/client-success-essentials

THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN ADDITION, THIS INFORMATION IS BASED ON IBM S CURRENT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE. IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION, NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO NOR SHALL HAVE THE EFFECT OF CREATING ANY WARRANTIES OR REPRESENTATIONS FROM IBM (OR ITS SUPPLIERS OR LICENSORS), OR ALTERING THE TERMS AND CONDITIONS OF ANY AGREEMENT OR LICENSE GOVERNING THE USE OF IBM PRODUCT OR SOFTWARE. Copyright and Trademark Information IBM, The IBM Logo and IBM.COM are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks and others are available on the web under Copyright and Trademark Information located at www.ibm.com/legal/copytrade.shtml. 27