set p_nom_max for the grid, not the node

39 views
Skip to first unread message

Elias Althoff

unread,
Oct 19, 2022, 2:39:35 PM10/19/22
to pypsa
Dear all,

im trying to find the nodes in my network, which optimaly integrate additional renewable energies. Basically I want to answer the question: Where can I install renewable capacities leading to the least bottlenecks in the grid.

My approach is setting p_nom_extendable to True and see where the solver is expanding the capacities most. But until now I couldnt find the balance in my parameters, so that I get realistic results. Most of the times the solver just builds all the capacities possible and then curtails huge amounts of energies, just picking the hours of generation it needs. I already limited the p_nom_max, but there still is a huge amount of curtailment.

So now I had the Idea of limiting the total expansion of capacity. Not for each node, but for the whole grid, so that the solver "chooses" more carefully where to expand.

Is setting a parameter like that possible? Do you have other Ideas how to solve my problem? Can I maybe assign costs to curtailment?

best wishes,
Elias

Fabian Neumann

unread,
Oct 19, 2022, 3:01:54 PM10/19/22
to pypsa
Hi Elias,

you could just write a small extra_functionality that limits the total sum of capacities for one carrier. You could also write an addition to the objective function there that assigns a cost to curtailment. This should be a linear expression.

But I don't know if this is necessary. As long as there are investment costs associated with the renewables, the model would try to push down the curtailment as much as possible (trade-off between storage and building extra-capacity). So your high curtailment indicates that maybe your model doesn't have many storage options?

Best wishes,

Fabian

Elias Althoff

unread,
Oct 26, 2022, 4:41:10 AM10/26/22
to pypsa
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:

    ## Define technoloy capacity variables ##

    def gen_p_nom_bounds_tech(model, tech_name):
        return (network.technologies.at[tech_name,"p_nom_min_technology"],
                network.technologies.at[tech_name,"p_nom_max_technology"]

    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
Reply all
Reply to author
Forward
0 new messages