linopy.variables.Variable.to_linexpr

linopy.variables.Variable.to_linexpr#

Variable.to_linexpr(coefficient=1)#

Create a linear expression from the variables.

Parameters:

coefficient (array-like, optional) – Coefficient for the linear expression. This can be a numeric value, numpy array, pandas series/dataframe or a DataArray. Default is 1.

Returns:

linopy.LinearExpression – Linear expression with the variables and coefficients.