0

I have a question concerning the quadprog solver.

I have set up an optimisation problem with 96 values to be optimised and 4 constraints which is working fine.

Now I would like to do a somewhat more sophisticated optimisation. The values which are to be optimised shall depend on their direct predecessor.

Question: Is there a way to refer to direct previous solutions in the constraint vector bvec (vector holding the values of b_0)? Moreover: Is it possible to use conditional functions as constraints in the constraint vector bvec?

I hope my questions are clear. If not, just let me know and I will try to explain more clearly.

Thanks in advance!

Tilman

T. Wolf
  • 111
  • 1
  • 6

1 Answers1

1

Is there a way to refer to direct previous solutions in the constraint vector bvec (vector holding the values of b_0)?

I believe you mean:

1. solve min 0.5d'Qd-d'b subject to A'b>=b0
2. form new b0 using optimal solution values d
3. solve min 0.5d'Qd-d'b subject to A'b>=b0

That is no problem of course.

Is it possible to use conditional functions as constraints in the constraint vector bvec?

Not really: the vector bvec (or b0) are constants. Also note that all constraints must be linear in quadprog, so no functions allowed at all. The constraints must have the form A'b>=b0 (some of them can be equalities).

Erwin Kalvelagen
  • 15,677
  • 2
  • 14
  • 39
  • For the first question this is not exactly what I wanted to know. Let me be more clear by giving you an example: If for example I want to solve an optimization problem with 96 consecutive solutions (as I am optimizing a production volume for every quarter hour of a day). Is there a way to use the value of the fifth solution as a constraint for the sixth solution in quadprog solver? For the second question your answer was more than helpful! Thanks for your support! – T. Wolf Feb 01 '17 at 08:20
  • In many models we use constructs like `x(t) = x(t-1) + ....`. Inventory balance equations are a good example: `inventory(t) = inventory(t-1) + production(t)-sales(t)`. – Erwin Kalvelagen Feb 01 '17 at 08:36
  • Can that be implemented as a constraint into a solver easily? – T. Wolf Feb 01 '17 at 09:58
  • Yes. My inventory balance example is just a linear constraint. – Erwin Kalvelagen Feb 01 '17 at 10:00
  • Thanks a lot! This will be very helpful! – T. Wolf Feb 01 '17 at 10:32