RoutineBase.update#

RoutineBase.update(params=None, build_mats=True)[source]#

Update the values of Parameters in the optimization model.

This method is particularly important when some RParams are linked with system matrices. In such cases, setting build_mats=True is necessary to rebuild these matrices for the changes to take effect. This is common in scenarios involving topology changes, connection statuses, or load value modifications. If unsure, it is advisable to use build_mats=True as a precautionary measure.

Parameters:
params: Parameter, str, or list

Parameter, Parameter name, or a list of parameter names to be updated. If None, all parameters will be updated.

build_mats: bool

True to rebuild the system matrices. Set to False to speed up the process if no system matrices are changed.