Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

scenarios.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. from .consumption import *
  2. from .production import *
  3. from .storage import *
  4. import yaml
  5. class Scenario:
  6. def __init__(self,
  7. yearly_total = 645*1000,
  8. sources: dict = {},
  9. multistorage: dict = {},
  10. flexibility_power=0,
  11. flexibility_time=8
  12. ):
  13. self.yearly_total = yearly_total
  14. self.sources = sources
  15. self.multistorage = multistorage
  16. self.flexibility_power = flexibility_power
  17. self.flexibility_time = flexibility_time
  18. pass
  19. def run(self, times, intermittent_load_factors):
  20. # consumption
  21. consumption_model = FittedConsumptionModel(self.yearly_total)
  22. load = consumption_model.get(times)
  23. # intermittent sources (or sources with fixed load factors)
  24. intermittent_array = IntermittentArray(
  25. intermittent_load_factors,
  26. np.transpose([self.sources["intermittent"]])
  27. )
  28. power = intermittent_array.power()
  29. if self.flexibility_power > 0:
  30. flexibility_model = ConsumptionFlexibilityModel(
  31. self.flexibility_power, self.flexibility_time
  32. )
  33. load = flexibility_model.run(load, power)
  34. power_delta = power-load
  35. # adjust power to load with storage
  36. storage_model = MultiStorageModel(
  37. self.multistorage["capacity"],
  38. self.multistorage["power"],
  39. self.multistorage["power"],
  40. self.multistorage["efficiency"]
  41. )
  42. storage, storage_impact = storage_model.run(power_delta)
  43. gap = load-power-storage_impact.sum(axis=0)
  44. # further adjust power to load with dispatchable power sources
  45. dispatchable_model = DispatchableArray(self.sources["dispatchable"])
  46. dp = dispatchable_model.power(gap)
  47. gap -= dp.sum(axis=0)
  48. S = np.maximum(gap, 0).mean()
  49. return S, load, power, gap, storage, dp