GMLC-1-4-2 / battery_interface

Implemenation of Device Models and their Battery Equivalent Interface
MIT License
5 stars 0 forks source link

Discretized frequency response - EV fleet #58

Closed afernandezcanosa closed 5 years ago

afernandezcanosa commented 5 years ago

Hi @emayhorn @Hayden-Reeve @jmaguire1 @DavidWiniarski-pnnl @hlngo @yliu250

I have implemented a discretized version of the frequency response for the EV fleet. I have to keep testing it to minimize discretization error, but I will be able to finish a PR this afternoon.

Here you can see some preliminary results with randomized deadbands between 0.05 and 0.25.

frequency_response_ev_discretization_1

Also, I have two questions that I'd like to comment with you:

Thanks!

Hayden-Reeve commented 5 years ago

@afernandezcanosa

Thanks for posting the great results. To answer your questions:

1) When the grid frequency reduces <60 Hz (typically due to loss of generating capacity) the load on the grid should decrease and the fleet should reduce charging and inject power into the grid (compared to baseline). Hence service power should be positive. For >60Hz the opposite is true.

2)I agree that the result looks good (we may want to study and tweak the dead-band). I think this result is great for now. Once @yliu250 has performance metrics we could do some runs to show that a X% increase in number of fleet members does not change the performance metric score by Y%.

Finally, will your PR include the code you used to store the data and plot it? If not could you share it as I plan to work with Yuan to standardize this in the service and hopefully have standardized post-processing library for all services.

afernandezcanosa commented 5 years ago

@Hayden-Reeve Thanks for the response. I'll change my fleet according to your first answer and see what are the best dead-band parameters.

I will also add the initial time in the fleet request as it has been done in the PV fleet. The availability of the fleet is one of the most important aspects to study in this fleet.

Regarding the last question, I can include the script that I have used to plot the frequency responses. Also, what kind of performance metrics are you planning to include for this particular service? Just to know what kind of plots I should include.

Hayden-Reeve commented 5 years ago

@afernandezcanosa , I still need to close with @yliu250 on performance metrics. Will be discussed in the meeting tomorrow as well.

afernandezcanosa commented 5 years ago

@Hayden-Reeve @yliu250 I have changed the sign convention to be consistent with the normal grid demands when there are frequency deviations and include it in my PR #46

I am satisfied with the results at this time, but we may need to implement a more elegant solution in the future (please note that 60 - f is represented in red to have the same trend in both the power and the frequency).

discretized_freq_response

Please, feel free to reference #46 for the rest of discrete device developers in case they want to develop a similar solution. I have also included a test_autonomous_response.py file to plot the results and confirm that everything works fine.

Thanks!

Hayden-Reeve commented 5 years ago

@jmaguire1 @ORNLJD

When implementing autonomous frequency response please reference the implementation by @afernandezcanosa in PR #46 , particularly implementing randomized frequency thresholds:

https://github.com/afernandezcanosa/battery_interface/blob/f72d946a8fa85237c4b431a41d26dda034a419b5/src/fleets/electric_vehicles_fleet/electric_vehicles_fleet.py#L173-L193

@yliu250 , please leverage the post-processing graph he created as well:

https://github.com/afernandezcanosa/battery_interface/blob/f72d946a8fa85237c4b431a41d26dda034a419b5/src/fleets/electric_vehicles_fleet/test_autonomous_response.py#L63-L73

afernandezcanosa commented 5 years ago

@Hayden-Reeve it is normally easier to reference parts of the code directly by using permalinks like this one for the discrete frequency response implementation:

https://github.com/GMLC-1-4-2/battery_interface/blob/75e94ffd8916affd45f106ac4b9093a6be20a3e6/src/fleets/electric_vehicles_fleet/electric_vehicles_fleet.py#L192-L193

For the post-processing part, see:

https://github.com/GMLC-1-4-2/battery_interface/blob/75e94ffd8916affd45f106ac4b9093a6be20a3e6/src/fleets/electric_vehicles_fleet/test_autonomous_response.py#L63-L73

This way you can see the file where the code is placed, the path, the commit number, and the code itself. I hope this helps!

Hayden-Reeve commented 5 years ago

@afernandezcanosa , those are the permalinks in my comment. I am not sure they are not previewing and displaying correctly. It worked in other posts (like #53 ). Let me know if you have any suggestions on why it may not be showing up correctly. [Edit: I think it may be because I referenced your fork rather than the pull request version - will check]

afernandezcanosa commented 5 years ago

Exactly, permalinks only work if you reference some master branch code.