You can load AMPL models in a loop using commands
instead of model
:
for {i in 1..n}
commands('model_' & i & '.mod');
Similar thing can be done in Pyomo using standard Python's mechanisms:
g = globals()
for i in range(n + 1):
g['model_' + str(i)] = ConcreteModel()