麻烦帮忙看下程序:运行程序lingo程序,出现unexpected jacobian overflow

1个回答

  • 你既然用i,j去定义集了,后面就不能用i,j去做下标,重复了导致出错.

    下面是修改后的代码,有一些帮你简化了.

    注:lingo默认变量时非负的.

    model:

    sets:

    i/1,2,3,4/:a,b,s;

    j/1,2/;

    ij(j,i):x;

    endsets

    data:

    a=0.65,0.5,0.56,0.68;

    b=0.76,0.7,0.72,0.66;

    s=640,850,530,720;

    enddata

    min=@sum(i(m):(1-a(m))^(x(1,m))+(1-b(m))^(x(2,m)));

    0.75*@sum(i(m):s(m)*x(1,m))+(7/12)*@sum(i(m):s(m)*x(2,m))+100*@sum(ij(n,m):x(n,m))