Dear Miguel,
yes, I can confirm that you may use the PyPSA components for modelling this system.
But, you should have a look into the documentation to understand how multilinks work.
In particular the example with biomass and synthetic fuels is very interesting:
Keep in mind that all inputs and outputs always work simultaneously, which means that you have to define every input and output relativ to the each other. For each Unit of hydrogen consumed from Bus 'H2' there is a relativ consumption of electricity being consumed from Bus 'electricity'.
In case of hydrogen you should bring it from kg to kWh.
Here is a example:
I assume that the compressor needs 8 kWh_electricity per 1 kg_hydrogen, then you know that per kWh hydogen you have an electricity demand of 0.24 kWh (8kWh_elec/33.3kWh_h2).
To define your multilink you don't need any power capacities or p_set, just define the compressor size (p_nom at bus0) and set all other efficiencies accordingly.
Since pypsa only knows multilinks with multiple outputs you have to set the efficiency for p3 to -0.24 ( negativ!) (as in my example) so that the link withdraws from the elctricity bus for each positiv power flow. The efficiency from bus p4 is als 0.24 so make sure the same amount of electricity leaves the multilink. Efficiency for bus p2 can be set to 1.
You must not set any power capacities nor p_set values for the links. This would hinder the optimization in controlling the compressor power (and nominal power capacity) endogenously.
Two further information:
1. You can set the multilink to extendable and add an investment price. This price is again depending on the power inflow add bus0 so it should be in €/(kWh_H2*a) or €/(kg_H2*a) (or something like that).
2. You can can set the generator at bus p4 to extendable, but this could need more calculation time than just using a very high exogenously set value (like 1000000). Also keep in mind to ensure that this generator consumes energy by setting "sign = -1".
I used this approach in a student project. So unfortunetly there is no publication you can refer to, but I would be very interested in seeing this model in action.
I hope that helps. Let me know if you need further information.
Bennet