AMPL offers superior support by our development and technical support teams.
Contact us for general queries, partnerships, and more.
We can help you find the license and offering that works best for your situation.
AMPL offers superior support by our development and technical support teams.
Contact us for general queries, partnerships, and more.
We can help you find the license and offering that works best for your situation.
Example file from the AMPL book
model diet.mod;
data diet2.dat;
param N symbolic in NUTR;
param nstart > 0;
param nstep > 0;
read N, nstart, nstep <- ; # read data interactively
set N_MAX default {};
param N_obj {N_MAX};
param N_dual {N_MAX};
option solver_msg 0;
for {i in nstart .. 0 by -nstep} {
let n_max[N] := i;
solve;
if solve_result = "infeasible" then {
printf "--- infeasible at %d ---\n\n", i;
break;
}
let N_MAX := N_MAX union {i};
let N_obj[i] := Total_Cost;
let N_dual[i] := Diet[N].dual;
}
display N_obj, N_dual;