The document describes the LINGO modeling language and how it can be used to formulate linear programming, integer programming, and nonlinear programming optimization problems. LINGO uses sets to describe repetitive structures in optimization problems, allowing large problems to be formulated efficiently. Key features include the @SUM and @FOR functions, which allow applying operations over entire sets with single statements. LINGO can also import and export data to and from spreadsheets using the @OLE function, avoiding retyping large data sets. An example problem demonstrates how to formulate a production mix model in LINGO to maximize profit subject to machine capacity constraints.
This document discusses Excel macros level 1 and covers several topics:
- Built-in VBA functions and statements including MsgBox, InputBox, string functions, and error handling functions
- Parameters for common functions like MsgBox, InputBox, and units conversion functions
- Syntax examples for functions like IIf, Switch, and error handling statements like On Error Resume Next
- Activities that instruct students to practice using various functions in their own macros.
This document introduces some useful functions in Microsoft Excel 2003. It discusses counting functions like COUNT, COUNTA, COUNTBLANK and COUNTIF that count the number of cells meeting certain criteria. Logical functions like IF, AND, OR and NOT are also covered. IF allows alternative results depending on a condition, AND checks if multiple criteria are true, OR checks if any criteria are true, and NOT changes true to false and vice versa. COUNTIF works similarly to IF but counts cells meeting the criteria. SUMIF adds up cells that meet provided criteria. Examples are provided to demonstrate how to use these functions to analyze data in a spreadsheet.
The document describes the development of a ladder logic program for a bottle line simulation using LogixPro software. It includes descriptions of the bottle line simulation process, inputs and outputs, conveyors, gates and sensors. The summary provides an overview of the key elements:
The document outlines the design of a ladder logic program to control a bottle line simulation involving checking, filling, separating and packaging bottles based on sensor inputs. It describes the LogixPro software used to create the ladder logic and emulate the PLC. The ladder logic is designed to track bottle properties using bit-shifting instructions, operate conveyors and gates based on sensor states, count bottles and boxes, and display production counts. The logic is meant to start and
The document discusses the development of a software program to solve linear programming problems using Visual Studio 2005. It provides background on linear programming and describes the objectives of the study. The research methodology section outlines the tools used in the Visual Basic program, including textboxes, comboboxes, buttons, and listboxes. It also describes the program design strategy of planning, interface, and coding stages. The results and discussion section shows the correct input of sample problems and the optimal outputs generated by the program. In summary, the document outlines the creation of a software to solve linear programming problems through visual programming interfaces and algorithms.
This document provides an overview of the finite element analysis (FEA) software ANSYS. It discusses the different modules and capabilities within ANSYS including structural, thermal, fluid, and electromagnetic analysis. It also describes steps for creating and analyzing models within ANSYS such as creating geometry, meshing, applying loads and boundary conditions, and solving models. Key ANSYS terminology is defined throughout related to these modeling and analysis procedures.
This document discusses Excel formulas and functions for summarizing and analyzing data. It covers:
1) The AutoSum feature which allows users to quickly add, average, count or find other values for selected cells with one click.
2) IF statements which enable conditional logic - testing if a condition is met and returning one value if true and another if false. Nested IF statements allow for multiple conditions.
3) Logical operators like >, <, = that are used to define conditions in IF statements by comparing cell values.
4) Examples of IF statements that return numbers, text, or formulas depending on conditional tests being met.
This document discusses data transformation in SPSS. It describes how to compute new variables using arithmetic, logical, and conditional expressions. It also explains how to recode the values of existing variables into new variables or categories using the recode command. Examples are provided to illustrate computing total scores, averages, increments with conditions, and recoding years of schooling into educational status categories.
program for conditional statements
to perform matrices (addition & multiplication)
demonstration of programs for array function
to perform mail merge
use of excel by basic excel formulas
This document discusses Excel macros level 1 and covers several topics:
- Built-in VBA functions and statements including MsgBox, InputBox, string functions, and error handling functions
- Parameters for common functions like MsgBox, InputBox, and units conversion functions
- Syntax examples for functions like IIf, Switch, and error handling statements like On Error Resume Next
- Activities that instruct students to practice using various functions in their own macros.
This document introduces some useful functions in Microsoft Excel 2003. It discusses counting functions like COUNT, COUNTA, COUNTBLANK and COUNTIF that count the number of cells meeting certain criteria. Logical functions like IF, AND, OR and NOT are also covered. IF allows alternative results depending on a condition, AND checks if multiple criteria are true, OR checks if any criteria are true, and NOT changes true to false and vice versa. COUNTIF works similarly to IF but counts cells meeting the criteria. SUMIF adds up cells that meet provided criteria. Examples are provided to demonstrate how to use these functions to analyze data in a spreadsheet.
The document describes the development of a ladder logic program for a bottle line simulation using LogixPro software. It includes descriptions of the bottle line simulation process, inputs and outputs, conveyors, gates and sensors. The summary provides an overview of the key elements:
The document outlines the design of a ladder logic program to control a bottle line simulation involving checking, filling, separating and packaging bottles based on sensor inputs. It describes the LogixPro software used to create the ladder logic and emulate the PLC. The ladder logic is designed to track bottle properties using bit-shifting instructions, operate conveyors and gates based on sensor states, count bottles and boxes, and display production counts. The logic is meant to start and
The document discusses the development of a software program to solve linear programming problems using Visual Studio 2005. It provides background on linear programming and describes the objectives of the study. The research methodology section outlines the tools used in the Visual Basic program, including textboxes, comboboxes, buttons, and listboxes. It also describes the program design strategy of planning, interface, and coding stages. The results and discussion section shows the correct input of sample problems and the optimal outputs generated by the program. In summary, the document outlines the creation of a software to solve linear programming problems through visual programming interfaces and algorithms.
This document provides an overview of the finite element analysis (FEA) software ANSYS. It discusses the different modules and capabilities within ANSYS including structural, thermal, fluid, and electromagnetic analysis. It also describes steps for creating and analyzing models within ANSYS such as creating geometry, meshing, applying loads and boundary conditions, and solving models. Key ANSYS terminology is defined throughout related to these modeling and analysis procedures.
This document discusses Excel formulas and functions for summarizing and analyzing data. It covers:
1) The AutoSum feature which allows users to quickly add, average, count or find other values for selected cells with one click.
2) IF statements which enable conditional logic - testing if a condition is met and returning one value if true and another if false. Nested IF statements allow for multiple conditions.
3) Logical operators like >, <, = that are used to define conditions in IF statements by comparing cell values.
4) Examples of IF statements that return numbers, text, or formulas depending on conditional tests being met.
This document discusses data transformation in SPSS. It describes how to compute new variables using arithmetic, logical, and conditional expressions. It also explains how to recode the values of existing variables into new variables or categories using the recode command. Examples are provided to illustrate computing total scores, averages, increments with conditions, and recoding years of schooling into educational status categories.
program for conditional statements
to perform matrices (addition & multiplication)
demonstration of programs for array function
to perform mail merge
use of excel by basic excel formulas
Maruti Suzuki Stingray Car Specification by DD MotorsDD Motors
Check out the all new Maruti Suzuki Stingray specifications with latest trends, design and comfort for the customers. For more information: http://www.ddmotors.in/car-models/maruti-suzuki-stingray.php
EXPERIENCES DU PORT AUTONOME DE CONAKRY ET PERSPECTIVESAGPAOC- PMAWCA
13ème Table Ronde de l’Association de Gestion des Ports de l’Afrique de l’Ouest et du Centre – du 29 Juin au 02 Juillet 2015 – Abidjan
Présenté par la Direction Générale du Port Autonome de Conakry
Maruti suzuki eeco specifications by dd motorsDD Motors
Check out the all new Maruti Suzuki Eeco specifications with latest trends, design and comfort for the customers. For more information: http://www.ddmotors.in/car-models/maruti-suzuki-eeco.php
El documento describe los conceptos básicos de la informática como el proceso de datos, las computadoras, los lenguajes de programación y la jerarquía de computadoras. Explica que la informática permite el tratamiento automático y racional de la información a través de la recolección, depuración, almacenamiento y distribución de datos, y que las computadoras pueden procesar datos a gran velocidad para obtener resultados en tareas repetitivas, distribuidas geográficamente o que requieren cálculos complejos. Finalmente, distingue entre el
El documento describe los conceptos básicos de la informática como el proceso de datos, las computadoras, los lenguajes de programación y la jerarquía de computadoras. Explica que la informática permite el tratamiento automático y racional de la información a través de la recolección, depuración, almacenamiento y distribución de datos, y la realización de operaciones lógicas y aritméticas. Finalmente, distingue entre el hardware (elementos técnicos de una computadora) y el software (programas y datos).
La Unión Europea ha acordado un embargo petrolero contra Rusia en respuesta a la invasión de Ucrania. El embargo prohibirá las importaciones marítimas de petróleo ruso a la UE y pondrá fin a las entregas a través de oleoductos dentro de seis meses. Esta medida forma parte de un sexto paquete de sanciones de la UE destinadas a aumentar la presión económica sobre Moscú y privar al Kremlin de fondos para financiar su guerra.
Glammories Physical Setup Company ProfileLee Ching Yeo
Glammories provides event planning and equipment rental services. They specialize in corporate events, weddings, birthdays, and more. Their services include scheduling, budgeting, creative ideas, production coordination, and equipment rental. They have an experienced team led by founders Lee and Kelly. The company rents equipment like tents, lighting, furniture and more. They also offer unique setup options like igloos, bubble huts and decorated platforms. Glammories aims to be a one-stop solution for event planning through quality service and competitive rates.
This thesis develops a neural network model to predict required lead times for different stock keeping units (SKUs) at a global retailer. Traditional SKU segmentation based on attributes like volume and demand did not work for this company due to a dynamic product mix and suppliers. The model identifies SKU attributes from purchase order data that indicate supply chain speed needed. It predicts lead times to segment SKUs into categories for faster, standard, or slower supply chains to better meet demand and reduce costs. Testing showed the model improved on-time performance from 36% to 60% over using a single supply chain approach.
Maruti Suzuki Swift Features by DD MotorsDD Motors
Check out the all new Maruti Suzuki Swift features with latest trends, design and comfort for the customers. For more information: http://www.ddmotors.in/car-models/maruti-suzuki-swift.php
Este documento resume las ideas principales del libro "El árbol del conocimiento" de Humberto Maturana y Francisco Varela sobre las bases biológicas del conocimiento humano. Propone que el entendimiento no es una representación del mundo exterior, sino la continua creación de un mundo a través del proceso de vida. Examina cómo la estructura biológica de los seres vivos determina su experiencia cognoscitiva y cómo la organización autopoiética es fundamental para entender el conocer. Finalmente, explora cómo la evolución y la deriva natural han dado
El documento presenta diferentes tecnologías educativas actuales como una tablet, notebook, pendrive, celular, proyector, computadora, pizarra digital y tarjeta de memoria, con sus respectivas especificaciones técnicas y precios.
Tool Chest is an app that contains several useful tools in one location, acting as the "Swiss army knife of apps". It includes a lap timer to track times for running, a flashlight, MAC address grabber, and calculator. The lap timer allows users to easily track current and previous lap times. The flashlight allows users to turn on their phone's light with one button. The MAC address grabber allows users to easily find the identification number of their device. The calculator allows for basic arithmetic calculations on the go. The conclusion states that Tool Chest saves users time by housing many useful tools together rather than having to search between multiple apps.
During the construction of a project, the author learned several new technologies including:
1) How to create flickering text effects in After Effects by layering movement over text.
2) Advanced skills in After Effects like video adjustment layers to simulate night footage.
3) Designing graphics and logos in Photoshop using color splitting modifiers.
4) Modifying sound clips to suit timing and create the right effects for viewers.
This document provides a tutorial on using LINGO 8.0 software to build and solve optimization models. It introduces key concepts like the objective function, variables, and constraints that make up a LINGO model. It also explains how to create a LINGO model, solve it to obtain optimal solutions, use sets to group related variables, and define data values in the LINGO data section. The tutorial concludes with examples of common operations and functions in LINGO like looping constructs, arithmetic operations, and error handling.
The document discusses basic functions in Excel 2007 such as SUM, AVERAGE, and COUNT. It explains that functions save time by performing calculations using predefined formulas. The syntax for functions includes the equal sign followed by the function name and arguments in parentheses. Arguments can be single cells or cell ranges. The document provides examples of using the SUM and AVERAGE functions to calculate totals and averages of multiple cells. It also lists some common statistical, financial, and date/time functions and how to insert functions using the Insert Function dialog box.
This document introduces a linear programming problem involving the production of two new products, Product 1 and Product 2, at the Wyndor Glass Co. The objective is to determine the production rates of each product that will maximize total weekly profit, subject to the limited production capacities of Plants 1-3. Plant 1 can produce 4 batches of Product 1 per week, Plant 2 can produce 6 batches of Product 2 per week, and Plant 3 has capacity for 18 total hours across Products 1 and 2. The mathematical model aims to maximize profit (Z) which is defined as 3x1 + 5x2, where x1 and x2 are the decision variables representing the production rates of each product, subject to the plant capacity constraints.
This document provides an overview of Visual Basic 6.0 and how to create a basic application. It outlines the objectives of learning Visual Basic and describes key concepts like the event-driven nature of VB applications. The document explains the structure of a VB project, including forms, controls, properties, methods and events. It also demonstrates how to set control properties, write code, declare variables, and use common functions and operators. Finally, it provides examples for creating a stopwatch timer application and a basic text editor application in VB.
Maruti Suzuki Stingray Car Specification by DD MotorsDD Motors
Check out the all new Maruti Suzuki Stingray specifications with latest trends, design and comfort for the customers. For more information: http://www.ddmotors.in/car-models/maruti-suzuki-stingray.php
EXPERIENCES DU PORT AUTONOME DE CONAKRY ET PERSPECTIVESAGPAOC- PMAWCA
13ème Table Ronde de l’Association de Gestion des Ports de l’Afrique de l’Ouest et du Centre – du 29 Juin au 02 Juillet 2015 – Abidjan
Présenté par la Direction Générale du Port Autonome de Conakry
Maruti suzuki eeco specifications by dd motorsDD Motors
Check out the all new Maruti Suzuki Eeco specifications with latest trends, design and comfort for the customers. For more information: http://www.ddmotors.in/car-models/maruti-suzuki-eeco.php
El documento describe los conceptos básicos de la informática como el proceso de datos, las computadoras, los lenguajes de programación y la jerarquía de computadoras. Explica que la informática permite el tratamiento automático y racional de la información a través de la recolección, depuración, almacenamiento y distribución de datos, y que las computadoras pueden procesar datos a gran velocidad para obtener resultados en tareas repetitivas, distribuidas geográficamente o que requieren cálculos complejos. Finalmente, distingue entre el
El documento describe los conceptos básicos de la informática como el proceso de datos, las computadoras, los lenguajes de programación y la jerarquía de computadoras. Explica que la informática permite el tratamiento automático y racional de la información a través de la recolección, depuración, almacenamiento y distribución de datos, y la realización de operaciones lógicas y aritméticas. Finalmente, distingue entre el hardware (elementos técnicos de una computadora) y el software (programas y datos).
La Unión Europea ha acordado un embargo petrolero contra Rusia en respuesta a la invasión de Ucrania. El embargo prohibirá las importaciones marítimas de petróleo ruso a la UE y pondrá fin a las entregas a través de oleoductos dentro de seis meses. Esta medida forma parte de un sexto paquete de sanciones de la UE destinadas a aumentar la presión económica sobre Moscú y privar al Kremlin de fondos para financiar su guerra.
Glammories Physical Setup Company ProfileLee Ching Yeo
Glammories provides event planning and equipment rental services. They specialize in corporate events, weddings, birthdays, and more. Their services include scheduling, budgeting, creative ideas, production coordination, and equipment rental. They have an experienced team led by founders Lee and Kelly. The company rents equipment like tents, lighting, furniture and more. They also offer unique setup options like igloos, bubble huts and decorated platforms. Glammories aims to be a one-stop solution for event planning through quality service and competitive rates.
This thesis develops a neural network model to predict required lead times for different stock keeping units (SKUs) at a global retailer. Traditional SKU segmentation based on attributes like volume and demand did not work for this company due to a dynamic product mix and suppliers. The model identifies SKU attributes from purchase order data that indicate supply chain speed needed. It predicts lead times to segment SKUs into categories for faster, standard, or slower supply chains to better meet demand and reduce costs. Testing showed the model improved on-time performance from 36% to 60% over using a single supply chain approach.
Maruti Suzuki Swift Features by DD MotorsDD Motors
Check out the all new Maruti Suzuki Swift features with latest trends, design and comfort for the customers. For more information: http://www.ddmotors.in/car-models/maruti-suzuki-swift.php
Este documento resume las ideas principales del libro "El árbol del conocimiento" de Humberto Maturana y Francisco Varela sobre las bases biológicas del conocimiento humano. Propone que el entendimiento no es una representación del mundo exterior, sino la continua creación de un mundo a través del proceso de vida. Examina cómo la estructura biológica de los seres vivos determina su experiencia cognoscitiva y cómo la organización autopoiética es fundamental para entender el conocer. Finalmente, explora cómo la evolución y la deriva natural han dado
El documento presenta diferentes tecnologías educativas actuales como una tablet, notebook, pendrive, celular, proyector, computadora, pizarra digital y tarjeta de memoria, con sus respectivas especificaciones técnicas y precios.
Tool Chest is an app that contains several useful tools in one location, acting as the "Swiss army knife of apps". It includes a lap timer to track times for running, a flashlight, MAC address grabber, and calculator. The lap timer allows users to easily track current and previous lap times. The flashlight allows users to turn on their phone's light with one button. The MAC address grabber allows users to easily find the identification number of their device. The calculator allows for basic arithmetic calculations on the go. The conclusion states that Tool Chest saves users time by housing many useful tools together rather than having to search between multiple apps.
During the construction of a project, the author learned several new technologies including:
1) How to create flickering text effects in After Effects by layering movement over text.
2) Advanced skills in After Effects like video adjustment layers to simulate night footage.
3) Designing graphics and logos in Photoshop using color splitting modifiers.
4) Modifying sound clips to suit timing and create the right effects for viewers.
This document provides a tutorial on using LINGO 8.0 software to build and solve optimization models. It introduces key concepts like the objective function, variables, and constraints that make up a LINGO model. It also explains how to create a LINGO model, solve it to obtain optimal solutions, use sets to group related variables, and define data values in the LINGO data section. The tutorial concludes with examples of common operations and functions in LINGO like looping constructs, arithmetic operations, and error handling.
The document discusses basic functions in Excel 2007 such as SUM, AVERAGE, and COUNT. It explains that functions save time by performing calculations using predefined formulas. The syntax for functions includes the equal sign followed by the function name and arguments in parentheses. Arguments can be single cells or cell ranges. The document provides examples of using the SUM and AVERAGE functions to calculate totals and averages of multiple cells. It also lists some common statistical, financial, and date/time functions and how to insert functions using the Insert Function dialog box.
This document introduces a linear programming problem involving the production of two new products, Product 1 and Product 2, at the Wyndor Glass Co. The objective is to determine the production rates of each product that will maximize total weekly profit, subject to the limited production capacities of Plants 1-3. Plant 1 can produce 4 batches of Product 1 per week, Plant 2 can produce 6 batches of Product 2 per week, and Plant 3 has capacity for 18 total hours across Products 1 and 2. The mathematical model aims to maximize profit (Z) which is defined as 3x1 + 5x2, where x1 and x2 are the decision variables representing the production rates of each product, subject to the plant capacity constraints.
This document provides an overview of Visual Basic 6.0 and how to create a basic application. It outlines the objectives of learning Visual Basic and describes key concepts like the event-driven nature of VB applications. The document explains the structure of a VB project, including forms, controls, properties, methods and events. It also demonstrates how to set control properties, write code, declare variables, and use common functions and operators. Finally, it provides examples for creating a stopwatch timer application and a basic text editor application in VB.
This document provides practice problems for Chapters 4 and 5 of a Programming in C session. Chapter 4 problems involve modifying string programs to take user input and compare string length and equality. Chapter 5 problems involve modifying a data analysis program to display sales data in different formats (%s, %p, %i) based on user run commands, with help messages for invalid commands. Functions for the required calculations are stored in a separate func.c file.
265 ge8151 problem solving and python programming - 2 marks with answersvithyanila
The document provides sample questions and answers related to problem solving and Python programming. It includes 20 multiple choice questions covering topics like algorithms, pseudo code, flowcharts, recursion, and more. An algorithm is provided to find the minimum of 3 numbers in a list. The key building blocks of an algorithm are also defined as statements, sequence, selection, repetition, and functions.
The document provides an overview of the Blocos programming environment, which allows users to program using visual blocks instead of text code. Blocos translates the blocks into Cricket Logo code, compiles it, and sends it to a controller board to execute. It supports various controller boards and can run on Windows, Linux, and Mac OS. The main window interface is described, including the blocks pane, program pane, and other areas. Command references are provided for various block types like control blocks, flow blocks, test condition blocks, and others.
This document provides a tutorial on how to build a simple graphical user interface (GUI) calculator application using the NetBeans IDE. It explains how to create a project, build the front end by adding labels, text fields and buttons to a JFrame container, and add functionality by writing event handlers for the buttons. The finished application allows the user to enter two numbers, click an "Add" button to calculate the sum, and view the result in a text field. It also includes buttons to clear the fields and exit the program.
This document provides an overview of the history and development of the Visual Basic programming language. It discusses how Visual Basic originated from the BASIC language in the 1960s and was later adapted for microcomputers by Bill Gates and Paul Allen in the 1970s. Every version of Basic since has been based on their early work. Visual Basic was then introduced by Microsoft in 1991 and continued to be updated with new features and capabilities in subsequent versions like Visual Basic 3.0, 4.0, 5.0 and 6.0. The document also defines some key Visual Basic concepts and terms.
Tagless Final Encoding - Algebras and Interpreters and also ProgramsPhilip Schwarz
Tagless Final Encoding - Algebras and Interpreters and also Programs - An introduction, through the work of Gabriel Volpe.
Slide deck home: http://fpilluminated.com/assets/tagless-final-encoding-algebras-interpreters-and-programs.html
Functions are predefined formulas that perform calculations using specific values. Excel has hundreds of functions that can save time by performing calculations automatically. Common functions include SUM to add values, AVERAGE to calculate the mean of values, and COUNT to count the number of cells meeting criteria. Each function has a specific syntax that must be followed, with the function name first followed by arguments in parentheses. Functions make building complex formulas faster and easier.
The document provides steps for using the debugger and profiler in NetBeans 6.0. [1] It describes setting breakpoints, stepping through code, and viewing variables to debug a simple program. [2] It then demonstrates profiling the same program to monitor execution time and memory usage. [3] Adding a line of code that creates Date objects without disposing of them showed how this could lead to memory leak issues.
First of all, I like you to notice that I have set Starting WIP .docxvoversbyobersby
First of all, I like you to notice that I have set "Starting WIP" = 4, "mean daily production rate" = 3.5 units per day, and "Maximum Variation around mean" = 2.5 units on all operations in what we call a "Base Model" representing the game played for 20 days (i.e., 4 weeks, 5 days a week). The base model also assumes monthly demand of 70 units (3.5x20days, 4 weeks, 5 days a week). Next, I want you to note the most important feature of this model i.e., it reports results for a single user like you (we call it "1Run") as well as results averaged over 1,000 runs (as if a class of 1,000 students' results are averaged). Now,
1. Click "F9" key few times and observe Average Efficiencies in Panels C and D. Do you see a pattern in the Average Efficiencies of the various operations in Panel C? and D? Describe the pattern you see. In your opinion what causes this pattern?
2. Click "F9" key few times and observe how the measures in Panel E change for “One Run” and “1,000 Runs”. Explain the difference in the way the two sets of numbers change.
3. Finally, Copy and “Paste Special” (using the “values” option) your results from Panel E for “1000 Runs” in the “Base Model” column cells E6 through E18 in the "Scenario Output" worksheet in the Excel model. Explain how your "Base Model" results might be generalized for a more complex production system where parts flow from machine to machine in a wide variety of patterns or routings.
4
From: Dr. Mahesh Gupta Student ID: __________________
To: 401 Online Students (Do not print your name anywhere)
Subject: Managing a Business - An Excel-Based Dice Game
Purpose: The purpose of this fun and interactive game is to sharpen your understanding of core Operations Management and Theory of Constraints concepts using an Excel-based variant of The Dice Game which Alex played with the boy scouts in Chapter 13 of The Goal.
Story Line: A very close friend of yours, Mr. Herbie, had a great idea and developed a very successful product while pursuing his undergraduate degree in engineering school. Following an advice from engineering school, Herbie decided to open a company, The XYZ Company and made an investment of $50,000 in a production system consisting of 5 processes. His initial thinking was that he will run a single shift operation – 5 days per week, 4 weeks a month i.e., 20 days per month. Each process will have mean daily production capacity of 3.5 units, and the production system should be able to produce 70 units per month (a very definite market demand estimate). Herbie expected mean daily production of 3.5 units to vary + 2.5 units i.e., ranging between 6 and 1 (similar to the fair roll of a dice) due to various sources of variation e.g., machine break down, bad quality raw material, and worker morale. Because of interdependencies among processes and variation, he expected work-in-progress (WIP) to form in front of each process. (Note: Thus, Mean, Variation and WIP levels at each process can be man ...
This document provides a tutorial on creating a graphical user interface (GUI) in Visual Basic Express to control a Phidget servo controller. It describes installing Visual Basic Express, creating the GUI with labels, a trackbar, and button, writing code to handle events like loading the form, trackbar movement, and Phidget attachment/detachment. The code initializes label texts, sets the trackbar range and value, centers the servo when attached, links the trackbar to change the servo position, and updates labels with status information. The tutorial is intended for beginners to learn how to interface Visual Basic with Phidget hardware.
This document provides an introduction to algorithms and imperative programming in C language. It defines an algorithm as a set of instructions to perform a task and discusses the differences between algorithms and programs. It also describes flowcharts for representing algorithms and discusses various programming elements in C like variables, data types, operators, functions, and comments. The document concludes with an example of a simple "Hello World" C program.
This document provides instructions and content for practice questions from chapters 4 and 5. It describes modifying existing programs to allow user input of strings and reports on string length and comparison. It also describes a method to reduce program size by replacing indentation spaces with numbers and writing a program to perform this compression. Finally, it describes modifications needed for a sales data analysis program to allow command line specification of different report types and includes sample function code.
The document discusses algorithms and their key characteristics. It defines an algorithm as a set of well-defined steps to solve a problem. Algorithms must be precise, terminate in a finite time, and not repeat infinitely. The document provides examples of algorithm problems and their solutions, and discusses common ways to represent algorithms as programs, flowcharts, or pseudocode. Flowcharts use symbols to visually represent the logic and sequence of operations.
This document provides information on tag-based memory structures and naming conventions for tags in ControlLogix projects. It discusses:
- Tag-based memory uses friendly names (tags) to reference memory addresses.
- Tag names should describe the function and follow naming rules.
- Projects have a task-program-routine structure to organize code.
- Tags can be at the program or controller scope. I/O points are referenced using a standard address format.
- Common data types include BOOL, SINT, INT, DINT, and REAL.
This document provides a review of key concepts in Visual Basic 6 including variables, data types, operators, functions, and formatting. It defines variables and data types, explains implicit and explicit variable declaration, and covers the scope of variables. Mathematical, relational, and logical operators are defined. Commonly used functions for strings, dates, numbers and formatting are also described. Hands-on activities are included to apply the concepts.
The document outlines the steps involved in program design and problem solving techniques, including defining the problem, outlining the solution, developing an algorithm using pseudocode, testing the algorithm, coding the algorithm, running and documenting the program. It also discusses algorithmic problem solving, the structure theorem, meaningful naming conventions, communication between modules through variables and parameters, module cohesion and coupling, and sequential file updates.
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...NelTorrente
In this research, it concludes that while the readiness of teachers in Caloocan City to implement the MATATAG Curriculum is generally positive, targeted efforts in professional development, resource distribution, support networks, and comprehensive preparation can address the existing gaps and ensure successful curriculum implementation.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
Thinking of getting a dog? Be aware that breeds like Pit Bulls, Rottweilers, and German Shepherds can be loyal and dangerous. Proper training and socialization are crucial to preventing aggressive behaviors. Ensure safety by understanding their needs and always supervising interactions. Stay safe, and enjoy your furry friends!
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
1. 1
SUPPLEMENT 1 TO CHAPTER 3
The LINGO Modeling Language
LINGO is a mathematical modeling language designed particularly for formulating and solving a wide
variety of optimization problems, including linear programming, integer programming (Chap. 11), and
nonlinear programming (Chap. 12) problems.
Simple problems are entered into LINGO in a fairly natural fashion. To illustrate, consider the following
linear programming problem.
Maximize Z = 20x + 31y,
subject to
2x + 5y ≤ 16
4x – 3y = 6
and
x ≥ 0, y ≥ 0.
The screen shot in the top half of Fig. 3S1.1 shows how this problem would be formulated with LINGO.
FIGURE 3S1.1 Screen shots showing the LINGO formulation and the
LINGO solution report for a simple linear programming problem.
2. 2
The first line of this formulation is just a comment describing the model. Note that the comment is
preceded by an exclamation point and ended by a semicolon. This is a requirement for all comments in a
LINGO formulation. The second line gives the objective function (without bothering to include the Z
variable) and indicates that it is to be maximized. Note that each multiplication needs to be indicated by an
asterisk. The objective function is ended by a semicolon, as is each of the functional constraints on the next
two lines. The nonegativity constraints are not shown in this formulation because these constraints are
automatically assumed by LINGO. (If some variable x did not have a nonnegative constraint, you would need
to add @FREE(x); at the end of the formulation.)
Variables can be shown as either lowercase or uppercase, because LINGO is case-insensitive. For
example, a variable x1 can be typed in as either x1 or X1. Similarly, words can be either lowercase or
uppercase (or a combination), for clarity, we will use uppercase for all reserved words that have a predefined
meaning in LINGO.
Notice the menu bar at the top of LINGO window in Fig. 3S1.1. The ‘File’ and ‘Edit’ menu items behave
in a standard Windows fashion. To solve a model once it has been entered, click on the red ‘bullseye’ icon.
(If you are using a platform other than a Windows-based PC, instead type the GO command at the colon
prompt and press the enter key.) Before attempting to solve the model, LINGO will first check whether your
model has any syntax errors and, if so, will indicate where they occur. Assuming no such errors, a solver will
begin solving the problem, during which time a solver status window will appear on the screen. When the
solver finishes, a Solution Report will appear on the screen. Note, you can control whether the solution report
appears automatically or not by clicking on LINGO | Options | Interface | Output Level: | Terse/Verbose.
The bottom half of Fig. 3S1.1 shows the solution report for our example. The Value column gives the
optimal values of the decision variables. The first entry in the Slack or Surplus column shows the
corresponding value of the objective function. The next two entries indicate the difference between the two
sides of the respective constraints. The Reduced Cost and Dual Price columns provide some sensitivity
analysis information for the problem. After discussing postoptimality analysis (including sensitivity analysis)
in Sec 4.7 we will explain what reduced costs and dual prices are while describing LINDO in Appendix 4.1.
These quantities provide only a portion of the useful sensitivity analysis information. To generate a full
sensitivity analysis report (such as shown in Appendix 4.1 for LINDO) the Range command in the LINGO
menu would need to be chosen next.
Just as was illustrated with MPL in Sec 3.6, LINGO is designed mainly for efficiently formulating very
large models by simultaneously dealing with all constraints or variables of the same type. We soon will use
the following example to illustrate how LINGO does this.
Example. Consider a production-mix problem where we are concerned with what mix of four products we
should produce during the upcoming week. For each product, each unit produced requires a known amount of
production time on each of three machines. Each machine has a certain number of hours of production time
available per week. Each product provides a certain profit per unit produced.
Figure 3S1.2 shows three types of data: machine-related data, product-related data, and data related to
combinations of a machine and product. The objective is to determine how much to produce of each product
so that total profit is maximized while not exceeding the limited production capacity of each machine.
3. 3
Figure 3S1.2 Data needed for the product-mix example.
In standard algebraic form, the structure of the linear programming model for this problem is to choose the
nonnegative production levels (number of units produce during the upcoming week) for the four products so
as to
Maximize
4
1
,j j
j
c x
=
∑
subject to
4
1
ij j
j
a x
=
∑ ≤ bi, for i = 1, 2, 3;
where
xj = production level for product P0j,
cj = unit profit for product P0j,
aij = production time on machine i per unit of product P0j,
bi = production time available per week on machine i.
This model is small enough, with just 4 decision variables and 3 functional constraints, that it could be
written out completely, term by term, but it would tedious. In some similar application, there might instead
be hundred of decision variables and functional constraints. So writing out a term-by-term version of this
4. 4
model each week would not be practical. LINGO provides a much more efficient and compact formulation,
comparable to the above summary of the model, as we will see next.
Formulation of the Model in LINGO
This model has a repetitive nature. All the decision variables are of the same type and all the functional
constraints are of the same type. LINGO uses sets to describe this repetitive nature. The simple sets of
interest in this case are
1. The set of machines, {Roll, Cut, Weld}.
2. The set of products, {P01, P02, P03, P04}.
The attributes of interest for the members of these sets are
1. Attribute for each machine: Number of hours of production time available per week.
2. Attributes for each product: Profit per unit produced; Number of units produced per week.
Thus, the first two types of attributes are input data that will become parameters of the model, whereas the
last type (number of units produced per week of the respective products) provides the decision variables for
the model. Let us abbreviate these attributes as follows:
Machine: ProdHoursAvail
Product: Profit, Produce.
One other key type of information is the number of hours of production time that each unit of each product
would use on each of the machines. This number can be viewed as an attribute for the members of the set of
all combinations of a product and a machine. Because this set is derived from the two simple sets, it is
referred to as a derived set. Let us abbreviate the attribute for members of this set as follows.
MaPr( Machine, Product): ProdHoursUsed
A LINGO formulation typically has three sections.
1. A SETS section that specifies the sets and their attributes. You can think of it as describing the structure of
the data.
2. A DATA section that either provides the data to be used or indicates where it is to be obtained.
3. A section that provides the mathematical model itself.
We begin by showing the first two sections for the example below.
! LINGO3h;
! Product mix example;
! Notice: the SETS section says nothing about the number or names of
the machines or products. That information is determined
completely by supplied data;
SETS:
! The simple/primitive sets;
Machine: ProdHoursAvail;
Product: Profit, Produce;
! A derived set;
MaPr( Machine, Product): ProdHoursUsed;
ENDSETS
DATA:
! Get the names of the machines & hours avail;
5. 5
Machine, ProdHoursAvail =
Roll 28
Cut 34
Weld 21;
! Get the names of the products & profits;
Product, Profit =
P01 26
P02 35
P03 25
P04 37;
! Hours needed per unit of product;
ProdHoursUsed = 1.7 2.1 1.4 2.4 ! Roll;
1.1 2.5 1.7 2.6 ! Cut;
1.6 1.3 1.6 0.8; ! Weld;
ENDDATA
Before presenting the mathematical model itself, we need to introduce two key set looping functions that
enable applying an operation to all members of a set by using a single statement. One is the @SUM function,
which computes the sum of an expression over all members of a set. The general form of @SUM is
@SUM( set: expression). For every member of the set, the expression is computed, and then they are
all added up. For example,
@SUM( Product(j): Profit(j)* Product(j))
sums the expression following the colon-the unit profit of a product times the production rate of the product-
over all members of the set preceding the colon. In particular, because this set is the set of products
{Product(j) for j = 1, 2, 3, 4}, the sum is over the index j. Therefore, this specific @SUM function provides
the objective function,
4
1
,j j
j
c x
=
∑
given earlier for the model.
The second key set looping function is the @FOR function. This function is used to generate constraints
over members of a set. The general form is @FOR( set: constraints). For example,
@FOR( Machine(i):
@SUM( Product(j): ProdHoursUsed(i,j)*Produce(j)) <= ProdHoursAvail(i);
says to generate the constraint following the colon for each member of the set preceding the colon. (The “less
than or equal to” symbol, ≤ , is not on the standard keyboard, so LINGO treats the standard keyboard
symbols <= as equivalent to ≤.) This set is the set of machines {Machine(i) for i = 1, 2, 3}, so this function
loops over the index i. For each i, the constraint following the colon was expressed algebraically earlier as
4
1
ij j
j
a x
=
∑ ≤ bi .
Therefore, after the third section of the LINGO formulation (the mathematical model itself) is added, we
obtain the complete formulation shown below:
! LINGO3h;
6. 6
! Product mix example;
! Notice: the SETS section says nothing about the number or names of
the machines or products. That information is determined
completely by supplied data;
SETS:
! The simple/primitive sets;
Machine: ProdHoursAvail;
Product: Profit, Produce;
! A derived set;
MaPr( Machine, Product): ProdHoursUsed;
ENDSETS
DATA:
! Get the names of the machines & hours avail;
Machine, ProdHoursAvail =
Roll 28
Cut 34
Weld 21;
! Get the names of the products & profits;
Product, Profit =
P01 26
P02 35
P03 25
P04 37;
! Hours needed per unit of product;
ProdHoursUsed = 1.7 2.1 1.4 2.4 ! Roll;
1.1 2.5 1.7 2.6 ! Cut;
1.6 1.3 1.6 0.8; ! Weld;
ENDDATA
! Maximize total profit contribution;
MAX = @SUM( Product(i): Profit(i)*Produce(i));
! For each machine i;
@FOR( Machine(i):
! Hours used <= hours available;
@SUM( Product(j): ProdHoursUsed(i,j)*Produce(j))
<= ProdhoursAvail(i);
);
The model is solved by pressing the ‘bullseye’ button on the LINGO command bar. Pressing the ‘x=’ button
on the command bar produces a report that looks in part as follows.
Global optimal solution found.
Objective value: 475.0000
Total solver iterations: 3
Variable Value Reduced Cost
PRODUCE( P01) 0.000000 3.577922
PRODUCE( P02) 10.00000 0.000000
PRODUCE( P03) 5.000000 0.000000
PRODUCE( P04) 0.000000 1.441558
Row Slack or Surplus Dual Price
1 475.0000 1.000000
2 0.000000 15.25974
3 0.5000000 0.000000
4 0.000000 2.272727
7. 7
Thus, we should produce 10 units of product P02 and 5 units of product P03, where Row 1 gives the resulting
total profit of 475. Notice that this solution exactly used the available capacity on the first and third
machines (because Rows 2 and 4 give a Slack or Surplus of 0) and leaves the second machine with 0.5 hour
of idleness. (We will discuss reduced costs and dual prices in Appendix 4.1 in conjunction with LINDO and
LINGO.)
The Rows section of this report is slightly ambiguous in that you need to remember that Row 1 in the
model concerns the objective function and the subsequent rows involve the constraints on machine capacities.
This association can be made more clear in the report by giving names to each constraint in the model. This
is done by enclosing the name in [ ], placed just in front of the constraint. See the following modified
fragment of the model.
[TotProf] MAX = @SUM( Product(i): Profit(i)*Produce(i));
! For each machine i;
@FOR( Machine(i):
! Hours used <= hours available;
[Capc] @SUM( Product(j): ProdHoursUsed(i,j)*Produce(j))
<= ProdhoursAvail(i);
);
The solution report now contains these row names.
Row Slack or Surplus Dual Price
TOTPROF 475.000000 1.000000
CAPC( ROLL) 0.000000 15.259740
CAPC( CUT) 0.500000 0.000000
CAPC( WELD) 0.000000 2.272727
An important feature of a LINGO model like this one is that it is completely “scalable” in products and
machines. In other words, if you want to solve another version of this product-mix problem with a different
number of machines and products, you would only have to enter the new data in the DATA section. You
would not need to change the SETS section or any of the equations. This conversion could be done by
clerical personnel without any understanding of the model equations.
Scalar vs. Set-Based Models
The above is a “set-based” formulation. For simple models, you may be satisfied with a simpler “scalar”
formulation that does not include the SETS “machinery.” In fact, if for the above model you click on
LINGO | Generate | Display model, you will get the following display of the equivalent scalar model.
MODEL:
[_1] MAX= 26 * PRODUCE_P01 + 35 * PRODUCE_P02
+ 25 * PRODUCE_P03 + 37 * PRODUCE_P04 ;
[_2] 1.7 * PRODUCE_P01 + 2.1 * PRODUCE_P02
+ 1.4 * PRODUCE_P03 + 2.4 * PRODUCE_P04 <= 28 ;
[_3] 1.1 * PRODUCE_P01 + 2.5 * PRODUCE_P02
+ 1.7 * PRODUCE_P03 + 2.6 * PRODUCE_P04 <= 34 ;
[_4] 1.6 * PRODUCE_P01 + 1.3 * PRODUCE_P02
+ 1.6 * PRODUCE_P03 + 0.8 * PRODUCE_P04 <= 21 ;
END
You could in fact enter this simple model in the above form.
8. 8
Importing and Exporting Spreadsheet Data with LINGO
The previous SETS-based example was completely self-contained in the sense that all the data were directly
incorporated into the LINGO formulation. In some other applications, a large body of data will be stored in
some source and will need to be entered into the model from that source. One popular place for storing data is
spreadsheets.
LINGO has a simple function, @OLE( ), for retrieving and placing data from and into spreadsheets. To
illustrate, let us suppose the data for our product-mix problem were originally entered into a spreadsheet as
shown in Fig. 3S1.3. For the moment we are interested only in the shaded cells in columns A-B and E-H.
The data in these cells completely describe our little product-mix example. We want to avoid retyping these
data into our LINGO model. The only part of the LINGO model that needs to be changed is the DATA
section as shown below.
DATA:
! Get the names of the machines & hours avail;
Machine, ProdHoursAvail = @OLE( );
! Get the names of the products & profits;
Product, Profit = @OLE( );
! Hours needed per unit of product;
ProdHoursUsed = @OLE( );
! Send the solution values back;
@OLE( ) = Produce;
ENDDATA
The @OLE( ) function acts as your “plumbing contractor.” It lets the data flow from the spreadsheet to
LINGO and back to the spreadsheet. So-called Object Linking and Embedding (OLE) is a feature of the
Windows operation system. LINGO exploits this feature to make a link between the LINGO model and a
spreadsheet. The first three uses of @OLE( ) above illustrate that this function can be used on the right of an
assignment statement to retrieve data from a spreadsheet. The last use above illustrates that this function can
be placed on the left of an assignment statement to place solution results into the spreadsheet instead. Notice
from Fig 3S1.2 that the optimal solution has been placed back into the spreadsheet in cells E6:H6. One
simple but hidden step that had to be done beforehand in the spreadsheet was to define range names for the
various collections of cells containing the data. Range names can be defined in Excel by using the mouse
and the Insert, Name, Define menu item. For example, the set of cells A9:A11 was given the range name of
Machine. Similarly, the set of cells E4:H4 was given the range name Product.
The above example assumes that the appropriate spreadsheet has been opened in Excel and that this is the
only spreadsheet opened. If you want to make sure that the correct spreadsheet is referenced, or you wish to
retrieve data from several spreadsheets, then you may put the file name in the @OLE( ) argument. For
example, to make sure that the ProdHoursUsed data are retrieved from the file “C:Hillier9wbest03i.xls” you
would use the statement:
ProdHoursUsed = @OLE(‘C:Hillier9wbest03i.xls’);
in the DATA section.
9. 9
Figure 3S1.3 Screen shot showing data for the product-mix example entered in a spreadsheet.
The LINGO/spreadsheet connection can be pushed even further, so that the LINGO model is stored on a
“tab” in a spreadsheet. Thus, the user may think of the model as residing completely in the single
spreadsheet. One thus can combine the best features of a spreadsheet and a modeling language. (See LINGO
manuals for details.)
Importing and Exporting from a Database with LINGO
Another common repository for data in a large firm is in a database. In a manner similar to @OLE ( ),
LINGO has a connection function, @ODBC( ), for transferring data from and to a databases. This function is
based around the Open DataBase Connectivity (ODBC) standard for communicating with SQL (Structured
Query Language) databases. Most popular databases, such as Oracle, Paradox, DB/2, MS Access, and SQL
Server, support the ODBC convention.
Let us illustrate the ODBC connection for our little product-mix example. Suppose that all the data
describing our problem are stored in a database called acces03j. The modification required in the LINGO
model is almost trivial. Only the Data section needs to be changed, as illustrated by the following fragment
form the LINGO model.
DATA:
! Get the names of the machines & hours avail;
Machine, ProdHoursAvail = @ODBC( 'acces03j');
! Get the names of the products & profits;
Product, Profit = @ODBC( 'acces03j');
10. 10
! Hours needed per unit of product;
ProdHoursUsed = @OLE( 'acces03j');
! Send the solution values back;
@OLE( 'acces03j') = Produce;
ENDDATA
Notice that, similar to the spreadsheet-based model, the size of the model in terms of the number of variables
and constraints is determined completely by what is found in the database. The LINGO model automatically
adjusts to what is found in the database.
Now let us show what is in the database considered above. It contains three related tables. We give these
tables names to match those in the LINGO model, namely, ‘Machine,’ to hold machine-related data,
‘Product,’ to hold product-related data, and ‘MaPr,’ to hold data related to combinations of machines and
products. Fig. 3S1.4 shows what the tables look like initially on the screen.
Figure 3S1.4 Initial data-base tables for product-mix example.
Notice that the ‘Produce’ column has been initialized to zero in the Product table. Once we solve the model,
the ‘Produce’ amounts get inserted into the database and the Product table looks as in Fig. 3S1.5.
11. 11
Figure 3S1.5 Database tables for product-mix problem after solution.
A complication in using ODBC with Windows is that the user may need to “register” the database with the
“Windows ODBC administrator.” How one does this depends upon the version of Windows. See Windows
documentation for how to do this.
Doing Extra Processing Outside a Model in LINGO
The previous LINGO examples illustrated only how to formulate a single model, solve it and produce a
standard solution report. In practice, you may want to a) do some pre-processing of data to prepare it
for your model, b) do some post-processing of a solution to produce a customized solution report, or c)
solve several models automatically in one “run” as part of some comprehensive study. LINGO includes
a programming capability so that you can do (a), (b), and (c). We describe two additional section types,
CALC and SUBMODEL that you can use in LINGO:
CALC:
! Executable statements, perhaps including an
@SOLVE( ) of some submodel;
ENDCALC
12. 12
SUBMODEL Name:
! Constraints describing a specific model;
ENDSUBMODEL
Statements in a CALC section are treated as executable statements rather than constraints. For example,
the statement:
x = x + 1;
is perfectly valid in a CALC section. It means that the value of x should be increased by 1. If the same
statement appeared as part of a model, it would be interpreted as a constraint and the model would be
declared infeasible. You may also use various input and output statements in a CALC section.
The use of a SUBMODEL section allows you to refer to that particular (sub)model in a CALC section.
Thus, in a CALC section you may solve a specific submodel several times with different data, or solve
several different submodels, perhaps using the results from one submodel as input to another submodel.
The programming capabilities of LINGO are illustrated with the following example. We want to
compute a trade-off curve or efficient frontier of risk vs. expected return for a financial portfolio. Notice
that the CALC section: a) does some pre-processing of input data to convert monthly standard
deviations to yearly standard deviations; b) does some post-processing of solution data and uses the
@WRITE statement to generate a customized solution report, and, c) uses the @SOLVE statement to
repeatedly solve the portfolio submodel. Notice in particular the solution report displayed after the
LINGO program.
MODEL:
!Computing an Efficient Frontier for a Portfolio Model in LINGO;
! Generic Markowitz portfolio model in LINGO;
SETS:
! Each asset has an expected return/yr, a standard deviation
in return/month, a standard deviation/yr to be computed,
and an amount to invest to be determined;
ASSET: ERET, STDM, STDY, X;
! Each pair of assets has a correlation. Only store the lower
triangular part;
TMAT( ASSET, ASSET) | &1 #GE# &2: CORR;
ENDSETS
DATA:
! The initial wealth;
WEALTH = 1;
! The investments available(Vanguard funds);
ASSET = CD___ VG040 VG102 VG058 VG079 VG072 VG533;
! Estimated future return per year;
ERET = .04 .06 .06 .05 .065 .07 .08 ;
! Monthly std dev. in return for each asset,
13. 13
computed from recent monthly data;
STDM= 0 .02341 .02630 .01067 .02916 .03615 .05002;
! Correlation matrix, computed from recent monthly data;
CORR =
!CD___; 1
!VG040; 0 1
!VG102; 0 .98209 1
!VG058; 0 -.24279 -.31701 1
!VG079; 0 .75201 .76143 -.34311 1
!VG072; 0 .49386 .49534 -.24055 .68488 1
!VG533; 0 .77011 .76554 -.18415 .84397 .69629 1;
! Number different returns to evaluate;
NPOINTS = 12;
ENDDATA
!--------------------------------------------------------------;
SUBMODEL HARRY:
! The standard Markowitz portfolio model;
! Minimize the variance in yearly portfolio return;
[OBJ] MIN = RISK;
RISK = (@SUM( ASSET( I): STDY( I)*STDY(I) * X( I)^2) +
2 * @SUM( TMAT( I, J) | I #NE# J:
X( I) * X( J)* CORR( I, J) *( STDY( I) * STDY( J))))^.5 ;
! Budget constraint;
[BUDGET] @SUM( ASSET(i): X(i)) = WEALTH;
! Return requirement;
[RETURN] @SUM( ASSET(i): ERET(i) * X(i)) >= TARGET * WEALTH;
ENDSUBMODEL
CALC:
! Do some pre-processing of the data;
@FOR( ASSET(I):
! Compute yearly std. dev. from monthly;
STDY(I) = STDM(I)*(12^.5);
);
! Find min and max return over possible investments;
RET_MIN = @MIN( ASSET(I): ERET(I));
RET_MAX = @MAX( ASSET(I): ERET(I));
! Print a heading for risk vs. return trade-off report;
@WRITE(@NEWLINE(1),' Efficient Frontier Portfolio Calculation'
,@NEWLINE(1));
@WRITE(' The possible investments: ',@NEWLINE(1),
' CD___= risk-free rate, ',@NEWLINE(1) ,
' VG040= SP500 stock index, ',@NEWLINE(1) ,
' VG058= Insured long term tax exempt, ',@NEWLINE(1),
' VG072= Pacific stock index ',@NEWLINE(1),
' VG079= European Stock index, ',@NEWLINE(1),
' VG102= Tax managed cap appreciation, ',@NEWLINE(1),
' VG533= Emerging markets. ' ,@NEWLINE(2) );
@WRITE(' Target Risk(1 sd) Portfolio composition',
@NEWLINE(1));
@WRITE(' Return 1-Yr ');
14. 14
! Turn off all but error output;
@SET("TERSEO", 2);
! Write out the asset names in one row;
@FOR( ASSET(I):
@WRITE(' ',ASSET(i));
);
@WRITE( @NEWLINE(1));
N1 = NPOINTS-1;
K = 0;
! Loop over different target returns;
@WHILE( K #LT# NPOINTS:
TARGET = RET_MAX*(K/N1) + RET_MIN*((N1-K)/N1);
! Solve the model for this new target return;
@SOLVE( HARRY);
! Write another line in the report;
@WRITE( ' ',@FORMAT( TARGET, '#6.3f'),' ');
@WRITE( @FORMAT( RISK, '#7.4f'),' ');
@FOR( ASSET(I):
! If X is close to 0, print a blank rather than 0.0000;
@IFC( X(i) #GT# .00001:
@WRITE( @FORMAT( X(i), '#7.4f'));
@ELSE
@WRITE(' ');
)
);
@WRITE( @NEWLINE(1));
K = K + 1;
); ! While end;
@WRITE(@NEWLINE(1),' Input data used: ',@NEWLINE(1));
@WRITE(' Expected return/yr:');
@FOR( ASSET(I):
@WRITE( @FORMAT( ERET(i), '#7.4f'));
);
@WRITE( @NEWLINE(1));
@WRITE(' Stdev in return/yr:');
@FOR( ASSET(I):
@WRITE( @FORMAT( STDY(i), '#7.4f'));
);
ENDCALC
END
When we run the above LINGO program, we get the following solution report.
Efficient Frontier Portfolio Calculation
The possible investments:
CD___= risk-free rate,
VG040= SP500 stock index,
VG058= Insured long term tax exempt,
VG072= Pacific stock index
15. 15
VG079= European Stock index,
VG102= Tax managed cap appreciation,
VG533= Emerging markets.
Target Risk(1 sd) Portfolio composition
Return 1-Yr CD___ VG040 VG102 VG058 VG079 VG072 VG533
0.040 0.0000 1.0000
0.044 0.0077 0.7443 0.0062 0.0193 0.1815 0.0301 0.0187
0.047 0.0154 0.4885 0.0124 0.0386 0.3631 0.0601 0.0373
0.051 0.0231 0.2328 0.0186 0.0579 0.5446 0.0902 0.0560
0.055 0.0309 0.0865 0.0174 0.6898 0.1240 0.0823
0.058 0.0452 0.0626 0.5705 0.1165 0.1703 0.0801
0.062 0.0635 0.4966 0.0655 0.2301 0.2078
0.065 0.0831 0.3874 0.2924 0.3202
0.069 0.1035 0.2499 0.3413 0.4088
0.073 0.1244 0.1124 0.3902 0.4975
0.076 0.1457 0.3636 0.6364
0.080 0.1733 1.0000
Input data used:
Expected return/yr: 0.0400 0.0600 0.0600 0.0500 0.0650 0.0700 0.0800
Stdev in return/yr: 0.0000 0.0811 0.0911 0.0370 0.1010 0.1252 0.1733
Notice how as the desired or target return is increased, the allocation of funds shifts from the less risky,
lower return investments on the left, to the more risky, higher return investments on the right.
More about LINGO
Only some of the capabilities of LINGO have been illustrated in this supplement. A summary of some of the
additional capabilities beyond solution of simple linear programming problems is:
1) Scalability of models. The SETS/subscripted variables capability allows you to formulate one model
that can be applied to a small problem today, and by only changing the input data, applied to a huge problem
tomorrow.
2) Interface to outside data sources. The examples in this section illustrate that you can retrieve input and
store output for a model from a variety of data sources: spreadsheets, standard text files, and databases.
3) Ability to formulate and solve relatively arbitrary nonlinear problems.
4) Solve problems with integer variables, with either linear or nonlinear constraints.
5) Solve problems with quadratic constraints with extra efficiency.
6) Find and prove global optimality for complex nonlinear models.
7) Programming capability to allow the solution of several related models in a single run.
8) Support for most mathematical functions one might need to use such as trigonometric functions and
most probability functions such as the Normal and Binomial distributions.
LINGO contains extensive built-in documentation. To get to the User Manual when in LINGO, click on
Help | Help topics | Contents | LINGO Users Manual.
Alternatively you may look up terms in the Index by clicking on
Help | Help topics | Index.
16. 16
LINGO is available in a variety of sizes. The version that is included with this text is limited to a maximum
of 150 functional constraints and 300 decision variables. (When dealing with integer programming problems
in Chap. 11 or nonlinear programming problems in Chap. 12, a maximum, of 30 integer variables or 30
nonlinear variables are allowed. In the case of global optimization problems discussed in Sec 12.10, the total
number of nonlinear decision variables cannot exceed 5.) The largest version (called the Extended version) is
limited only by the computer memory available. On a 64 bit computer, linear programs with millions of
variables and constraints have been solved. LINGO is available for most major operating systems, including
Linux.
If you would like to see how LINGO can formulate a possibly huge model like the production planning
example introduced in Sec. 3.6, see the second supplement for this chapter. By reducing the number of
products, plants, machined and months, the supplement also introduces actual data into the formulation and
then shows the complete solution. The supplement goes on to discuss and illustrate the debugging and
verification of this large model. The supplement also describes further how to retrieve data from external
files (include spreadsheets) and how to insert results in existing files.
In addition to this supplement, the additional material on this website includes both a LINGO tutorial and
LINGO/LINDO files with numerous examples of LINGO formulations. These LINGO/LINDO files for
most other chapters include LINGO formulations for problems that are outside the realm of linear
programming. In addition, Sec. 12.10 discusses a global optimization feature of LINGO for dealing with
complicated nonlinear programming problems. Also see Selected References 3 and 5 for Chap. 3 for further
details on LINGO.