1

I am trying to maximize hourly profits from a power generation asset. As far as I understood from my research, I might use quadprog::solve.QP.

I did most of the required data preparation already giving me a 96 x 5 data frame.

The columns include the following information:

  1. Quarter Hour of a day
  2. Power Price
  3. Production Volume
  4. Generation Cost
  5. Profit

The first two columns are complete which leads to my quadratic optimization. The target function is as follows:

max Profit[i] = Volume[i] * (Price[i] - Cost[i])

The main issue is that the Generation Cost is a function of the Production Volume (which I have predetermined and which moreover depends on various static values).

In addition to that the Production Volume in a certain quarter hour must not differ from the precedent production volume by let's say more than 20 MegaWatt. The Production Volume must not exceed a maximum production volume and not fall below a minimum production volume.

I tried to implement the optimization problem as follows:

Volume = x1

Price = x2

Cost = x3

Profit = x1 * (x2 - x3) --> max
Profit = x1*x2 - x1*x3 --> max

with

x3 = f(x1)

subject to

x1(t) >= x1(t-1) - 20
x1(t) <= x1(t-1) + 20
x1    <= max(x1)
x1    >= min(x1)

From the quadprog manuals I read that I need to use

solve.QP(Dmat, dvec, Amat, bvec)

But I honestly don't know how to fill the two matrices and the two vectors.

Can anyone help?

I hope the information given is sufficient.

Cheers, Tilman

Karsten W.
  • 17,826
  • 11
  • 69
  • 103
T. Wolf
  • 111
  • 1
  • 6
  • Could you elaborate on the role of the price in your optimization? Is it an external parameter, or does it depend on the production volume? – Karsten W. Jan 24 '17 at 22:47
  • Thanks for your reply! It depends on both, external parameters and on the production volume. – T. Wolf Jan 25 '17 at 09:38
  • I have found out how to do "the maths" solving the problem with quadprog solver. At least for Dmat (filling it as a diagonal matrix) and dvec (taking into account all relevant fix parameters) I am quite sure that they are correct. I am not sure though whether I filled Amat and bvec correctly. R is giving me the error message "Error in quadprog::solve.QP(DMatSCHOB, vSCHOB, AMatSCHOB, bvecSCHOB) : constraints are inconsistent, no solution!". So obviously there must be a mistake. I do respect the precedent production volumes in Amat, though. Someone has an idea? – T. Wolf Jan 25 '17 at 10:28
  • Just solved it! I mixed up positive and negative constraints in one time step. Thanks for your support! – T. Wolf Jan 25 '17 at 13:50

0 Answers0