Dear gamsworld members,
I have just started to use GAMS. Even though I tried to model my problem several times, I couldn’t figure it out. Finally I found an AMPL example that is similar to my problem. But I don’t know how to implement it in GAMS.
Could you please help me conversion of AMPL code below to GAMS code?
Thank you.
param N := 201;
param time := 4.8;
param length := 6.0;
param ns := 3;
param z{1…ns-1};
param s{1…ns};
param h := time/N;
param uamax := 10.0;
param ubmax := 2.0;
param aa:= 0.3;
param bb := 0.14;
param cc := 0.16;
param eps := 0.05;
param pi := 4atan(1);
var x{0…N};
var v{i in 0…N-1} = (x[i+1]-x_)/h;
var v_avg{i in 1…N-1}
= (v+v[i-1])/2;
var a{i in 1…N-1} = (v-v[i-1])/h;
var ua{1…N-1} >=0.0, =0.0, train_x;
printf {i in 1…N-1}: “%10f %10f \n”,
ih, u > train_a;
printf {i in 0…N-1}: “%10f %10f \n”,
i*h, v > train_v;
\
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/d/optout._