pywr.parameters.control_curves.ControlCurveInterpolatedParameter¶
-
class
pywr.parameters.control_curves.ControlCurveInterpolatedParameter¶ A control curve Parameter that interpolates between three or more values
Return values are linearly interpolated between control curves, with the first and last value being 100% and 0% respectively.
Parameters: - storage_node : Storage
The storage node to compare the control curve(s) to.
- control_curves : list of Parameter or floats
A list of parameters representing the control curve(s). These are often MonthlyProfileParameters or DailyProfileParameters, but may be any Parameter that returns values between 0.0 and 1.0. If floats are passed they are converted to ConstantParameter.
- values : list of float
A list of values to return corresponding to the control curves. The length of the list should be 2 + len(control_curves).
Examples
In the example below the cost of a storage node is related to it’s volume. At 100% full the cost is 0. Between 100% and 50% the cost is linearly interpolated between 0 and -5. Between 50% and 30% the cost is interpolated between -5 and -10. Between 30% and 0% the cost is interpolated between -10 and -20
Volume: 100% 50% 30% 0% |----------------|--------|--------| Cost: 0.0 -5.0 -10.0 -20.0
>>> storage_node = Storage(model, "reservoir", max_volume=100, initial_volume=100) >>> ccs = [ConstantParameter(0.5), ConstantParameter(0.3)] >>> values = [0.0, -5.0, -10.0, -20.0] >>> cost = ControlCurveInterpolatedParameter(storage_node, ccs, values) >>> storage_node.cost = cost
-
__init__($self, /, *args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
Methods
afterbeforefinishget_all_valuesget_double_lower_boundsget_double_upper_boundsget_double_variablesget_integer_lower_boundsget_integer_upper_boundsget_integer_variablesget_valueloadlower_boundsregisterresetset_double_variablesset_integer_variablessetupunregisterupdateupper_boundsvalueAttributes
childrencommentcontrol_curvesdouble_sizeinteger_sizeis_variablemodelnameparentssizestorage_nodevalues