I am currently translating the following problem (http://tomdyn.com/examples/minEnergyOrbitTransfer.html) from PROPT to AMPL. There are two controls, ut and ur. There is also a condition which links both of them together. this condition takes the form [0<=sqrt((ur²+ut²))}<=umax]. In the past I programed a condition somehow similar to this but without the inequalities (note that I am using Simpon's integration)
I have searched AMPL's manual for something similar to this, but I have found nothing, specially in the chapter dedicated to constraints https://ampl.com/BOOK/CHAPTERS/11-linprog.pdf.
Perhaps, in the appendix A https://ampl.com/BOOK/CHAPTERS/24-refman.pdf the order subject to can help me, but I don't understand it.
This is how I solved my problem last time. However, there the two controls always added to one.
control_contraint{i in N}: u1[i]²=1-u2[i]²;
control_contraint_mid{i in N1}: midu1[i]²=1-midu2[i]²;
And in this case, I have tried to do something similar
control_constraint{i in N}: ur[i]*ur[i] >=0, <=umax*umax-ut[i]*ut[i];
control_constraint_mid{i in N1}: midur[i]*midur[i] >=0, <=umax*umax-midut[i]*midut[i];
The result however is a syntax error.
I need advice on how to write the equation.
In the end I could do it by dividing each of the conditions in two.
upper_control_contraint {i in N} (ut[i]^2+ur[i]^2)^(0.5)<=umax;
lower_control_constraint {i in N} (ut[i]^2+ur[i]^2)^(0.5)>=0;
And likewise for the middle states.