A general formulation for a mathematical PEM fuel cell model