$ontext Filename: robot.gms Author: Nick Sahinidis, August 2002 Purpose: Find all solutions of the PUMA robot problem L.-W. Tsai and A. P. Morgan, "Solving the kinematics of the most general six- and five-degree-of-freedom manipulators by continuation methods," ASME J. Mech. Transm. Automa. Des., 107, 189-200, 1985. $offtext options limrow=0, limcol=0, solprint=off, nlp = baron, optca = 1e-6, optcr = 0; VARIABLES x1, x2, x3, x4, x5, x6, x7, x8, obj; x1.lo = -1; x2.lo = -1; x3.lo = -1; x4.lo = -1; x5.lo = -1; x6.lo = -1; x7.lo = -1; x8.lo = -1; x1.up = 1; x2.up = 1; x3.up = 1; x4.up = 1; x5.up = 1; x6.up = 1; x7.up = 1; x8.up = 1; EQUATIONS e1, e2, e3, e4, e5, e6, e7, e8, objective; e1.. 0.004731*x1*x3 - 0.1238*x1 - 0.3578*x2*x3 - 0.001637*x2 - 0.9338*x4 + x7 =E= 0.3571; e2.. 0.2238*x1*x3 + 0.2638*x1 + 0.7623*x2*x3 - 0.07745*x2 - 0.6734*x4 - x7 =E= 0.6022; e3.. x6*x8 + 0.3578*x1 + 0.004731*x2 =E= 0; e4.. - 0.7623*x1 + 0.2238*x2 =E= -0.3461; e5.. power(x1,2) + power(x2,2) =E= 1; e6.. power(x3,2) + power(x4,2) =E= 1; e7.. power(x5,2) + power(x6,2) =E= 1; e8.. power(x7,2) + power(x8,2) =E= 1; objective.. obj =E= 0; model robot /all/; robot.optfile = 1; file opt /baron.opt/; set i /1*20/; parameter report(i,*); loop (i, put opt; put 'numsol ', ord(i):4:0 /; putclose opt; solve robot using nlp minimizing obj; report(i,'Nodes Used') = robot.nodusd; report(i,'CPU Time') = robot.resusd; ); display report;