Science and stories are not only compatible, they're inseparable, as shown by Einstein's classic 1905 paper on the photoelectric effect
The Puzzle of Dwarvish Work
Einstein's paper on the photoelectric effect, published that fecund
year, was singled out by the 1921 Nobel Committee (late as usual,
and perhaps still afraid of relativity) as the basis for their
award. It is also the only one of the 1905 papers that Einstein
himself deemed revolutionary. But when one reads the article, the
photoelectric effect appears late, as a denouement; the paper begins elsewhere.
The unwritten prologue is the contemporary interest in black-body
radiation—the tendency of any object, no matter what its
composition, to radiate light when it is heated. We see it in iron
nestled in the forge, glowing red, then yellow, then white.
The intensity of this emitted light varies with the color
(wavelength). At low temperatures, bodies radiate in the infrared.
As the temperature rises, the maximum intensity of the radiated
light moves into the red, then extends through the spectrum to the
ultraviolet. At high temperatures, objects radiate intense light
across the visible spectrum—that's white heat. The intensity
of radiated light diminishes in the extreme ultraviolet and far
infrared (see right). Astronomers estimate the temperatures
of stars from just such curves.
The standard (and eminently successful) understanding of light in
Einstein's day came from James Maxwell's electromagnetic theory.
Coupled with thermodynamics and the kinetic theory of gases—a
high expression of Newtonian mechanics—electromagnetic theory
led to a "radiation law" that described how the intensity
of light varied with wavelength at each temperature. The law fit the
data—at long wavelengths. At short wavelengths, the equation
derived from electromagnetic theory failed, in what became known as
"the ultraviolet catastrophe."
In 1900, Max Planck found an expression that fit over the entire
range of observations. Planck further perceived that his accurate
radiation law could be obtained only if the energies of the little
bits of oscillating charge that caused the light (he called them
"resonators") assumed discontinuous values. So the quantum
Planck had trouble believing that physics was, deep down,
discontinuous. He spent many years searching for a way around what
he discovered. But that is another story.