lingo求解约束条件连续变化情况下的规划问题

1个回答

  • 运行前到lingo的options里面把output level设成nothing

    submodel M:

    min=0.0108*x1^2+0.0584*x2^2+0.0942*x3^2+0.0248*x1*x2+0.1108*x2*x3+0.0262*x3*x1;

    1.0891*x1+1.2137*x2+1.2346*x3>=c;

    x1+x2+x3=1;

    endsubmodel

    calc:

    c=1;

    @divert('D:output.txt');

    @while(c#lt#2.01:

    x05@release(x1);@release(x2);@release(x3);

    x05@write('c:',@format(c,'.2f'),@newline(1));

    x05@solve(M);

    x05@ifc(@status()#eq#0:

    x05x05@write('x:',@format(x1,'.4f'),' ',@format(x2,'.4f'),' ',@format(x3,'.4f'),@newline(2));

    x05x05@else

    x05x05x05@write('No optimal solution',@newline(2));

    x05);x05

    x05c=c+0.01;

    );

    @divert();

    endcalc