linopy.model.Model.add_objective#
- Model.add_objective(expr, overwrite=False)#
Add a linear objective function to the model.
- Parameters:
expr (
linopy.LinearExpression
) – Linear Expressions describing the objective function.overwrite (
False
, optional) – Whether to overwrite the existing objective. The default is False.
- Returns:
linopy.LinearExpression
– The objective function assigned to the model.