[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Syntax error in Glpk modelling
From: |
Robbie Morrison |
Subject: |
Re: [Help-glpk] Syntax error in Glpk modelling |
Date: |
Wed, 20 Mar 2013 05:15:25 +1300 |
User-agent: |
SquirrelMail/1.4.22 |
------------------------------------------------------------
To: Figen G?ng?r <address@hidden>
Subject: Re: [Help-glpk] Syntax error in Glpk modelling
Message-ID: <address@hidden>
From: Andrew Makhorin <address@hidden>
Date: Tue, 19 Mar 2013 03:03:53 +0400
------------------------------------------------------------
> On Tue, 2013-03-19 at 00:45 +0200, Figen G?ng?r wrote:
>
>> Can you please look at my question at
>> Stackoverflow?
>> http://stackoverflow.com/questions/15488041/syntax-error-in-linear-programming-modelling-with-glpk?noredirect=1#comment21925482_15488041
>
>> var po := sum{i in I} c[i]*x[i];
>>
>> var cost := sum{i in I} a[i]*y[i] + b[i]*x[i];
>>
>> I am getting this syntax error:
>>
>> problem.mod:21: syntax error in variable statement
>> Context: ...I } ; param d { i in I } ; var x { i in I } >= 0 ;
var po :=
>> MathProg model processing error
>>
>> Can you please help me out?
>
> In MathProg you cannot assign a value to a variable.
>
> If you need to fix a variable at some value, you
> need to use appropriate equality constraint, e.g.
>
> var po;
>
> s.t. foo: po = sum{i in I} c[i]*x[i];
>
> var cost;
>
> s.t. bar: cost = sum{i in I} a[i]*y[i] + b[i]*x[i];
Hi Figen
Thanks for transferring the answer back
to the stackoverflow site for other to access.
Robbie
---
Robbie Morrison
PhD student -- policy-oriented energy system simulation
Technical University of Berlin (TU-Berlin), Germany
University email (redirected) : address@hidden
Webmail (preferred) : address@hidden
[from Webmail client]