Hi Fabian,
you were right, the storages were part of the problem. I fixed that and it works better now, thanks.
But the Idea of limiting the expanision / setting a target value for each technology is very interesting and Im trying to pursue that. I looked into the source code and I would probably have to insert it into the opf.py file right?
I found the part in which p_nom_max is defined. I am now tying to add an extra constraint, so that the sum of p_nom is lower than my p_nom_max_technology.
This is the code already in opf.py:
## Define generator capacity variables if generator is extendable ##
def gen_p_nom_bounds(model, gen_name):
return (
network.generators.at[gen_name,"p_nom_min"],
network.generators.at[gen_name,"p_nom_max"])
network.model.generator_p_nom = Var(list(extendable_gens_i),
domain=NonNegativeReals, bounds=gen_p_nom_bounds)
free_pyomo_initializers(network.model.generator_p_nom)
My approach is now to add an extra component "Technology", in which I can insert the p_nom_technology_max and build an extra constraint for it, like:
network.model.technologies_p_nom = Var(list(extendable_gens_i),
domain=NonNegativeReals, bounds=gen_p_nom_bounds_tech)
free_pyomo_initializers(network.model.generator_p_nom)
Now, I would somehow have to add it into the optimization of p_nom for each generator, right? Im very unsure on how to insert the technology constraint into the generator constraint...
I was hoping maybe you have another hint for me on which way to pursue. Im kind of new to the optimization problems, so any help is appreciated.
Best wishes,
Elias