def unit_capacity_constraint_rule(backend_model, loc_tech): """ Add upper and lower bounds for purchased units of a technology .. container:: scrolling-wrapper .. math:: \\boldsymbol{units}(loc::tech) \\begin{cases} = units_{equals}(loc::tech),& \\text{if } units_{equals}(loc::tech)\\\\ \\leq units_{max}(loc::tech),& \\text{if } units_{max}(loc::tech)\\\\ \\text{unconstrained},& \\text{otherwise} \\end{cases} \\quad \\forall loc::tech \\in loc::techs_{milp} and (if ``equals`` not enforced): .. container:: scrolling-wrapper .. math:: \\boldsymbol{units}(loc::tech) \\geq units_{min}(loc::tech) \\quad \\forall loc::tech \\in loc::techs_{milp} """ return get_capacity_constraint(backend_model, 'units', loc_tech)