oemof-solph: Misleading/missing documentation of OffsetConverter

Describe the bug In the usage documentation for the OffsetTransformer an example is given to calculate the coefficients c0 and c1. If calculated like this, the results are illogical. I narrowed it down to the calculation of c0, which should actually look like this: c0 = (P_out_max-c1*P_in_max)/P_out_max Which means, that c0 isn’t really the y-intercept anymore (which would be c0 = P_out_max-c1*P_in_max).

Possible solutions I see two possible solutions:

  1. Fix the documentation to include the example calculations of the parameters described above, or
  2. Change the calculation in the OffsetConverterBlock to not multiply with the status_nominal (which is the product of P_max(t) * Y(t)) but with the status variable. This way, c0 would remain to be the y-intercept, which, from a mathematical, logical and usage standpoint seems much nicer to me.

Am I overlooking something here or doing something wrong? I’m actually a bit surprised that this has not been noticed before.

About this issue

  • Original URL
  • State: open
  • Created 8 months ago
  • Comments: 18 (17 by maintainers)

Most upvoted comments

@lensum @p-snft Noticed one more misleading in the (usage documentation for the OffsetTransformer), that the Nonconvex flow is given in inputs of the converter but in the source code it says that the Nonconvex attribute must be defined only for the output flow: if len(self.inputs): if v.nonconvex: raise TypeError( "NonConvex attribute must be defined only for the " + "output flow!" ) I might be assuming it incorrectly, please correct me if it intended.

The new implementation would use the nominal values of both flows to determine P_in_max and P_out_max.

Nice, I like it 😃