On 8/26/19 2:32 PM, dg.aragones wrote:
I copied and pasted your original code. looking at the sqp line, I see in the help that sqp of the form:
sqp (X0, PHI, G)
X0 to be a vector
PHI to be the objective function that accepts a vector and returns a scalar and
G to be a constraint function that must accept a vector argument and return a vector.
If your case, both F and R accept a vector and returns a scalar. could that be part of the problem? it gives the error:
error: operator *: nonconformant arguments (op1 is 51x51, op2 is 1x51)
(both s and y are 1x51 when I run your code unmodified.)
is sqp performing some array functions internally that is expecting a vector output from R to build a 51x51 array, but since it's only outputting scalars op2 is the wrong size?