Hi everyone!

I am working on a problem to model a hydrogen system with a PEM electrolyzer, storage and fuel synthesis unit in Oemof. I want to model the part-load behavior of an electrolyzer using an offset transformer or a Piece-wise linear Transformer? My goal is also to determine the optimal capacity using the investment mode. Which kind of Transformer is better suited for this application?

Currently, I am using piece-wise linear transformer to model this electrolyzer. I am confused on how to model the in-break points and conversion factor so that for input electricity at each corresponding load point and efficiency, the output hydrogen is produced.

After defining sources, sinks, max. capacity for electrolyzer (testing without investment mode), is the following approach correct? (I found it in SMOOTH, that is based on oemof):

```
# Define the maximum capacity of the electrolyzer
max_capacity = 100e6 # 100 MW
# Define the load points and corresponding efficiencies
bp_load_h2_prod = [0, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1]
bp_eff_h2_prod = [0, 0.10, 0.50, 0.66, 0.71, 0.67, 0.63, 0.585, 0.545, 0.52, 0.51]
lower_heating_value = 33.3 # lower heating value in kWh/kg
bp_elec_consumed_h2_prod = [this_bp * max_capacity
for this_bp in bp_load_h2_prod]
bp_h2_production = []
for i_bp in range(len(bp_load_h2_prod)):
this_hydrogen_production = \
(bp_elec_consumed_h2_prod[i_bp]
* bp_eff_h2_prod[i_bp]) / (lower_heating_value)
bp_h2_production.append(this_hydrogen_production)
def get_h2_production_by_electricity(electricity_consumption):
"""Gets the hydrogen produced by the according electricity consumption
value.
:param electricity_consumption: electrcity consumption value [kWh]
:return: according hydrogen production value [kg]
"""
# Check the index of this load point.
this_index = bp_elec_consumed_h2_prod.index(electricity_consumption)
return bp_h2_production[this_index]
# Create and add PiecewiseLinearTransformer
pem_ely = solph.components.experimental.PiecewiseLinearTransformer(
label="pem_ely",
inputs={b_el: solph.flows.Flow(nominal_value=100000, variable_costs=1)},
outputs={b_h2: Flow()},
in_breakpoints=bp_elec_consumed_h2_prod,
conversion_function=get_h2_production_by_electricity,
pw_repn='CC')
energysystem.add(pem_ely)
```

@pschoen I see that you are currently active on oemof posts. May be you can comment on this!

Thanks in advance!

Nouman