Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
44 views

I'm trying to run an optimization script (*.m file) using the AMPL API for MATLAB, but I encounter the following error: Unable to resolve the name com.ampl.AMPL. This prevents me from using AMPL ...
Jeff Ju's user avatar
  • 23
1 vote
1 answer
52 views

We use Pyomo to exchange data with AMPL-compatable solvers by NL-file (as input) and SOL-file (as output). For some models Pyomo ConcreteModel.write(...) function generates rather big NL-files in text ...
Vladimir VV's user avatar
-4 votes
1 answer
60 views

I am very new to this. I wanted to use EXCEL table data as input for my AMPL optimization code through Google Colab. I wrote the code as below, but it said Syntax Error. I don't know why. Can anyone ...
Mentor Town's user avatar
2 votes
3 answers
154 views

Suppose I have a set of jobs, each needing one mold; changing from mold A to mold B has a cost. I want to search for the job sequence that minimizes the mold change cost. job mold Mold shift cost My ...
Mentor Town's user avatar
2 votes
1 answer
62 views

This is a Python code segment for solving an optimal power flow problem: if self.ini_state: solver.read(self.pb_path[0]) # Problem parameters solver.param['BaseMVA'] = 1 ...
Jeff Ju's user avatar
  • 23
0 votes
0 answers
68 views

I am trying to solve a nonlinear optimization problem in AMPL. It is quite large but not ridiculously so. I solved a similar problem on my home PC (about 1 order of magnitude less in size though). I ...
apg's user avatar
  • 101
0 votes
0 answers
52 views

I have some software (AMPL) installed on my home folder on a Grid Engine based HPC cluster at a university. I'm looking just to source AMPL properly when I run my jobscript in the queue. I need to run ...
apg's user avatar
  • 101
0 votes
2 answers
65 views

# SETS set B; # Candidate central kitchens set S; # Schools set C; # Categories class set K; # Set of commodities set N; # Set of nutrients set Y; # Set of groups set G {Y} within K; # Set of ...
nisanur azizah's user avatar
0 votes
1 answer
93 views

I have a CSV file that has an index (hours) and two parameters (consumption and insolation). I want AMPL to create another index Day that consists of 24 consecutive hours of each parameter date so I ...
Michael Caballero's user avatar
-1 votes
1 answer
84 views

I am learning AMPL for a university project and i don't understand why i'm getting a syntax error, my code: model: set FOODS; param calories; param proteins; param calcium; param vitaminA; param cost; ...
Badro Dono's user avatar
1 vote
1 answer
79 views

I'm trying to fix my model for which I have a solution that should work. Is it possible to provide that solution to the solver and see which and how constraints are violated? Edit: Let's say I have ...
WBurzynski's user avatar
1 vote
1 answer
137 views

I have some AMPL files in .mod format, which I want to convert to .nl format. In this way, I can then easily parse them for further processing. However, I noticed that in the conversion the problem is ...
Scacco Matto's user avatar
-1 votes
1 answer
76 views

