The Moon rotates once every ~29.5 Earth days, so any surface site gets ~14.75 days of continuous sunlight followed by ~14.75 days of continuous darkness — nothing like Earth's 24-hour cycle. A solar array can only charge while the Sun is up; through the whole lunar night it produces zero power.
battery(t+dt) += (solarInput − systemLoad) · dt
freeze if battery == 0 during night → heaters die → temp drifts to ambient
RTG: output = const, day/night makes no difference
- Battery capacity — total energy buffer. Too small and it empties partway through the 14.75-day night.
- Solar panel size — bigger array = faster daytime recharge, but only while the Sun is above the horizon.
- RTG mode — a radioisotope generator outputs a small, constant trickle of power, day or night, at the cost of far less total power than solar during daytime.
Real-world application: this exact sizing problem shaped Apollo, Chang'e and Artemis-era lander designs — many small landers simply power down and accept a "lunar night" without heaters; long-lived rovers either carry a big enough battery bank or, like the Curiosity/Perseverance rovers on Mars, use an RTG instead.