Your min parameter is greater than one (!). The max value is one by default. The variable is limited by its max and min. The variable has to be greater than
min * nominal value and (!) smaller than max * nominal_value.
That’s why it is infeasible.
All these parameters (min, max,…) are relative to the nominal value. The code below works for me!
In your case the nominal value is something like the installed capacity. This value should not be a list. It is better to use min/max as lists to reduce the installed capacity.
Use shortage and excess variables to avoid infeasible problems (see Solver time seems to be to high for a small energy model using oemof (solph) with CBC solver ). It is easier to find errors if some results exist.
import pandas as pd
import oemof.solph as solph
demand = pd.read_csv('data/demand.csv')
plants = pd.read_csv('data/plant_params.csv', index_col=0)
date_time_index = pd.date_range('1/1/2012', periods=len(demand),
freq='H')
solver = 'cbc'
energysystem = solph.EnergySystem(timeindex=date_time_index)
bfuel = solph.Bus(label="fuel")
bel = solph.Bus(label="electricity")
energysystem.add(bfuel, bel)
energysystem.add(solph.Source(label='fuel_source',
outputs={bfuel: solph.Flow(nominal_value=10e3,
variable_costs=1)}))
fixed_param = lambda val: [val for _ in demand.index]
for p in plants.index:
plant = plants.loc[p]
transf = solph.custom.OffsetTransformer(
label="plant{}".format(plant.name),
inputs={bfuel: solph.Flow(
nominal_value=400,
min=fixed_param(plant['Pmax'] / (plant['Pmin'] * 10)),
positive_gradient={'ub': plant['RU'], 'costs': 0},
negative_gradient={'ub': plant['RD'], 'costs': 0},
startup_costs=plant['SU'],
shutdown_costs=plant['SD'],
nonconvex=solph.NonConvex())},
outputs={bel: solph.Flow()},
coefficients=[[0, 0, 0], [1, 1, 1]])
energysystem.add(transf)
energysystem.add(solph.Sink(label='demand', inputs={bel: solph.Flow(
actual_value=demand['Demand'], fixed=True, nominal_value=1)}))
model = solph.Model(energysystem)
model.solve(solver=solver)