Hi Jesse

Here is some code that shows how to do this, supposing that you havenâ€™t solved the model yet and you only have a value for the first period

set t /1*12/;

variable

X(T) Quantities in period t;

X.L(“1”) = 2;

loop(t)$(ord(t) > 1)),

X.L(t)= X.L(t-1);

);

display X.L;

Note, that the condition to do this from period 2 onwards is necessary (just delete it and see what happens). You also need a loop in order to let Gams know what the value of x(t-1) is, before it assigns this value to X(t).

Hope this helps

Cheers

Renger

\

Modelworks

Gewerbestrasse 15

3600 Thun â€“ Switzerland

+41 79 818 53 73

Info@modelworks.ch

blog.modelworks.ch

From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Jesse Henderson

Sent: Donnerstag, 24. Oktober 2013 03:14

To: gamsworld@googlegroups.com

Subject: activity level assignment and NLP, economics, partial equilibrium

Hello GAMS users,

I’m working on an intertemporal economic model and plan to use an NLP solver. I understand that it is important to give the solver a starting point. As a sample for one of my variables, I tried the following:

qs.l(i,j,t) = qs(i,j,t-1);

And I got the following error: Error 143, A suffix is missing.

Alright, so writing the following eliminates this error:

qs.l(i,j,t) = qs.l(i,j,t-1);

However, I’m not sure if this does what I’m aiming to do. I’m trying to say “A decent guess for this period’s quantity supplied is last period’s quantity supplied.”

Is that what the latter code with the suffix means? I’m also curious if anyone knows a better way to accomplish the goal represented in quotes. I’d appreciate links to partial equilibrium code examples as well.

Thanks very much,

Jesse H.

–

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.

To post to this group, send email to gamsworld@googlegroups.com.

Visit this group at http://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/groups/opt_out.

–

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.

To post to this group, send email to gamsworld@googlegroups.com.

Visit this group at http://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/groups/opt_out.