-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misleading/missing documentation of OffsetConverter #1010
Comments
I implemented option 2. |
I seem to have fixed one thing but broke another,
Originally posted by @Bachibouzouk in #1012 (comment) |
I used
With those definition, use of |
The slope calculation is starting from
Then using P_in_i = P_max * load_i we get
Which is not the intercept anymore as @lensum pointed out, but as it gets multiplied by |
I think one problem is that the system is overdetermined. We have the c0, c1 to describe the slope but we do also have the maximum power(s). It might make sense to let the user define the slope (my preference, the y-intercept would be a second option) and to consider the My suggestion would be: We revert #1012. This way, old models will continue behaving like they did. At the same time, we deprecate the argument |
Reverting #1012 will not fix the error I spotted
Are you sure the problem is overdetermined ? If you only know c1 (the slope) and P_max (if I am not mistaken P_max is equivalent to P_in_max, right?) how do you get C0 then? |
There are two things:
Before 61a295a, the constraint equation for the offset transformer read:
Let's call it version A And after 61a295a It was changed to
Let's call it version B So in version A the equation is correct as P_in is subtracted. In version B (which is the current version) the equation is not correct because P_out is subtracted instead of P_in. So my question is: the "old models" for which you would like to have backward compatibility are the models since version B or the ones from the time of version A? Because I am pretty sure if anyone used offset_converters since version B, the results should not make a lot of sense. I came across this because the efficiencies I computed (using v 0.5.1) with the resulting flows after optimization displayed numbers like 500k, which is nonsensical, like if energy is created within the offset_converter. |
Nice, I like it :) |
I agree with the suggested changes. I initially only considered the operations optimizations where So reverting back to use |
Actually, I also only considered optimisations where So, I have to correct myself. In my (new) opinion, it makes sense to give |
@lensum @p-snft |
One issue is duplicated documentation. It's wrong in usage but correct in the class reference. Maybe, we should include the parts from the class reference so that we do not forget updating the docs when changing a component. |
I finally came around to check back into this and I can't follow your calculations @Bachibouzouk. The pivotal point is that, as far as I can see,
using
replacing
For c_0 we start from:
Using
and by replacing
From this, I gather the following things:
this is the way it was last implemented. That way,
|
I think, we should have an online meeting about the future structure of the |
I had a chat with a colleague, we concluded that it would be best to give slope ("m") and abscissa ("b") but in normalised coordinates just as min/max. This way, investments would be directly scale the |
Could you elaborate what you mean with
|
Sure. The values for The documentation of the
Instead, we would have:
(Now I realise that this definition means that it would be sufficient to just give one parameter because the rest of the information would be in the Flows.) Example: A heat pump with a COP of 3 at full load would have (Currently, it can happen that it has no effect if the |
With some distance, I'd now suggest something else:
|
In trying to fix a which I thought was a bug, I ended up completely reworking the
|
Describe the bug
In the usage documentation for the OffsetTransformer an example is given to calculate the coefficients
c0
andc1
. If calculated like this, the results are illogical. I narrowed it down to the calculation ofc0
, 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 bec0 = P_out_max-c1*P_in_max
).Possible solutions
I see two possible solutions:
OffsetConverterBlock
to not multiply with thestatus_nominal
(which is the product ofP_max(t) * Y(t)
) but with thestatus
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.
The text was updated successfully, but these errors were encountered: