Skip to content
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

Added dynamic function parameter to get_profiles function #21

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

busiing
Copy link
Member

@busiing busiing commented Apr 17, 2020

Dynamic_function_h0 is an optional parameter. Default = True
Fixed minor typos

Closes #17

Dynamic_function_h0 is an optional parameter. Default = True
Fixed minor typos
@uvchik uvchik self-requested a review May 13, 2020 08:57
ann_el_demand_per_sector), axis=1).dropna(how='all', axis=1) * 4
if dyn_function_h0 == True:
quartersinyear = len(self.slp_frame)
for quarter in range(quartersinyear):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way of doing it is rather inefficient. You should rather calculate an array of all smoothing factors and multiply the SLP by that. The following might work (did not verify):

day_of_year = [(quarter + 1) / (24 * 4) for quarter in range(len(self.slp_frame))]
smoothing_factor = [-3.916649251 * 10 ** -10
                                   * timestep ** 4 + 3.2 * 10 ** -7
                                   * timestep ** 3 - 7.02 * 10 ** -5
                                   * timestep ** 2 + 0.0021
                                   * timestep + 1.24 for timestep in day_of_year]
self.slp_frame['h0'][quarter] = self.slp_frame['h0'] * smoothing_factor

(Or - preferably - using numpy.)

Copy link
Member

@p-snft p-snft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works, but might be more efficient.

@p-snft p-snft merged commit 5a549a9 into oemof:master Jul 15, 2020
@p-snft p-snft mentioned this pull request Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing dynamisation function for electric load profiles
2 participants