|
From: | Robert Fourer |
Subject: | RE: [Help-glpk] i have problem |
Date: | Sun, 19 Dec 2004 09:52:19 -0600 |
Your objective function uses xiA without a
subscript (twice) and has two more left parentheses than
right parentheses. Mysterious syntax error messages often
have their root in simple errors like these. If you
write your cost function on several lines, the errors may be easier
to see. As written, the objective function of this
problem is nonlinear in the variables, so GLPK won’t be
able to solve it. Instead you could try some of the nonlinear
solvers at http://www-neos.mcs.anl.gov/neos/
that accept AMPL input. From:
address@hidden
[mailto:address@hidden On Behalf Of pp pp i have problem i'm student and my first time to find optimize value by GLPK but I
have problem my program : set
I;
/*No.*/ set
Q;
/*sta.*/ set
P;
/*section*/ param siq{i in I,q in
Q}; /*stop time*/ param Wi{i in
I};
/*value of time*/ param Ti{i in
I};
/*value of time*/ param Dp{p in
P};
/*distance*/ param Dpl{p in
P};
/*limit distance*/ param vip{i in I,p in
P}; /*max speed*/ param vlip{i in I,p in
P}; /*limit speed*/ param xiD{i in
I};
/*start time*/ param xiA{i in
I};
/*end time*/ var vzip{i in I,p in
P},integer,>=1; /*need speed*/ var vzlip{i in I,p in P},integer,>=1;/*need limit speed*/ minimize cost:((sum{i in I,q in Q,p in
P}Wi[i]*((xiD[i]+siq[i,q]+((Dp[p]-Dpl[p])/(vzip[i,p]/60)+(Dpl[p]/(vzlip[i,p]/60)))-xiA))+(sum{i
in I,q in Q,p in
P}Ti[i]*((xiD[i]+siq[i,q]+((Dp[p]-Dpl[p])/(vzip[i,p]/60)+(Dpl[p]/(vzlip[i,p]/60)))-xiA))); s.t.speed_max{i in I,p in P}:vzip[i,p]<=vip[i,p]; s.t.speed_limit{i in I,p in P}:vzlip[i,p]<=vlip[i,p]; data; set I := 35 37 86 168; set Q:= 1 2 3 4 5; set P:= 1 2 3 4; param siq:
1
2
3
4 5:= 35
0
0
0
0 0 37
0
0
0
0 0 86
0 0
0
0 0 168
6
0
1
0 0; param Wi:= 35 150 37 150 86 100 168 50; param Ti := 35 150 37 150 86 100 168 50; param Dp:= 1 9.4 2 6.74 3 7.26 4 9.73; param Dpl:= 1 0 2 0 3 0 4 0.625; param vip:
1
2
3 4:= 35
90
90
90 90 37
90
90
90 90 86
90
90
90 90 168 90
90
90 90; param vlip:
1
2
3 4:= 35
1
1
1 50 37
1
1
1 50 86
1
1
1 50 168
1
1
1 50; end; when I run glpsol it show ts7.mod:18: operand following / has invalid type context:q]+((Dp[p]-Dpl[p])/(vzip[i,p]/60)+ model processing error why??? Help me please __________________________________________________ |
[Prev in Thread] | Current Thread | [Next in Thread] |