0

I am sorry if this sounds like a newbie question! I am all brand new to Matlab and the optimization toolbox!

I have an optimization problem using quadprog, I have two equality constraints in my problem. Using the general formula:

x = quadprog(H,f,A,b,Aeq,beq,lb,ub,x0,options)

but here I can only have Aeq and beq as equality constraints! A and b are inequality constraints...

Is it possible to have something like a set for the equality constraints? that is having multiple variables for equality in Aeq and beq in the form of a set or something? I have been looking and trying for a while with no luck!

NZal
  • 849
  • 3
  • 9
  • 19
  • 1
    I'm confused by your question. Aeq is in matrix form thereby allowing for a set of equalities. – Rasman Feb 24 '13 at 13:58

1 Answers1

0

The equality constraints are given in matrix form Aeq*x==beq. Therefore, each row of Aeq can define a separate equation. For example, if you have three unknowns, and you want the sum of the first two to be equal to 2, and the difference of the second two (x(3)-x(2)) to be equal to 3, you write

Aeq = [1 1 0; 0 -1 1];
beq = [2;3];
Jonas
  • 74,690
  • 10
  • 137
  • 177