Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Technology uptime & downtime limits #135

Closed
brynpickering opened this issue Aug 20, 2018 · 1 comment
Closed

Technology uptime & downtime limits #135

brynpickering opened this issue Aug 20, 2018 · 1 comment
Assignees
Labels
constraint New constraint request

Comments

@brynpickering
Copy link
Member

Problem description

From Gitter:

@FLomb:

in my case it would make sense not only to have availability factors (i.e. to model forced shutdown periods for maintanance etc.) but also some "minimum hours of operation" constraints

@pmmeyourmodel:

Would it make sense to have a availability factor variable which represents the maximum amount of time a plant is able to run during one year, so a value between 0 and 1? This would give the user the option to model planned o&m downtimes of plants

Steps to introduce constraints

Code snippet from Calliope 0.5.x that needs to be updated to 0.6.x and incorporated into the core code:

def startup_count(model):
    """
    modulation of chp.

    Depends on: operating_units

    """
    m = model.m
    # New set
    loc_tech_startup = [loc_tech for loc_tech in model._sets['loc_tech'] if
        model.config_model.techs.get_key(loc_tech.split(':', 1)[1] +
            '.constraints.startups.max', False
        )
    ]
    m.loc_tech_startup = po.Set(initialize=loc_tech_startup,
                                ordered=True)
    # Auxiliary Variable
    m.is_modulating = po.Var(m.loc_tech_startup, m.t,
                                  within=po.NonNegativeReals)

    # Constraint rules
    def c_modulation_rule(m, loc_tech):
        location, technology = loc_tech.split(":", 1)
        # e_ramping: Ramping rate [fraction of installed capacity per hour]
        modulation_startups = model.config_model.techs.get_key(
            technology + '.constraints.startups.max', False
        )
        startups = sum(m.is_modulating[loc_tech, t] for t in m.t)
        return startups <= modulation_startups

    def c_is_modulating_rule(m, loc_tech, t):
        # first timestep
        if m.t.order_dict[t] == 0:
            return (m.is_modulating[loc_tech, t] >= m.operating_units[loc_tech, t])
        else:
            return (m.is_modulating[loc_tech, t] >=
                    m.operating_units[loc_tech, t] -
                    m.operating_units[loc_tech, model.prev_t(t)])

    # Constraints
    m.c_startup = po.Constraint(m.loc_tech_startup, rule=c_modulation_rule)
    m.c_is_modulating = po.Constraint(m.loc_tech_startup, m.t,
        rule=c_is_modulating_rule)
@brynpickering brynpickering added constraint New constraint request and removed enhancement labels Oct 5, 2018
@brynpickering brynpickering changed the title [New constraint] Technology uptime & downtime limits Technology uptime & downtime limits Oct 5, 2018
@sjpfenninger sjpfenninger added this to the 0.6.4 milestone Oct 26, 2018
@sjpfenninger sjpfenninger modified the milestones: 0.6.4, 0.6.x Mar 25, 2019
@sjpfenninger sjpfenninger removed this from the 0.7.0 milestone Nov 3, 2021
@brynpickering
Copy link
Member Author

Example provided for how you would do this in new custom math as of #502 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
constraint New constraint request
Projects
None yet
Development

No branches or pull requests

2 participants