Process Optimization

Similar documents
Chapter 4: Basic C Operators

Introduction to Engineering gii

Operators Functions Order of Operations Mixed Mode Arithmetic VOID Data. Syntax and type conventions Using the Script window interface

Python Lists: Example 1: >>> items=["apple", "orange",100,25.5] >>> items[0] 'apple' >>> 3*items[:2]

ANSI C Programming Simple Programs

Goals for This Lecture:

Algebraic Expressions

9 Using Equation Networks

Methods CSC 121 Fall 2014 Howard Rosenthal

Quick MATLAB Syntax Guide

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Engineering Problem Solving with C++, Etter/Ingber

Graphing Calculator Tutorial

XQ: An XML Query Language Language Reference Manual

Exponential Notation

Numerical Analysis First Term Dr. Selcuk CANKURT

Chapter 3. Computer Science & Engineering 155E Computer Science I: Systems Engineering Focus. Existing Information.

CSI31 Lecture 5. Topics: 3.1 Numeric Data Types 3.2 Using the Math Library 3.3 Accumulating Results: Factorial

MATLAB Basics EE107: COMMUNICATION SYSTEMS HUSSAIN ELKOTBY

Introduction to MATLAB

ELEMENTARY MATLAB PROGRAMMING

2 Making Decisions. Store the value 3 in memory location y

CT 229 Java Syntax Continued

Program Structure and Format

Computer Science & Engineering 150A Problem Solving Using Computers

Programming in QBasic

Arithmetic. 2.2.l Basic Arithmetic Operations. 2.2 Arithmetic 37

Computer Science & Engineering 150A Problem Solving Using Computers. Chapter 3. Existing Information. Notes. Notes. Notes. Lecture 03 - Functions

Variable and Data Type 2

Data Types and Basic Calculation

ME 172. Lecture 2. Data Types and Modifier 3/7/2011. variables scanf() printf() Basic data types are. Modifiers. char int float double

ENGR 1181 Autumn 2015 Final Exam Study Guide and Practice Problems

Introduction to Programming

Lab 1 - Worksheet Spring 2013

Maths Functions User Manual

Operators and Expression. Dr Muhamad Zaini Yunos JKBR, FKMP

Methods CSC 121 Fall 2016 Howard Rosenthal

Product Price Formula extension for Magento2. User Guide

Check In before class starts:

C++ Programming Lecture 11 Functions Part I

Introduction to Python, Cplex and Gurobi

Introduction to MATLAB

ENGR 1181c Midterm Exam 2: Study Guide and Practice Problems

To start using Matlab, you only need be concerned with the command window for now.

Chapter 2. Outline. Simple C++ Programs

Linear Programming with Bounds

6-1 (Function). (Function) !*+!"#!, Function Description Example. natural logarithm of x (base e) rounds x to smallest integer not less than x

TECH TIP VISION Calibration and Data Acquisition Software

Programming in MATLAB

Unit 2: Accentuate the Negative Name:

Chapter 1 Introduction to MATLAB

Methods CSC 121 Spring 2017 Howard Rosenthal

USER-DEFINED ELEMENT IN ZMAN TM

Fundamentals of Programming & Procedural Programming

AMS 27L LAB #1 Winter 2009

Dr Richard Greenaway

MYSQL NUMERIC FUNCTIONS

What is a Function? EF102 - Spring, A&S Lecture 4 Matlab Functions

ENGR 1181 Midterm Exam 2: Study Guide and Practice Problems

CCBC Math 081 Order of Operations Section 1.7. Step 2: Exponents and Roots Simplify any numbers being raised to a power and any numbers under the

Custom Variables (Virtual Variables)

Definitions. Spreadsheet. Usefulness of Spreadsheets What do people use it for? Spreadsheet Page. Spreadsheet Cell

What is Matlab? The command line Variables Operators Functions

Translation of graphs (2) The exponential function and trigonometric function

Introduction to Matlab

Intrinsic Functions Outline

Operations. Making Things Happen

MATLAB Tutorial EE351M DSP. Created: Thursday Jan 25, 2007 Rayyan Jaber. Modified by: Kitaek Bae. Outline

Lesson 08 Linear Programming

Introduction to MatLab. Introduction to MatLab K. Craig 1

C++ Overview. Chapter 1. Chapter 2

Chapter 4 Section 2 Operations on Decimals

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

A function is a named group of statements developed to solve a sub-problem and returns a value to other functions when it is called.

