How to implement the recurrence equation in GAMS?

Problems with syntax of GAMS
Post Reply
minegams
User
User
Posts: 1
Joined: 3 months ago

How to implement the recurrence equation in GAMS?

Post by minegams »

Code: Select all

$title mytestmodel

Set
   t 'time' / t1*t10 /
   i 'paper'   / i1 /;


Variable
   p(t,i) 'learned probability at time t about paper i'

Binary Variable  a(t,i) 'action at time t about i';

Equation
   upd(t,i)   'transition equation for p'


upd(t,i)..                     p(t,i)=e=((p(t-1,i)+(1-p(t-1,i))*0.7)*a(t,i)+(1-a(t,i))*p(t-1,i)*p0(t-1,i));

Model my modell /all/;
this code gives me a lot of errors especially around `

Code: Select all

p(t,i)=e=((p(t-1,i)+(1-p(t-1,i))*0.7)*a(t,i)+(1-a(t,i))*p(t-1,i)*p0(t-1,i));
I would like to solve optimal control problem in gams,but how to define the equations like

Code: Select all

p(t)=func(p(t-1))
????
GabrielYin
User
User
Posts: 72
Joined: 6 years ago
Location: Dallas, TX, USA
Contact:

Re: How to implement the recurrence equation in GAMS?

Post by GabrielYin »

Your way of modeling recurrence equation is OK. It's just a lot of syntax you missed out.

1. You need a semicolon to close the equation definition.
2. You need to define p0.

Best,
Gabriel
Post Reply