Non-linearity in GAMS model

Archive of Gamsworld Google Group
Post Reply
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Non-linearity in GAMS model

Post by Archiver »



I wrote a relatively simpler model where the acreage will be allocated
between two different crops (Grasses and Stover).

There are no non-linearities involving the acreage terms. Still, I got
this error #56

"56 Endogenous operands for * not allowed in linear models."

In stead of LP, I used NLP to solve the problem and I was able to
obtain feasible results. But, I was surprised why this would happen -
since I use only a products but without any non-linear operations (no
power ** or Max/Min/ABS functions?

The following are the only two equations, where the vStoverAc(zone,
quarter) and vGrassac(z) appear. Other equations in the model are
based upon the total biomass derived from these acreages.

What other factors should I be careful about to understand such error
message of non-linearity? I seek this because I am planning to
introduce some non-linearity in acreage terms (or a round-about method
of iterative solve command).

----------------------------------------------------------------------------

eCostFunction.. vCumulativeCost =e=

Sum[(z,q), vcost("Grass",z,q) * Yield("Grass",q) * vGrassAc(z)]
+ Sum[(z,q), vcost("Stover",z,q) * Yield("Stover",q) * vStoverAc(z,q)]
+ Sum[(F,q),(D * vStorage(F,q))]
+ [Sum(z,vTerminalcost('Stover',z))/Card(z)]* vExcessStover_T
+ [Sum(z,vTerminalcost('Grass',z))/Card(z)]*
vExcessGrass_T ;


*Supply of Stover and Grass in quarter q
eGrassSupply(q).. vGrassS(q) =e= Sum(z,Yield("Grass",q) *
vGrassAc(z)) ;
eStoverSupply(q).. vStoverS(q) =e= Sum(z,Yield("Stover",q) *
vStoverAc(z,q)) ;

----------------------------------------------------------------------------

Thank you for your reply.

Subbu Kumarappan
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to gamsworld@googlegroups.com
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en
-~----------~----~----~----~------~----~------~--~---


Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Non-linearity in GAMS model

Post by Archiver »


Hi Subbu

Is Yield(crop, quater) a variable? Non-linearity occurs when there is a product of two variables x1*x2. This is what I suspect is going on in your case.

Hope this helps.

Rahul

On Fri, Apr 24, 2009 at 8:09 PM, kmsubbu wrote:


I wrote a relatively simpler model where the acreage will be allocated
between two different crops (Grasses and Stover).

There are no non-linearities involving the acreage terms. Still, I got
this error #56

"56 Endogenous operands for * not allowed in linear models."

In stead of LP, I used NLP to solve the problem and I was able to
obtain feasible results. But, I was surprised why this would happen -
since I use only a products but without any non-linear operations (no
power ** or Max/Min/ABS functions?

The following are the only two equations, where the vStoverAc(zone,
quarter) and vGrassac(z) appear. Other equations in the model are
based upon the total biomass derived from these acreages.

What other factors should I be careful about to understand such error
message of non-linearity? I seek this because I am planning to
introduce some non-linearity in acreage terms (or a round-about method
of iterative solve command).

----------------------------------------------------------------------------

eCostFunction.. vCumulativeCost =e=

Sum[(z,q), vcost("Grass",z,q) * Yield("Grass",q) * vGrassAc(z)]
+ Sum[(z,q), vcost("Stover",z,q) * Yield("Stover",q) * vStoverAc(z,q)]
+ Sum[(F,q),(D * vStorage(F,q))]
+ [Sum(z,vTerminalcost('Stover',z))/Card(z)]* vExcessStover_T
+ [Sum(z,vTerminalcost('Grass',z))/Card(z)]*
vExcessGrass_T ;


*Supply of Stover and Grass in quarter q
eGrassSupply(q).. vGrassS(q) =e= Sum(z,Yield("Grass",q) *
vGrassAc(z)) ;
eStoverSupply(q).. vStoverS(q) =e= Sum(z,Yield("Stover",q) *
vStoverAc(z,q)) ;

----------------------------------------------------------------------------

Thank you for your reply.

Subbu Kumarappan



--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to gamsworld@googlegroups.com
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en
-~----------~----~----~----~------~----~------~--~---

Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: Non-linearity in GAMS model

Post by Archiver »



Thanks. I think you are right - I am yet to find which two variables
would be product.
May be the inventory requirements that connect two periods -- create
multi-period equations. When these equations are simultaneously
solved, the non-linearities occur.

am not sure yet. Thanks again.
Subbu

On Apr 24, 5:31 pm, Rahul Anantharaman
wrote:
> > Hi Subbu
> >
> > Is Yield(crop, quater) a variable? Non-linearity occurs when there is a
> > product of two variables x1*x2. This is what I suspect is going on in your
> > case.
> >
> > Hope this helps.
> >
> > Rahul
> >
> > On Fri, Apr 24, 2009 at 8:09 PM, kmsubbu wrote:
> >
>> > > I wrote a relatively simpler model where the acreage will be allocated
>> > > between two different crops (Grasses and Stover).
> >
>> > > There are no non-linearities involving the acreage terms. Still, I got
>> > > this error #56
> >
>> > > "56 Endogenous operands for * not allowed in linear models."
> >
>> > > In stead of LP, I used NLP to solve the problem and I was able to
>> > > obtain feasible results. But, I was surprised why this would happen -
>> > > since I use only a products but without any non-linear operations (no
>> > > power ** or Max/Min/ABS functions?
> >
>> > > The following are the only two equations, where the vStoverAc(zone,
>> > > quarter) and vGrassac(z) appear. Other equations in the model are
>> > > based upon the total biomass derived from these acreages.
> >
>> > > What other factors should I be careful about to understand such error
>> > > message of non-linearity? I seek this because I am planning to
>> > > introduce some non-linearity in acreage terms (or a round-about method
>> > > of iterative solve command).
> >
>> > > ----------------------------------------------------------------------------
> >
>> > > eCostFunction.. vCumulativeCost =e=
> >
>> > > Sum[(z,q), vcost("Grass",z,q) * Yield("Grass",q) * vGrassAc(z)]
>> > > + Sum[(z,q), vcost("Stover",z,q) * Yield("Stover",q) * vStoverAc(z,q)]
>> > > + Sum[(F,q),(D * vStorage(F,q))]
>> > > + [Sum(z,vTerminalcost('Stover',z))/Card(z)]* vExcessStover_T
>> > > + [Sum(z,vTerminalcost('Grass',z))/Card(z)]*
>> > > vExcessGrass_T ;
> >
>> > > *Supply of Stover and Grass in quarter q
>> > > eGrassSupply(q).. vGrassS(q) =e= Sum(z,Yield("Grass",q) *
>> > > vGrassAc(z)) ;
>> > > eStoverSupply(q).. vStoverS(q) =e= Sum(z,Yield("Stover",q) *
>> > > vStoverAc(z,q)) ;
> >
>> > > ----------------------------------------------------------------------------
> >
>> > > Thank you for your reply.
> >
>> > > Subbu Kumarappan
> >
> >
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to gamsworld@googlegroups.com
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en
-~----------~----~----~----~------~----~------~--~---


Post Reply