The Number object. to set specific number types (like integer, short, In JavaScript all numbers are 64bit floating point

Odd-Numbered Answers to Exercise Set 1.1: Numbers

Welcome to EGR 106 Foundations of Engineering II

Matlab as a calculator

Summer Assignment Glossary

Introduction to MATLAB 7 for Engineers

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT

II. Linear Programming

2 Introduction to GAMS

4/2/2014 6:02:01 PM3/29/2014 9:17:13 PM Adapted from UbD Framework

Dr Richard Greenaway

Green Globs And Graphing Equations

Exponents. Reteach. Write each expression in exponential form (0.4)

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An.

CURVE SKETCHING EXAM QUESTIONS

Lecture 1. Introduction to course, Welcome to Engineering, What is Programming and Why is this the first thing being covered in Engineering?

1 Week 1: Basics of scientific programming I

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing

LECTURE NOTES Non-Linear Programming

Scheme Quick Reference

1.1 - Functions, Domain, and Range

Math 3 Coordinate Geometry Part 2 Graphing Solutions

Sketchify Tutorial Properties and Variables. sketchify.sf.net Željko Obrenović

COMP 110/L Lecture 4. Kyle Dewey

LinReg 2.06 Manual. DePauw University: Physics Department 120 Physics I and 130 Physics II

MatLab Just a beginning

Transcription:

Process Optimization

Tier II: Case Studies Section 1: Lingo Optimization Software

Optimization Software Many of the optimization methods previously outlined can be tedious and require a lot of work to solve, especially as models get more complex and move beyond two or three variables, which will often be the case Software can be used to solve these problems more efficiently

Optimization Software Software that is available usually uses the same methods previously outlined, but can of course perform the calculations quicker, allowing the effect of variations in the model to be studied more easily

Optimization Software Some optimization examples have already been shown using Excel Another program, Lingo, will now be demonstrated A trial version of this software can be downloaded at www.lindo.com/cgi/frameset.cgi?leftlingo.h tml;lingof.html

Lingo Lingo is a program designed specifically for solving optimization problems It uses a syntax that is similar to what would be written by hand, or what would be used in Excel, not requiring variables to be declared For example, y = 3*x^2 is y = 3x 2

Lingo Operators Many of Lingo s mathematical operators are similar to what Excel uses: Addition: + - Multiplication: * Subtraction: - - Division: / For exponents: X^n Equals: = Greater than or less than: > or < Note: Lingo accepts < as being <=. It does not support strictly less than or greater than.

Lingo Operators, con t Absolute value of x: @abs(x) Natural log of x: @log(x) Trigonometric functions: @sin(x), @cos(x), @tan(x) (x in radians) Exponentials: @exp(x) To return integer portion of decimal number: @floor(x) @sign(x): returns -1 if x < 0, or else 1

Lingo Operators, con t Find max or min value in a set: @smax(x1,x2,xn) or @smin(x1,x2,xn) To find maximum or minimum of a function: max or min To allow negative variables: @free(x) Lingo has a number of other operators, but these are the mathematical operators that are most likely to be used

Using Lingo Other operators, like logic operators, can be found in the help file s complete list of operators Now that we have the mathematical operators that are likely to be used, we can demonstrate how Lingo works with some examples Lingo can be used strictly as an equation solver or as an optimizer

Lingo Screenshot If additional help is needed Solve to solve current problem set

Basic Equation Solver This will find the intersection of the lines y = 3x + 4 and y = 5x + 1

Solution Note: Lingo does not distinguish between small and capital letters

Equation Solver #2

Solution #2 Only one solution was found! There should be two solutions to this problem. The solver automatically stops when it finds the first solution.

Solution #2 20 15 10 Y 7.791 5 3.2087 0-5 0 5 10 15-5 3.2087 X 7.791

Non-linear Difficulties Lingo is not designed to deal with nonlinear equations It cannot find multiple solutions There is a problem with solving non-linear problems, especially if the solution is in the negative domain

Maximum and Minimum The maximum and minimum functions are the most important functions needed for optimization problems These functions are used as follows: max = objective function; min = objective function;

Solving Optimization Problems Several optimization examples that were worked through in previous sections will now be solved using Lingo The first example is from the introduction section

Chemical Plant Example Objective: Maximize 1000x 1 + 1500x 2 Constraints: 4x 1 + 2x 2 <= 80 2x 1 + 5x 2 <= 60 4x 1 + 4x 2 <= 75 x 1, x 2 >= 0

Chemical Plant Example

Lingo Solution Solution, including value of objective function at optimum and optimum point

Transportation Scheme Problem

Problem #2 Solution

Negative Values Lingo cannot automatically solve for a negative variable value If it is suspected that a solution will be negative, then that variable will need to be specifically declared as free: @free(x); It is a good idea to declare all variables like this, unless of course a negative value is infeasible

Attempting to Obtain a Negative Solution The following example will demonstrate what happens if a negative value is required to get an optimum solution Lingo will automatically solve for the optimum solution obtained from only positive variables, even if this is not the true optimum

Attempting to Obtain a Negative Solution

Attempting to Obtain a Negative Solution This solution is viable if the variable values must be positive, but this is not the true optimum

Attempting to Obtain a Negative Solution These statements allow negative values to be used for these variables

Attempting to Obtain a Negative Solution Now the true optimum is obtained, with negative variables

Greater Than or Less Than Another potential problem that will be encountered using Lingo is that it treats < the same as <=, and > the same as >= Thus, if a variable must be strictly greater than a value, the constraint is best treated as follows: For x > A, where A is a solution otherwise, use x > A + b; where b is an arbitrary value, like 0.1, that covers a portion where the solution will not lie

Example of < or >

Example of < or > Clearly this is not correct as X1 was constrained to be greater than 0!

Example of < or > This will now force X1 and X2 to be greater than 0. We can do this because we know X1 and X2 are also greater than 0.1.

Example of < or > Variables now obey desired constraints. Objective just happens to be the same in this case.

Conclusions Lingo is effective and efficient for solving optimization problems if they are linear It is not designed to deal with non-linear problems It is not very good at dealing with non-linear problems, so these must be approached with caution It does not handle multiple maximum or minimum points very well in non-linear cases