[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] [Fwd: not defined error]
From: |
Heinrich Schuchardt |
Subject: |
Re: [Help-glpk] [Fwd: not defined error] |
Date: |
Fri, 12 Jul 2013 07:21:38 +0200 (CEST) |
Your mail had to forwarded manually because you are not subscribed to the GLPK
help list, see
https://lists.gnu.org/mailman/listinfo/help-glpk
Your constraint MH1_MustHave has multiple problems:
In your constraint you use an index "l" that is not defined in the domain of
your constraint {y in YEAR, t in TECHNOLOGY, r in REGION}. GLPK does not know
what l is meant to be. Therefore you get the error observed.
GLPK is a linear solver. "If" is not a linear term. You cannot use "If" in a
constraint.
Best regards
Heinrich Schuchardt
http://www.xypron.de
> Gesendet: Donnerstag, 11. Juli 2013 um 22:56 Uhr
> Von: "Andrew Makhorin" <address@hidden>
> An: address@hidden
> Betreff: [Help-glpk] [Fwd: not defined error]
>
> -------- Forwarded Message --------
> To: address@hidden
> Subject: [Help-glpk] not defined error
> Date: Thu, 11 Jul 2013 13:51:23 -0700 (PDT)
>
> I am new to GLPK linear programming and I keep running into an error that I
> cannot sort out.
>
> Here is the error:
>
> l not defined
> Context: if MustHave[y,t,r] = 1 then RateOfActivity[y,l,
> MathProg model processing error
>
> Here is the line of code that it is hanging up on:
>
> s.t. MH1_MustHave{y in YEAR, t in TECHNOLOGY, r in REGION}: if
> MustHave[y,t,r] = 1
>
> then RateOfActivity[y,l,t,m,r] =
> max(TotalAnnualCapacity[y,t,r]*YearSplit[y,l]*CapacityFactor[y,t,l,r]
>
> else RateOfActivity[y,l,t,m,r] =
> RateOfActivity[y,l,t,m,r];