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
MinDurto 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] = 1ifft < L[g]andug0[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 constraintM * (1 - ugd) <= 0.off-side (must stay OFF from history):
td=td2,tau0=toff0,match=0; paired with constraintM * ugd <= 0.
Note: like
MinDur, inherits the parameter-plumbing ofNumOpDualonly;fun/rfunare 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 (
td1ortd2).- tau0Callable
RParam — initial elapsed on/off time (
ton0ortoff0).- ug0Callable
RParam — initial commit status (
ug); flattened to 1D before comparison.- matchint
Gate value:
1for on-side,0for off-side.- name, tex_name, unit, info, vtype, no_parse, sparseoptional
- __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 for
self.vand set the array to zero.evaluate(*args, **kwargs)Return all the indexes of this item.
get_idx()Return name in a list
parse(*args, **kwargs)update()Update the Parameter value.
Attributes
Return the class name
Return the calculated numerical value of the underlying expression.
Where the live CVXPY object for this item came from.
Return the count of values in
self.v.Return the shape of the service.
Return the size.
Value of the service.