Hello,
So far when I have been using a .run file I can only include one model file (.mod). That has usually been ok. I could solve that model or solve it many times in a loop.
What I would like to do, and I am not too sure I can do that in AMPL is to use the output of the first solve and enter them in a new problem.
I will give a generalization of the problem.
Let u_i(X ; w_i, q) be continuous function where the choice variables (var in AMPL) is the vector X. The function depends on both parameter w_i and q. The subscript i is to represent different values for each i (suppose N of them), and q would be same for all i.
w_i is taken from a set W and each w_i is different. I take this from a .txt file that I input.
Here max u_i(X ; w_i, q) would be is a model file .mod. Now I use my .run file to give the values for the parameters then do a loop to solve the N problems.
In the end I will have all the optimal choice variables for each i. If I plug those back in, I should get v_i(w_i, q)=max_X u(X*; w_i ,q).
What I would like to do from there is to, for example, minimize/maximize the value of some objective function, suppose F(q)=sum_i v_i(w_i,q), by picking q.
I guess I could solve this by using the first-order conditions (FOC) of the first set of problems and use those as contraints for the bigger problem. However, each small problem in the loop gives a large number of FOCs which would make it (practically) infeasible.
So is there a way to use the output of solving the many first problems as an input for the bigger problem? I understand that this would need a solver that tests jumps before moving in different directions since I wouldn't be really able to feed it an hessian or something like that. And every time it tests a new value, the whole inner loop as to be redone.
I haven't able to do this on my own, so I figured I would ask here.
Thank you for your time.