-
Notifications
You must be signed in to change notification settings - Fork 134
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
Upgrade OffsetConverter #895
Upgrade OffsetConverter #895
Conversation
Reformulate the required constraints for the `OffsetConverter` based on the restructured flow. Apply `NonConvex` and `Investment` attributes only to the output flow.
Add a new example for modeling an `OffsetConverter` with both `NonConvex` and `Investment` attributes.
Modify the existing constraint test for the `OffsetConverter` for the case it only has the `NonConvex` attribute.
Add a new constraint test for the `OffsetConverter` with both `Investment` and `NonConvex` attributes.
Modify the existing component tests and add new ones based on the new structure of the flow, which enables the use of both `NonConvex` and `Investment` attributes for `OffsetConverter`.
Can anyone please help me with the |
Thanks for the super nice explanations!
I am facing the same problem over at https://github.com/oemof/tespy. I have only found, that a recent pytest version is incompatible with tox in specific setups. See pytest-dev/pytest#10420. |
#897 solves the issue. You can wait for that branch to be merged in dev and then merge dev in your branch :) |
Correction, the changes had already been implemented in dev, I just overlooked it. So merging the current dev should work already ;). |
@p-snft - so as you mentionned in #900 (comment), we could make a prerelease with this PR ? Is there a place where the (pre) release protocol is documented? I looked across the README, CONTRIBUTING files as well as in the RTD and searched for "release" in the whole repo but could not find a protocol. Should this PR still point toward I plan to merge the latest stand of |
There is no formal process to have a pre-release but I think it is common sense that they should not be inconsistent. I think, this is easily achieved if we crate releases just from the version branch (e.g. The alternative would be to either have more version branches, like PS: Renaming Transformer to Converter is planned for v0.5.1, so the PR can keep it's target. |
Explanation:
Based on the new structure of flows according to #826 and #856, the model for the
OffsetConverter
can be improved significantly. So far, this component could ONLY take theNonConvex
attribute. This means it was assumed that the component had already been optimized and the nominal capacity was known. However, the component’s real efficiency curve and its (probably) less-efficient operation in part-load could not be considered in the optimization until now.Thanks to the new structure of the
Flow
, which enables the combination ofNonConvex
andInvestment
attributes, these parameters can now be part of the optimization. The following example shows that the results obtained from the previous optimization (applied to theConverter
) and the new one (applied to theOffsetConverter
) are considerably different.Another change suggested in this PR is the definition of the
NonConvex
andInvestment
attributes. In the previous version of theOffsetConverter
, theNonConvex
attribute had to be defined for the input flow, but in the new model proposed in this PR, it must be defined for the output flow (see #861 for more information).Example:
As an example, the efficiency and load duration curves of a diesel genset are shown, which are obtained from different optimization methods. As explained before, previously, it was only possible to use the
Converter
for obtaining the optimal size of a component, but restructuring the flow provided the possibility to use theOffsetConverter
for obtaining the optimal capacity.As seen in the figures, the diesel genset has a minimum and maximum load of 20 and 100%. The
Converter
component takes a constant efficiency as an input (here 33%), but theOffsetConverter
component deals with the efficiency curve of this component, which is obtained using the minimum and maximum loads and efficiencies.It can be seen that the optimal size of the diesel genset when the
OffsetConverter
is used is around 8% smaller. The reason is that since this component is not operating efficiently at low loads, instead of having a larger capacity and operating at low loads, the optimizer tries to reduce the capacity so that it does not have to operate inefficiently at very low loads. This can be seen in the diagrams very clearly. On the right side, where theConverter
is used to model the diesel genset, since the efficiency is assumed constant, in approximately 15% of the annual operation of this component, it operates at the minimum load. However, as seen on the left side, theOffsetConverter
does not allow the diesel genset to operate at the minimum load.