On Thu, 2010-12-09 at 22:03 -0500, Christina Cignarale wrote:
> Hi,
> 
> Thank everyone for your input. I put the table statement into the
> model file but, I am still getting an error. I was unsure how to
> define part of the statement for my problem. I referenced the soduku
> example that is posted. This is the model I am using
> 
> set NUTR;
> set FOOD;
> 
> param cost {FOOD} > 0;
> param f_min {FOOD} >= 0;
> param f_max {j in FOOD} >= f_min[j];
> 
> param n_min {NUTR} >= 0;
> param n_max {i in NUTR} >= n_min[i];
> 
> param amt {NUTR,FOOD} >= 0;
> 
> table f IN 'ODBC' 
> 'Driver={Microsoft Excel Driver (*.xls)};dbq=newdiet.xls'
> 'SELECT * FROM [Nutr$]'
> NUTR <- [NUTR],n_min,n_max;
> 
> var Buy {j in FOOD} >= f_min[j], <= f_max[j];
> 
> minimize Total_Cost:  sum {j in FOOD} cost[j] * Buy[j];
> 
> subject to Diet {i in NUTR}:
>    n_min[i] <= sum {j in FOOD} amt[i,j] * Buy[j] <= n_max[i];
> 
> 
> The highlited line is where I am getting the error. I know I do not
> have a WHERE statement but I was unsure how to include that.
> 
> Thank you for your help,
> Christina
> 
> On Mon, Dec 6, 2010 at 5:18 PM, Noli Sicad <[email protected]> wrote:
>         Browse glpk-help archive [[1] about Excel and GLPK. It has 10
>         pages
>         about Excel and MathProg.
>         
>         [1]
>         
> http://www.mail-archive.com/search?q=Excel&[email protected]&o=relevance&start=0
>         
>         Noli
>         
>         
>         
>         
>         On 12/7/10, glpk xypron <[email protected]> wrote:
>         > Hello Christina,
>         >
>         > please, have a look at
>         > http://sourceforge.net/projects/winglpk/
>         >
>         > The distribution includes example files
>         > glpk-4.44/examples/sql/sudoku_excel.mod and
>         > glpk-4.44/examples/sql/sudoku_xls
>         >
>         > Please, read
>         > http://en.wikibooks.org/wiki/GLPK/ODBC#Microsoft_Excel
>         >
>         > Best regards
>         >
>         > Xypron
>         
> 
> 
> 
> -- 
> Christina Cignarale


_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to