Questions tagged [ampl]

AMPL is an algebraic modeling language for mathematical optimization. It supports a wide range of problems such as linear, quadratic and nonlinear problems in continuous and discrete variables and is connected to most solvers.

AMPL, an acronym for A Mathematical Programming Language, is an algebraic modeling language for describing and solving high-complexity problems for large-scale mathematical computation (i.e. large-scale optimization and scheduling-type problems). It was developed by Robert Fourer, David Gay and Brian Kernighan at Bell Laboratories. AMPL supports dozens of solvers, both open source and commercial, including CBC, CPLEX, FortMP, Gurobi, MINOS, IPOPT, SNOPT and KNITRO.

More on AMPL

AMPL home page

AMPL on Wikipedia

414 questions
0
votes
1 answer

GLPK: set expression following default must have dimension 2 rather than 1

I have an AMPL model file that I'm working to convert to GLPK. It begins: param n; # The number of nodes in the graph set V := {1 .. n}; # The set of vertices in the graph set E within V cross V; # The set of edges in the graph set NE within…
Arya McCarthy
  • 8,554
  • 4
  • 34
  • 56
0
votes
1 answer

Get length from item set

I have a set of Data in this format # Input Data for items in the format (i,l,w,h) i for item, l for length , w for width, h for height set itemData := 271440 290 214 361 1504858 394 194 114 4003733 400 200 287 4012512 396 277 250 4013886 273 221…
SunRay
  • 200
  • 14
0
votes
1 answer

ampl vs gams MINLP portfolio optimization syntax

I am looking for a MINLP optimizer to solve portfolio optimisation problem which minimizes x'.S.x where x is a vector S is a given matrix. There are integer constraints which x elements depend on ex; x[i] = g[i].K[i] where g[i] is an integer and…
adam
  • 655
  • 1
  • 10
  • 31
0
votes
1 answer

How to convert to data frame

I have a data file that is a result of ampl. the file looks like this x [*,*] : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 := 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 …
Dinesh.hmn
  • 713
  • 7
  • 21
0
votes
0 answers

Data Center Optimalization in AMPL

I have such task: Given are: set of nodes N (each with its power consumption) set of data servers D ⊂ N (each with available storage), set of computation servers C ⊂ N (each with available computational power), set of edges (each with its capacity),…
lechniak
  • 87
  • 2
  • 5
0
votes
0 answers

AMPL: Constraint optimization not planning over time as expected in LP Solver

I'm trying to build a constraint optimization model using the LP solver with AMPL(.mod) as the language. The context is a factory that receives several orders that then go through several machines (operations) in the production process. The…
0
votes
1 answer

AMPL optimization - different cable types

My and my friends are working on an AMPL project. The goal of the project is to maximize profit in a fiber-to-the-home network. Network works without routers or splitters, only nodes with cabinets where one cable with x fibers can be split into…
terielon
  • 1
  • 1
0
votes
1 answer

Hooking AMPL with Matlab using amplfunc and spamfunc

I'm interested in hooking up AMPL with Matlab to obtain objective values, gradients, and Jacobians to test ideas for optimization algorithms on a wide set of problems. I'm aware that I can use amplfunc.mex or spamfunc.mex to do this; however, I'm…
0
votes
2 answers

how to convert cplex *.mod file to glpk *.mod file on command line?

I want to convert cplex .mod and .dat file to glpk .mod and .dat (separate model and data files) using any open source solver, and then compile the model with different data files with preferably glpsol. As far as I know, glpsol does not provide a…
tina_rzvn
  • 21
  • 1
0
votes
1 answer

Print something completely different when the LP is infeasible in MathProg

I’m using MathProg (a language specific to the GLPK library, resembling a subset of AMPL) to find topological ranking of vertices of a graph. It’s an assignment for my linear programming class. It’s an introductory exercise to make sure we can…
Palec
  • 12,743
  • 8
  • 69
  • 138
0
votes
1 answer

Declaration of ordered pairs sets in AMPL

I have a variable u[i,j,p] where i and j are ordered sets. Specifically I have defined the variable and the sets like set I; set J; set P; set LINKS within {I,J}; param u{LINKS,P} in the .mod file. In my .dat I've written: set I := 1 2 3…
Cenderze
  • 1,202
  • 5
  • 33
  • 56
0
votes
1 answer

Syntax error with AMPL

I get syntax error while running this script in AMPL. Can someone help me to solve this? param K; param N; param PT; param beta_lower{1..K}; param beta_upper{1..K}; set KSET := {1 . . K}; set NSET := {1 . . N}; param Channel {KSET,NSET}; var V var…
0
votes
2 answers

CPLEX Optimization Studio

I am starting to work with CPLEX Optimization Studio, and I am wondering if there are any quick start guides, hello world examples, etc. Some things I would like to be able to do include loading and running a simple LP or ILP through the…
0
votes
1 answer

Setting an initial in solution in MathProg

I am using the MathProg language and GLPK to solve MIP's. If I have a "good" heuristic integer solution, is there a way to set the initial solution in the MathProg language (and be solved by GLPK)? This is a great feature in CPLEX that can greatly…
rirwin
  • 199
  • 2
  • 4
-1
votes
1 answer

How Can I Solve Syntax and Declaration Erros in my AMPL Code?

I'm new to developing code in AMPL. I started studying some tutorials and I'm trying to solve some exercises available on the internet. I tried to develop a code for the problem shown at the end of this video link:…
Thiago
  • 9
1 2 3
27
28