The GEM model is implemented in Python 3.11 and the minimization problem is solved using scipy.optimize.minimize 35 with the method SLSQP 36 , as it allows to use both bounds and constraints. Bounds for each 𝑛 are defined through the number of the respective elements that are present in the system. Additionally, the element balance is implemented as an equality constraint according to eq. ( ).