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

make battery heuristic general so other generation tech besides wind and pv can use the heuristic #377

Merged
merged 7 commits into from
Oct 23, 2024

Conversation

jaredthomas68
Copy link
Collaborator

…and pv can be used

Generalize heuristic load following to any gen tech

This PR allows any technology to be dispatched with the load following heuristic, not just wind and pv.

Related issue

Impacted areas of the software

hopp/simulation/technologies/dispatch/hybrid_dispatch_builder_solver.py

Additional supporting information

This came up while working on the profast financial model and needs to get merged in prior to the financial model work

Test results, if applicable

Passing

Copy link
Collaborator

@genevievestarke genevievestarke left a comment

Choose a reason for hiding this comment

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

Looks good to merge to me!

@@ -674,12 +674,12 @@ def simulate_with_dispatch(

def battery_heuristic(self):
tot_gen = [0.0] * self.options.n_look_ahead_periods
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this be simplified to the following?

tot_gen = np.zeros(self.options.n_look_ahead_periods)
for power_source in self.power_sources.keys():
    if "battery" in power_source or "grid" in power_source:
        continue
    tot_gen += self.power_sources[power_source].dispatch.available_generation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes and done

Copy link
Collaborator

@RHammond2 RHammond2 Oct 22, 2024

Choose a reason for hiding this comment

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

It looks like this is missing from above the for loop: tot_gen = np.zeros(self.options.n_look_ahead_periods). If you iteratively add a list, it'll just be a really long list.

Copy link
Collaborator Author

@jaredthomas68 jaredthomas68 Oct 22, 2024

Choose a reason for hiding this comment

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

Good catch. I'm not sure numpy will work without having knock-on effects, but I'll try it

wave_resource_file = ROOT_DIR / "simulation" / "resource_files" / "wave" / "Wave_resource_timeseries.csv"

desired_schedule=desired_schedule = 8760*[20]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like there is an extra desired_schedule= here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, fixed

@jaredthomas68 jaredthomas68 merged commit 08e3175 into NREL:develop Oct 23, 2024
4 checks passed
@jaredthomas68 jaredthomas68 deleted the feature/generalize-dispatch branch October 23, 2024 01:55
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.

4 participants