ams.core.service.MinDurInit#

class ams.core.service.MinDurInit(u: Callable, td: Callable, tau0: Callable, ug0: Callable, match: int, name: str = None, tex_name: str = None, unit: str = None, info: str = None, vtype: Type = None, no_parse: bool = False, sparse: bool = False)[source]#

Build the initial-state coefficient matrix for UC minimum on/off duration. Pairs with MinDur to close the boundary the interior window-sum cannot reach: a unit's history before t=1 decides how many leading periods are locked.

Returns M[g, t] = 1 iff t < L[g] and ug0[g] == match (else 0), where:

L[g] = max(0, ceil((td[g] - tau0[g]) / Δt))

Concrete usage in UC:

  • on-side (must stay ON from history): td=td1, tau0=ton0, match=1; paired with constraint M * (1 - ugd) <= 0.

  • off-side (must stay OFF from history): td=td2, tau0=toff0, match=0; paired with constraint M * ugd <= 0.

Note: like MinDur, inherits the parameter-plumbing of NumOpDual only; fun/rfun are unused. Extra inputs (tau0, ug0, match) are stored as plain attributes and consulted by .v.

Parameters:
uCallable

Var with horizon — used for shape (n_gen, n_ts) only.

tdCallable

RParam — minimum on/off duration (td1 or td2).

tau0Callable

RParam — initial elapsed on/off time (ton0 or toff0).

ug0Callable

RParam — initial commit status (ug); flattened to 1D before comparison.

matchint

Gate value: 1 for on-side, 0 for off-side.

name, tex_name, unit, info, vtype, no_parse, sparseoptional

Forwarded to MinDur / NumOpDual.

__init__(u: Callable, td: Callable, tau0: Callable, ug0: Callable, match: int, name: str = None, tex_name: str = None, unit: str = None, info: str = None, vtype: Type = None, no_parse: bool = False, sparse: bool = False)[source]#

Methods

assign_memory(n)

Assign memory for self.v and set the array to zero.

evaluate(*args, **kwargs)

get_all_idxes()

Return all the indexes of this item.

get_idx()

get_names()

Return name in a list

parse(*args, **kwargs)

update()

Update the Parameter value.

Attributes

class_name

Return the class name

e

Return the calculated numerical value of the underlying expression.

formulation_source

Where the live CVXPY object for this item came from.

n

Return the count of values in self.v.

shape

Return the shape of the service.

size

Return the size.

v

Value of the service.

v0

v1