Except where otherwise noted, this content is Copyright (c) 2020, RTE and licensed under a CC-BY-4.0 license.
Welcome to the next tutorial !
We will discover why hadar use cost and how to use it.
Hadar is an adequacy optimizer, like every optimizer it needs cost to determinie the best solution. In hadar, the cost to optimize represent a kind of cost needed to perform network adequacy. Than means Hadar will always try to: - use the cheaper production - use the cheaper path inside network - if hadar can’t match consumption asked, it will turn off cheaper unavailable consumption cost
Let’s start an example with a single node, there are 3 types of productions: solar, nuclear, oil. We want to use first all solar, then switch to nuclear and use oil only as last chance. To see production prioritize, we attach a growing consumption to this node.
import numpy as np import hadar as hd
study = hd.Study(horizon=30)\ .network()\ .node('a')\ .consumption(name='load', cost=10**6, quantity=np.arange(30))\ .production(name='solar', cost=10, quantity=10)\ .production(name='nuclear', cost=100, quantity=10)\ .production(name='oil', cost=1000, quantity=10)\ .build() # tips: If you give just one element, hadar will extended it according horizon size and scenario size
optimizer = hd.LPOptimizer() res = optimizer.solve(study)
agg = hd.ResultAnalyzer(study=study, result=res)
plot = hd.HTMLPlotting(agg=agg)
plot.network().node('a').stack()