I keep running into an error with AMPL wherein whenever I try to model my mod file I get an error: giap.mod, line 23 (offset 1996): d is not defined context: {(d, b) >>> : <<< d ...
nisanur azizah's user avatar
0 votes
2 answers
105 views

If I have a number of named parameters in an AMPL model, and a table (either in an Excel spreadsheet or in AMPL's built-in format) with columns ParamName, ParamValue, is there a nice way to read these ...
ConMan's user avatar
  • 163
1 vote
0 answers
102 views

I use pyomo to formulate my problem and then use ampl to call knitro to solve my problem, as show in code below: self.solver_pyo = pyo.SolverFactory(modules.find(“Knitro”), solve_io = “nl”) My ...
John zhang's user avatar
0 votes
0 answers
106 views

I'm trying using CBC instead the old dog CPLEX in my project to solve a large MILP problem. I would like to get the current gap as it's showed in CPLEX log but in the showed CBC messages. CPLEX ...
Víctor Mario Noble Ramos's user avatar
0 votes
1 answer
45 views

In the code snippet T, P, C are sets and x, z are binary variables. Equipa {t in T, p in P}: max{c in C} x[p,t,c] = z[p,t]; I get the error: integrand following max{...} has invalid type How can ...
Ricardo Figueiredo's user avatar
2 votes
1 answer
519 views

When I want to perform an optimisation with pyomo, using one of the solvers I installed via the AMPL license tool, I get an error when just checking the availability of the solver. This happens for ...
vverbist's user avatar
0 votes
1 answer
36 views

Why am I facing this error when executing my code? ampl: model Assingment_3.mod; Assingment_3.mod, line 11 (offset 202): syntax error context: 1 >>> 30 <<< # Define the set ...
Heloise Carrer's user avatar
0 votes
1 answer
138 views

`I'm new to AMPL and I'm having a hard time understanding why I'm getting a feedback about my variables being already defined. I keep getting message stating: diet0.mod line 2 offset 16 Xbread is ...
nuve's user avatar
  • 1
0 votes
0 answers
114 views

When reading AMPL type .dat files in Pyomo, I encounter a problem dealing with two- and three-dimensional parameters. Following is a MWE: The Pyomo file is: from pyomo.environ import * data = ...
CJ Lopez-Salgado's user avatar
-1 votes
1 answer
99 views

Here is the .dat code: # ---------- Sets ---------- set N := 1 2 3 4 5 6 7 8 9 10; set L := 1 2 3; set N_l[1] := 1 7 8; set N_l[2] := 2 4 5 6; set N_l[3] := 3 9 10; # ---------- Parameters ---------- ...
SupBrudi's user avatar
0 votes
1 answer
99 views

set D := {1, 2, 3, 4}; param d := 1 80 2 70 3 120 4 150 5 100; param a := 1; # Cost per napkin for cleaning param b := 2; # Cost per napkin for buying new napkins param c := 0.5; # Cost per day ...
Sanjana Achar's user avatar
0 votes
0 answers
72 views

I wrote an optimizaton model and I tested it on ampl using gurobi solver. The solver gives me the following error: “Gurobi 10.0.1: Error: Objective Q not PSD (negative diagonal entry)”. I don’t know ...
sara menegato's user avatar
1 vote
1 answer
198 views

variables: set I:={1..4}; # prod 1-4 var x{I} >=0 integer; # Set this to a non-negative number! var y{I} binary; # Fixed cost is no matter what! Constraints: #Profit #I have tried this ...
Kevin's user avatar
  • 23
0 votes
1 answer
38 views

I am currently writing a simple bin packing problem using an AMPL model. The idea is to have orders and carts and minimize the total cost. Each order must be assigned to a cart, and a cart can have ...
Developppeur's user avatar
1 vote
2 answers
204 views

I’ve writen a simple model that optimize item location assignment for a warehouse of 30 000 locations. My code works with 3 items and gurobi or cplex, but : With CBC : Not working after 1 minutes ...
Developppeur's user avatar
0 votes
1 answer
144 views

Hi I am trying to solve a model using couenne in the AMPL IDE. Couenne seems to run and gives an optimisation value but then it prints the following statement; "Error at _cmdno 2 executing "...
Jack Hurrell's user avatar
1 vote
1 answer
119 views

I am new to AMPL and doing MC problem. I have included my code. I asked earlier to help with other errors, at this moment program is working, but optimal solution is 0 and giving a strange error. What ...
AlenaCh's user avatar
  • 21
1 vote
1 answer
130 views

My objective functions optimal value is confirmed to be non-zero, but I am getting 0 for it while trying to run an ampl program. Can you please help? The mod file contains my constraints and objective ...
Sahil Sahu's user avatar
1 vote
1 answer
38 views

I am new to AMPL and trying to make a simple model of MC problem, but I have so many errors and I can't understand how to solve them. I have attached bellow my model with a data in it. Maybe someone ...
AlenaCh's user avatar
  • 21
1 vote
1 answer
65 views

I'm working with AMPL. In the ".mod" I have declared a set like this: set path_intersections; It consists of rows of two numbers, the first one is the number of the path, and the second one ...
Ares's user avatar
  • 13
1 vote
1 answer
39 views

If I declear var x {1..3}; is there a way to specify specific indices to be integer variables? i.e. x[1] & x[3] are integer variables while x[2] is continuous. var x{1..3}; x[1] integer; x[3] ...
John's user avatar
  • 11
0 votes
1 answer
191 views

Below are my dat and mode files for ampl. I am getting the following error: hw3.dat, line 14 (offset 262): b[1] already defined context: 1 1 >>> ; <<< hw3.dat, line 14 (offset 262):...
Sagar Singh's user avatar
-1 votes
1 answer
65 views

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 ...
Thiago's user avatar
  • 9
0 votes
1 answer
67 views

So this is a pretty simple problem, given a circle of diameter 60 units, find the largest rectangle that fits in it. Using some pretty simple maths we know it'll have an area of 1800 units. So I ...
Rojer Vairs's user avatar
0 votes
1 answer
66 views

I have an AMPL file and CPLEX software and I dont know if I can run it with CPLEX if yes How can do it? do I have to install something with CPLEX NB: I dont have AMPL software
E.sop's user avatar
  • 1
1 vote
1 answer
673 views

I'm trying to use amplpy to link a python script to a ampl model, and the real desire is use a script to generate some parameters, and use the ampl to find the optimal values to some variables. Worth ...
Norberto Abrante Martinez's user avatar
0 votes
2 answers
131 views

I have two sets in Pyomo, the first one is G=/GD1,GD2,GD3/, And the second one is N=/N1,N2,N3,...,N32,N33/. Naturally they have symbolic representation here for the sake of simplicity. I would like ...
Simón Sepúlveda García's user avatar
0 votes
1 answer
145 views

I am trying to solve the exercises from AMPL: A Modeling Language for Math Programming Package, but I am stuck on Exercise 1-4(e). My code so far looks like this: .mod-file: # Set of cars we can ...
Mampenda's user avatar
  • 671
0 votes
1 answer
131 views

I want to add a constraint that a variable should be divisible by a particular integer. I tried using mod operator but it cannot be used with variables: s.t. c1 x1 mod 10 = 0 I get the following ...
Kshitiz Sinha's user avatar
0 votes
1 answer
249 views

Firstly I am newly with cplex, i want to define R as a set of two pairs (i,j) and then write the below constrains: zij ∈ {0, 1}, ∀ i, j s.t.(i, j) ∈ R fj − fi ≥ ...
MO MO MA's user avatar
1 vote
0 answers
122 views

I am new to AMPL. Currently I am trying to optimize a networking problem. I can only use CPLEX solver. Others like ILOG CP are forbidden. Input: Demands - set of demands that have to be fulfilled (...
fokamdk99's user avatar
0 votes
1 answer
324 views

I just started on ampl and tried some easy algorithm basics . Why is something like this repeat until loop not working ? param x=8 ; repeat until x=0; param x=x-1; display x; test.mod, line 3 (...
Clmx's user avatar
  • 15
1 vote
1 answer
424 views

I am new in AMPL and Python and I am using amplpy to run an AMPL model, using lpopt solver. I need to get the output result of the solver in a way that I can act over it, i.e. I need to know if the ...
matrj's user avatar
  • 21
0 votes
1 answer
65 views

I'm learnig to use AMPL to solve some linear programing related problems; but i have a syntax error with a part of my code, and i dont know how to solve it. #Archivo Mod #Conjuntos set T; #Conjunto ...
Tomás Sánchez Barry's user avatar
0 votes
0 answers
213 views

I am trying to have a constraint in my linear programming. I have 3 factories, and each factory has 3 production lines. I have to make sure that in a factory, all the production lines should work for ...
Kashif Mohammed Abdul's user avatar
1 vote
1 answer
303 views

I have been trying to get my generalized network flow problem in AMPL but I keep running into this error: presolve: constraint flow_balance['c5'] cannot hold: body >= 0 cannot be <= -2500; ...
erik baker's user avatar
0 votes
1 answer
49 views

Brand new to AMPL and don't understand the error at all. I've tried removing the variable definitions and get the error (no variables identified) so anyway here is the error message: syntax error ...
Rhodes256's user avatar
1 vote
1 answer
374 views

I am trying to solve a linear problem using Bonmin, the sample size is 5000 records. Ipopt and Cbc solved the same problem and data without any issues. Whereas, Bonmin always fails with the below ...
rk1918's user avatar
  • 11

1
2 3 4 5
9