ams.core.service.RampSub#

class ams.core.service.RampSub(u: Callable, name: str = None, tex_name: str = None, unit: str = None, info: str = None, vtype: Type = None, rfun: Callable = None, rargs: dict = None, no_parse: bool = False, sparse: bool = False)[source]#

Build a substraction matrix for a 2D variable in the shape (nr, nr-1), where nr is the rows of the input.

This can be used for generator ramping constraints in multi-period optimization problems.

The subtraction matrix is constructed as follows: np.eye(nr, nc, k=-1) - np.eye(nr, nc, k=0).

Parameters:
uCallable

Input.

horizonCallable

Horizon reference.

namestr

Instance name.

tex_namestr

TeX name.

unitstr

Unit.

infostr

Description.

vtypeType

Variable type.

modelstr

Model name.

sparse: bool, optional

True to return output as scipy csr_matrix.

__init__(u: Callable, name: str = None, tex_name: str = None, unit: str = None, info: str = None, vtype: Type = None, rfun: Callable = None, rargs: dict = None, no_parse: bool = False, sparse: bool = False)[source]#

Methods

assign_memory(n)

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

get_names()

Return name in a list

parse()

Parse the parameter.

update()

Update the Parameter value.

Attributes

class_name

Return the class name

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