Using an electricity storage for balancing energy

Hi @pschoen,

thank you very much for your quick response, and your help.
Unfortunetly my problem is bigger than I thought.
For better understanding here is the graphic diagram of my energy system model:

The model involves multiple uses of an electricity storage system, including self-consumption optimization, peak-shaving, energy trading, and flexibility marketing on the balancing energy market. I may have made my model more complex than necessary, but after extensive troubleshooting, this is what I came up with.
The two storages are linked via the shared limit constraints, making them appear as one storage. In addition to the sources and sinks for energy trading on the right side, I want to implement the balancing energy market.
I tried implementing it with your idea and added the FCR as source with a minimum downtime of 4. I didn’t add the minimum downtime variable to the storage because the storage is also connected to the energy markets and should only have a downtime when its getting energy from the FCR. The aim was to limit the total flow of the FCR source to 1MWh within a 4-hour block or to limit the maximum runtime to 4 hours instead of the minimum downtime.

To clarify, I see two possible options:

  1. Create an FCR source with a minimum flow of 1MW and a maximum summed flow of 1MW, with a minimum downtime of 3 hours. The model can use the source for one time step, after which it is forced into a downtime for 3 time steps before it can be used again.
    A FCR sink is also required to sell the 1MWh energy within a 4-hour block.

  2. I could set up the storage I’m already using for the energy trading to only have a downtime of 4 hours if it gets energy from the FCR source. It is required that the State of Charge of the storage remains within certain boundaries. (like 40 to 60 %) Because I have to ensure that the storage could load 1 MWh and unload 1MWh in this time.

I hope it makes sense.
I think i wont get around a custom constraint - if it is even possible to model it this way. However, I am not familiar with setting up such a constraint or the underlying mathematics.

Do you have any additional ideas to solve this problem?

Cheers,
Nico