Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Rolling max energy discharge limit on battery

Open in vLab iLab Assistant

This example demonstrates how the battery rolling_max_discharge_limit works. The constraints impose a maximum total energy discharge within predefined time periods. The functionality can be used to e.g. enforce a maximum number of battery cycles within 24 hours.

The model setup for this example is available here:

Create SHOP session and import basic model

This example model has one battery that is connected to a busbar.

We will add rolling max discharge constraints that limit the battery energy discharge to maximum 2 MWh within each 2 hour time window.

Run model without rolling discharge constraints

We start by running the model without any rolling max discharge constraints on the battery, and plot the results.

The upper plot shows the battery discharge for every time step within the optimization period. The lower plot shows the total energy discharge within each consecutive 2 hours, which is what the max rolling discharge limit will constrain. As the plot shows, without the rolling max discharge constraints, the total energy discharge is larger than the limit for all of the time intervals.

Loading...
Loading...

Add rolling max discharge constraints and rerun model

We will now add the max rolling discharge constraint to our battery. We also add historical battery discharge data through the historical_discharge attribute, which affects the constraints for the first few time steps. We then rerun the model.

The upper plot shows that the discharge is lower than before applying the constraints. For the first few time steps, there is no battery discharge, due to the historical discharge data. The lower plot shows that now, the total discharge is within the maximum limit for all 2 hour time windows.

Loading...
Loading...