How to implement the recurrence equation in GAMS?

$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 `

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

p(t)=func(p(t-1))

???

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