Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

AMPL Lab Exercise: Solving Optimization Problems using AMPL and CPLEX, MINOS, lpsolve - Pr, Lab Reports of Mathematics

A lab exercise for ma 416 students to familiarize themselves with the ampl modeling language and its compatible solvers, cplex, minos, and lpsolve. Students are required to download the software, read the ampl book, and use ampl to solve various optimization problems. The document also includes instructions for modifying the given .mod file and creating new ones for different farmer problems.

Typology: Lab Reports

Pre 2010

Uploaded on 10/01/2009

koofers-user-cla
koofers-user-cla 🇺🇸

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download AMPL Lab Exercise: Solving Optimization Problems using AMPL and CPLEX, MINOS, lpsolve - Pr and more Lab Reports Mathematics in PDF only on Docsity! Name: Lab 1 MA 416 1. Go to the AMPL web site (http://www.ampl.com/). 2. Download the Student Edition of AMPL and the following solvers: CPLEX, MINOS, and lpsolve. (These three solvers come with the student edition of AMPL for Windows. If you are using a Mac or a Linux machine, you will not be able to download CPLEX.) 3. Read pages 1–6 in Chapter 1 of the AMPL book, AMPL: A Modeling Language for Mathematical Programming. 4. Use AMPL to solve the LP described on page 5 of the AMPL book. Type the program exactly as it appears in the book. Be sure to include spaces. The solution to the program should include both the optimal solution and the optimal objective function value. The display command shown on page 5 of the AMPL book will help you to find the optimal solution. The solve command shown on page 5 will help you find the optimal objective function value. 5. Modify the file prod0.mod so that you can answer the following questions. (a) Is it necessary to include spaces between variables and *’s in the AMPL .mod file? (b) Is it necessary to include spaces between numbers and *’s in the AMPL .mod file? (c) Can “max” be substituted for “maximize” in the AMPL .mod file? (d) Is it necessary to name each constraint in the AMPL .mod file? 6. Make an AMPL model file, farmer1.mod, that can be used to solve the Farmer Problem - Version 1. Use AMPL to solve this problem. Find both the optimal solution and the optimal objective function value. 7. Make an AMPL model file, farmer2.mod, that can be used to solve the Farmer Problem - Version 2. Use AMPL to solve this problem. Find both the optimal solution and the optimal objective function value. 8. Make an AMPL model file, farmer3.mod, that can be used to solve the Farmer Problem - Version 3. Use AMPL to solve this problem. Find both the optimal solution and the optimal objective function value. 9. The Lab Report. (a) Type your answers to the following questions. i. Is it necessary to include spaces between variables and “*”’s in the AMPL .mod file? How did you modify prod0.mod to check this? 1
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved