A regenerative fuel cell closes the electrolysis/fuel-cell loop to store solar power for spacecraft and surface bases that must survive long stretches of darkness — most notably the Moon's roughly two-week night, where a battery heavy enough to last would eat too much of the mission's mass budget. This simulator models the real power balance: during sunlight a PEM electrolyzer splits stored water into hydrogen and oxygen using surplus solar power, filling pressurized tanks visualized as instanced gas particles; once the sun sets, a fuel cell recombines that hydrogen and oxygen back into water, releasing electrical power to keep the load running. Tune the day/night cycle length, solar array size, constant load, round-trip efficiency and tank capacity to see whether the system survives a full night or brownouts before sunrise, with live readouts for stored hydrogen mass, net power flow, elapsed mission time and the fraction of load actually served.