Modeling and diagnostics of polymer electrolyte fuel cells