Name of the model & options Parameters Declarations (decision variables, arrays, etc.) Data input Objective function Constraints Output & results How to.

Slides:



Advertisements
Similar presentations
A Short Review Arrays, Pointers and Structures. What is an Array? An array is a collection of variables of the same type and placed in memory contiguously.
Advertisements

Input and Output READ WRITE OPEN. FORMAT statement Format statements allow you to control how data are read or written. Some simple examples: Int=2; real=
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
Looping while … do …. Condition Process 2 Process 1 Y Repeated Loop.
C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
1 Arrays in JavaScript Name of array (Note that all elements of this array have the same name, c ) Position number of the element within array c c[6] c[0]
Formulations and Reformulations in Integer Programming Michael Trick Carnegie Mellon University Workshop on Modeling and Reformulation, CP 2004.
Applied Operations Research (Xpress MP lecture)1Semester 2, 2007 Introduction to Modelling with Xpress MP Applied Operations Research Department.
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
J. Michael Moore From James Tam’s material Multi-Dimensional Arrays CSCE 110.
Binary Decision Diagrams1 BINARY DECISION DIAGRAMS.
Do Loop The syntax of DO loop: DO variable = initial_value, final_value[, increment] [statements] END DO Example: PROGRAM LINES ! Illustration of DO-loops.
Chapter 8 Introduction to Arrays Part II Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering İstanbul.
CS150 Introduction to Computer Science 1
J. Michael Moore From James Tam’s material Multi-Dimensional Arrays CSCE 110.
Introduction to Computing Dr. Nadeem A Khan. Lecture 24.
1 10/9/06CS150 Introduction to Computer Science 1 for Loops.
Revision – A simple program How to start a program? How to end a program? How to declare variables? What are the mathematical operators? How to start a.
Chapter seven review. What is the output of: Private Sub cmdButton_Click() Dim i As Integer, a(1 To 4) As integer Open "DATA.TXT" For Input As #1 For.
Центр атестації педагогічних працівників 2014
CS140: Intro to CS An Overview of Programming in C by Erin Chambers.
Pascal Course Spring Introduction Designed: 1968/9 by Niklaus Wirth Published: 1970 Imperative, structural, procedural Static and strong.
GAMS Anwendung Nutzeroberfläche eigene Programme Modellierungs- System GAMS AMPL ILOG Studio … Solver CPLEX, CONOPT, MINOS, COIN, BARON,...
How to get started with GAMS MS&E 348 – Lecture 1/20/04.
ENG 1181 College of Engineering Engineering Education Innovation Center MAT – Conditional Statements Topics: 1.Conditional statements if-end if-else-end.
1/8/ L11 Project Step 5Copyright Joanne DeGroat, ECE, OSU1 Project Step 5 Step 2 in behavioral modeling. Use of procedures.
/* Documentations */ Pre process / Linking statements Global declarations; main( ) { Local Declarations; Program statements / Executable statements; }
Array Cs212: DataStructures Lab 2. Array Group of contiguous memory locations Each memory location has same name Each memory location has same type a.
Programming Test #1 Solutions. Multiple Choice 1. B) the grammar of the coding language 2. C) String 3. A) Single 4. C) 2Burgers4Me 5. B) Design Time.
CARDIAC ELECTROPHYSIOLOGY WEB LAB Developing your own protocol descriptions.
Michal Koháni Departement of Transportation Networks Faculty of Management Science and Informatics University of Zilina, Slovakia Høgskolen i Molde, September.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383
solve x + (-16) = -12 solve x + (-16) = X = 4.
Assignment statement and Arithmetic operation 1 The major part of data processing.
Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values.
Let us consider one producer P and four customers, which are supplied each day with one item of product each. Customers can be supplied only by trucks.
CSC 111. Solving Problems with Computers Java Programming: From Problem Analysis to Program Design, Third Edition3 Solving Problems Stages 1.Problem.
JavaScript 1 COE 201- Computer Proficiency. Introduction JavaScript scripting language ▫Originally created by Netscape ▫Facilitates disciplined approach.
Chapter 8: Advanced Method Concepts. Understanding Parameter Types Mandatory parameter – An argument for it is required in every method call Four types.
1 Chapter 7 Arrays. 2 Outline and Objective In this chapter we will Learn about arrays One-dimensional arrays Two-dimensional arrays Learn about searching.
Michal Koháni Department of Transportation Networks Faculty of Management Science and Informatics University of Zilina, Slovakia XPRESS – IVE Seminary.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Dale Roberts Introduction to Java - Input, Program Control and Instantiation Dale Roberts, Lecturer Computer Science, IUPUI
Chapter 4 Linear Programming Models. Introduction All of the models in this chapter are linear models Which means: Target cell is ultimately (possibly.
Control Structures: Examples. for-loop example Q: If a=1, b=3, and x=7, what is the value of x when the loop terminates? A: x=1 for(k=a; k
Exercise 2 : Using for loop Repetition (loop) (1)control variable initialization (2)Test Conditon (3)Modification of control variable value order : (1)
Multiplication
Multiplication
Introduction to Scripting
Using local variable without initialization is an error.
Variables, Loops, Decision Statements, etc
الفصل الثاني الخوارزمية
Number Systems and Circuits for Addition
There are 10 types of people of people in this world…
Pascal Subprogram Procedure Function Build in Function (e.g. Sin(x))
CS2011 Introduction to Programming I Loop Statements (II)
ЗУТ ПРОЕКТ на Закон за изменение и допълнение на ЗУТ
Боряна Георгиева – директор на
Сътрудничество между полицията и другите специалисти в България
ДОБРОВОЛЕН РЕЗЕРВ НА ВЪОРЪЖЕНИТЕ СИЛИ НА РЕПУБЛИКА БЪЛГАРИЯ
Програма за развитие на селските райони
БАЛИСТИКА НА ТЯЛО ПРИ СВОБОДНО ПАДАНЕ В ЗЕМНАТА АТМОСФЕРА
mdul-cntns-sub-cmmnts2.f90
Python Basics with Jupyter Notebook
Fundamental Programming
JavaScript: Introduction to Scripting
Brent M. Dingle Texas A&M University Chapter 5 – Section 2-3
Intro to Programming (in JavaScript)
Lesson 3. Controlling program flow. Loops. Methods. Arrays.
Presentation transcript:

Name of the model & options Parameters Declarations (decision variables, arrays, etc.) Data input Objective function Constraints Output & results How to write a model in Mosel Xpress-IVE 1

model ModelName options … uses “mmxprs” … !other sections end-model For comment write “!” before the commented word How to write a model (1) Name of the model & options 2

model ModelName !parameters section first parameters MAXTIME=300 USE_LOG=false !... end-parameters !Rest of the model (declarations, statements, etc.) end-model How to write a model (2) Parameters – optional section 3

declarations Variable : mpvar VariableArray : array() of mpvar IntegerVariable : mpvar BinaryVariable : mpvar end-declarations IntegerVariable is_integer !when integer variable BinaryVariable is_binary !when binary variable 4 How to write a model (3) Declarations (variables, arrays, etc.)

declarations UnitCost : array(1..10) of integer end-declarations initializations from “Filename” UnitCost; end-initializations 5 How to write a model (4) Data input – optional section

Cost:=2*x1+3*x2 !...constraints minimize(Cost) !you don’t need to declare Cost or Profit:=2*x1+3*x2 !...constraints miximize(Profit) !you don’t need to declare Profit 6 How to write a model (5) Objective function

! simple constraint X1+3*X2-5*X3<=8 ! multiple constraints using loop forall(i in 1..10) Z(i)=1 ! sum constraint sum(i in 1..10) X(i)<=B ! multiple sum constraints using loop forall(i in 1..5) sum (j in 1..10) X(i,j)=1 7 How to write a model (6) Constraints

! Value of objective function - getobjval writeln(“Objective value: “, getobjval) ! Value of decision variable writeln(“X1 = “,getsol(X1)) ! Values of decision variables in array using loop forall(i in 1..M) writeln(" Y(“, i,") = “, getsol(Y(i))) 8 How to write a model (7) Output & results