This article is reprinted with permission from Inside Science, an editorially independent news outlet of the American Institute of Physics, a nonprofit organization supporting the dissemination of science news and information to society.Andy Weir is a cruel god, and his work has just hit the big screen.In The Martian, his technically brilliant novel, Weir strands an astronaut named Mark Watney alone on Mars\u2014and then proceeds to pummel him with survival tests. How is he going to eat? How will he keep warm, amid average temperatures that hover around -55 degrees Celsius (-67 degrees Fahrenheit)? Even Mars' recently discovered briny flows would come to bear. "If I were writing again," said Weir, "they'd be a hazard\u2026That'd be cool."While the book and film adaptation\u2014which premieres today\u2014get compared to Robinson Crusoe and Apollo 13 on the grounds of surviving hostile conditions, another component often gets downplayed: the rescue. Crusoe gets off his island with the help of a British ship captain nearly deposed in a mutiny. Apollo 13 safely touches down on Earth because of the heroic joint efforts of the astronauts on board and mission control. And as the film's posters point out, it's one thing to see Watney (played in the movie by Matt Damon) survive. It's quite another to BRING HIM HOME.But how do the characters in The Martian escape the god of war\u2014and Weir?To answer this question, Inside Science partnered with an expert team to bring the spaceflight in The Martian to life, down to the rescue plan itself. When does The Martian take place in the real world? How would Watney's crewmates fly back to get him if at all? And could a real-world version of the Hermes, the interplanetary crewed spaceship in the book and film, actually pull off the maneuver?A final warning: This entire story constitutes one continuous, scientifically grounded spoiler. Beware.***Weir's attention to detail has become legendary. While writing The Martian, he calculated the number of calories necessary to feed a stranded astronaut, worked out how burning rocket fuel could yield liquid water, and responded to swarms of early readers, who fact-checked Weir's work with glee. He even built an orbital simulator patched together from the files of a video game he once coded. The bare-bones application, downloadable here from Weir's website (PC only), bears hints of its former life. One of the original game's characters, a pink infant ghost, serves as the simulator's icon.With simulator in hand, Weir set to work developing The Martian's unsung character: the calendar, which brutally determines everything from radio delays to the time his characters spent away from their loved ones on Earth. His first challenge? Picking a launch date using potatoes\u2014specifically, Thanksgiving potatoes."I needed their original mission to overlap Thanksgiving," says Weir, "so that I could have an excuse for to have potatoes." Thanksgiving falls within the Ares 3's month-long stay on the Martian surface, allowing Watney to scavenge the spuds and attempt to cultivate them. NASA has a longstanding policy of celebrating holidays such as Thanksgiving with upgraded meals. Weir also needed to sync the Ares 3 launch with an astronomical synod, an alignment of the sun, Earth and Mars that occurs every 780 Earth days. Weir's alignment hunting had nothing to do with astrology; time your launch with the synod, and your Mars mission can leave and return to Earth after efficiently orbiting the sun once. Missions ignoring planetary alignment would require either an absurd amount of propellant or years' worth of loop-de-loops to return to Earth.Cross-referencing future synods with a Thanksgiving Mars stopover eventually yielded an Ares 3 launch date of July 7, 2035. And the rest slowly, surely fell into place, as presented below in this exclusive Inside Science infographic (click for full view): A quick note: The Martian movie fiddles with the book's timeline. Watney is accidentally stranded on the Red Planet after a freak dust storm tears through the Ares 3 mission, forcing a mission abort. In the book, this catastrophe happens after six days on Mars. In the movie, however, eighteen days peacefully elapse before the perfect (and physically impossible) storm. There's a good reason, though, for the tweak. According to Weir, delaying the storm was critical for the plot to pass director Ridley Scott's smell test.In the book and film, Watney needs to make fertilizer for his potatoes, so he is forced to rehydrate and stir up his crewmates' abandoned solid waste. Scott wanted Watney's manure moment to really hit home."Ridley said, 'Well, six days' worth of output from six people isn't going to be that much,'" Weir recalled, so the film's writers bought Scott an extra dozen days of defecation.But for all his research, there was only so much Weir could do to make his spaceflight realistic for the book and film. The math necessary to optimize his mission was, in a word, "gnarly."What would happen, then, if professional mission designers picked up where Weir left off?***First things first: "rocket science" is synonymous with "obscene difficulty" for a reason. A given NASA mission might require a flight of billions of miles that could take months, if not years, to complete. Planets, moons and asteroids create gravitational gullies that alternately help or hinder your travel. And to top it all off, your spacecraft needs to be as light as possible, in order to get it into space at all.Thankfully, NASA has at its disposal a crack team of mission designers, who map out rockets' routes with stunning accuracy. NASA's wildly successful New Horizons probe, which flew by Pluto in July, covered over 3 billion miles to get out to the solar system's icy outskirts, coming within 45 miles of its ideal line. Yanping Guo, the mission's lead trajectory designer, had managed to pull off the equivalent of hitting a hole-in-one in Los Angeles from a tee box in New York City.To work similar magic on The Martian's trajectories, Inside Science reached out to Laura Burke and Melissa McGuire, two mission designers at NASA's Glenn Research Center. Not only have both sketched out plans for crewed Mars missions; they're also avid fans of the book and had wanted to put it to the test."We were really looking for an excuse to do something very fun and exciting," said Burke.At first blush, Weir's mission "is actually pretty sporty," said Burke. NASA's plans for crewed Mars missions typically take something on the order of 500 days, round-trip. Weir's regularly scheduled mission, however, takes about 400, in large part because of his massive spacecraft. (More on that in a bit.) But Weir's route is a comparative clunker up next to NASA's optimized Ares 3 mission."He cheated a little," she said.Burke's most efficient trajectory for the Hermes gets the Ares 3 crew to Mars on October 11, 2035, some 24 days earlier than Weir's arrival. From a fuel-economy perspective, choosing Burke's trajectory is a no-brainer. Her route requires about 30 fewer tons of propellant than Weir's, slashing the mission's engine use by 23 percent. Those savings multiply when you consider that fueling the Hermes requires blasting propellant into orbit\u2014and that those extra 30 tons could cost at least $120 million just to get up there, if we did it today.However, Burke's path has its drawbacks. Her optimized flight plan potentially dooms Mark Watney to a spudless Martian stay. If the Ares 3 crew only stayed on the Martian surface for 31 days, they'd celebrate Thanksgiving 2035 aboard the Hermes, regardless of whether or not the mission is aborted. But let's throw Matt Damon a bone here. In the optimized timeline, the Ares 3 crew could have planned to celebrate Veterans Day on their last day on Mars (November 11, 2035) with a meal including fresh potatoes. Two members of the Ares 3 crew are veterans (Commander Lewis and Martinez).Weir's flight plan has another hidden plus. Aborting the mission on Weir's Sol 6\u2014November 13, 2035\u2014 puts the Hermes on one of the most efficient possible return routes to Earth, saving most of the extra 30 tons of propellant. It turns out that those unlikely reserves are critical to pulling off the "Rich Purnell maneuver," a daredevil rescue of Watney spearheaded by one of Weir's characters, a genius, socially awkward NASA mission designer of the same name. In the clip below, you can see the film's Purnell (played by Donald Glover) explain his scheme to NASA higher-ups with the help of a stapler.The plan, a ballsy tour-de-force of trajectory design, adds 533 days and over 600 million miles to the Ares 3 crew's mission, but it allows the Hermes to double back to Mars, ultimately saving Watney's life. In fact, Purnell is one of the main reasons why McGuire and Burke are such big fans of the book. "The mission designers are heroes and save the day!" wrote McGuire.But does the math of Purnell's course check out?"The Rich Purnell maneuver is very interesting," says Burke. "If it were do-or-die, I think it would be a good way to go."That said, Purnell's celestial ballet is brutal on ship and crew alike. The trajectory heavily modifies the Hermes' return flight to Earth, cleverly using Earth's gravity to fling the Hermes by Mars mere weeks before Watney is scheduled to run out of food. The Hermes would scream by Mars at about 5.4 kilometers per second (12,000 mph), giving the Ares 3 crew a single chance to rendezvous 62 miles above Mars' surface with a rocket containing Watney.The stakes would be high. In Weir's and Burke's versions of the maneuver, both Watney and the Hermes havehyperbolic trajectories, flight paths that don't loop back to form closed orbits. In other words, the two would never cross paths again, all but dooming Watney to a frigid death if the Hermes missed. "From an orbital perspective, these rendezvous work," says Burke, "but they're very, very scary"\u2014the celestial equivalent of hitting a bullet with another bullet.Purnell's maneuver poses a second, more insidious risk. The path requires an uncomfortable amount of time inside Venus' orbit, "which is a big red flag," Burke says, because of the radiation emanating from the sun. When sketching out crewed Mars missions, NASA designers usually avoid coming within 75 million miles of the sun for this exact reason. But at its worst, Purnell's maneuver takes the Hermes within 45 million miles, roasting it with over four times the solar radiation that Earth receives\u2014without the planet's protective atmosphere and magnetic field. The Hermes' systems and electronics would probably be pushed to their limits, having not been designed with so much heating in mind. And the Ares 3 crew would assuredly face a higher cancer risk from 533 extra days of radiation exposure\u2014a danger never discussed in the book or movie.That said, the Ares 3 mission couldn't have picked a better time to fly the Rich Purnell maneuver, according to Don Hassler, a space radiation expert at the Southwest Research Institute in San Antonio, Texas. Around that time, the sun will be its solar maximum, a period of high activity that would inflate the heliosphere, the shroud of particles and gases around the sun. While these particles pose a radiation risk themselves, says Hassler, they'd actually shield the Hermes from nasty, high-energy cosmic rays. In all, the Ares 3 crew would likely face a ballpark radiation dose of 1 Sievert, about twenty times more than a nuclear reactor employee is likely to face in a year of work.Radiation, then, would be a risk but wouldn't be a deal-breaker. "If I were an astronaut and I was trying to rescue a colleague," said Hassler, "I'd be willing to accept that risk."Overall, the mission could be flown, but the only reason the maneuver works at all is because of the specs of Weir's Hermes. Could an actual spacecraft complete Weir's mission?***In Greek mythology, Hermes was the messenger of the gods, zooming here and there on magical, winged sandals.The Martian's Hermes is faced with a similarly staggering task: shuttle five Ares missions, including the ill-fated Ares 3, to and from Mars over the course of a decade, zooming along at tens of thousands of miles per hour. To figure out how this propulsion system worked, Inside Science turned to Alec Gallimore and Scott Hall, researchers at the University of Michigan's Plasmadynamics and Electric Propulsion Laboratory in Ann Arbor."The Martian kind of is the best-case scenario," said Hall, but as far as rockets go, the Hermes is physically plausible.No matter their build, all rockets work essentially the same way: shoot propellant in one direction, and the spacecraft goes the opposite way. (Thanks, law of conservation of momentum.) Rockets vary in what they spray out, how they spray it out, and how much oomph a given spritz packs. Chemical rockets such as the Apollo program's Saturn V are bombs with nozzles, zooming on the hot gases produced from burning fuels with liquid oxygen.But chemical rockets, which provide quick, powerful thrust, probably won't do for Weir's Hermes. Mars missions need tortoises instead of hares: slow, steady electric propulsion that can run for months at a time. When Weir wrote The Martian, he envisioned that the Hermes would have a mass of 110 metric tons and would accelerate continuously at 2 millimeters per second per second. The oomph required to do this wouldn't exactly give a passenger whiplash; the Hermes' 0-to-60 time would be over three-and-a-half hours. But if the Hermes put the pedal to the metal for weeks at a time, that slight acceleration could build up some serious speed.What engines would deliver this kind of performance? In the book and the simulations that Burke and McGuire ran, the Hermes uses a technology known as the Variable Specific Impulse Magnetoplasma Rocket, or VASIMR ("vas-meer"). The VASIMR technology heats gas into plasma and then magnetically shoots it out as propellant. On paper, VASIMR is fantastic tech. It allows for super-smooth throttling, and according to the company trying to make VASIMR, it could get a spacecraft to Mars in as little as 39 days."It's a great concept, and it'd be game-changing if it does work," said Hall.However, that's a major "if." VASIMR engines haven't been tested in space, and it's unclear if they'd be ready in time for the first Ares mission, which a teaser for the film pegs to the year 2029. They are also power hogs, straining credulity. Inside Science's VASIMR mockup of the Hermes gobbles over 17 megawatts of power, the appetite of 14,000 US households. "We don't usually assume VASIMR for a lot of what we do," said Burke.NASA has other options, though, if VASIMR doesn't work out. At the University of Michigan, Alec Gallimore and Scott Hall are building the world's most powerful Hall thrusters, a type of propulsion system that many satellites already use to stay in orbit.Hall thrusters use powerful magnets to confine electrons above a trench with a positively charged bottom. Starved of electrons, the trench immediately shears the electrons from gas particles pumped into the trench, leaving the particles positively charged. These positive particles then rocket out of the trench toward the negatively charged electrons hovering above them, generating thrust as they escape.The University of Michigan's X3 Hall thruster, the world's most powerful and the subject of Hall's current PhD research, can produce about 20 Newtons of thrust, similar to gravity's pull on a 5-pound bag of Martian potatoes. And like VASIMR, these highly efficient engines can operate for days, if not weeks, at a time. Based on Gallimore and Hall's calculations, an array of 30 next-gen X3s would be plenty to get the Hermes there and back.The added plus? The necessary Hall thruster already exists, more or less. Gallimore and Hall are currently putting the X3 through its paces in the laboratory. "I would love to have come to the lab and just show him that the technology described in the book is real," said Hall. "It works."So in theory, we could equip a Hermes with an engine capable of following the trajectory of The Martian, but we now run into a major problem. Frankly, we don't know how to power it.To get the performance that Weir's trajectories expect, the Hermes would definitely need an onboard fission nuclear reactor, perhaps supplemented with solar panels. But according to Chen-wan Yen, a renowned mission designer at NASA's Jet Propulsion Laboratory, the necessary reactor would probably be prohibitively large. "The disappointing reality always has been the massiveness of the power plant," she wrote. And there's that not-so-tiny issue of launching a nuclear reactor into space.In fact, NASA has effectively foresworn the nuclear (reactor) option, focusing its gaze on craft that would only use solar-powered systems. The Hermes, though, couldn't last on such measly electric morsels, particularly out near Mars, where the sun glows more dimly. Hall guesstimates that a purely solar-powered Hermes would have 200 kilowatts of power available for propulsion, a fraction of what it would need to complete the book and movie's trajectory. ***In other words, the map to Mars checks out, and the Hermes has a sufficiently beefy engine under the hood. We just need a fission reactor that's so impractically large, it fills up the entire passenger cabin. At present, Weir's Ares 3 mission would have a hard time setting off for Mars exactly as described in the book.Let's not lose sight, though, of the fact that NASA would have no problem getting people to Mars by the 2030s, albeit on a less zippy ride. "Andy Weir's Martian trips can be synthesized in more than several ways with technologies we can rely on now," said Yen. In fact, NASA scientists including Burke and McGuire have come up with several mission designs that sip far less power.And that's completely okay. The story of The Martian is just that: a story. Science fiction, even its "hardest," most realistic permutations, exists to take audiences on a ride, not to feed people technical appendices. One of the first credible, technically comprehensive Mars mission designs was dreamt up by rocketeer Wernher von Braun for a novel he wrote in 1947 and 1948. For all that von Braun knew his rockets, though, Weir wins the literary head-to-head. Dr. von Braun's dialogue is terrible.To Weir's immense credit, he has crafted a story so plausible, the science serves as a quiet yet potent narrative engine, letting the human elements shine."You think of The Martian as science fiction, but you really could just call it fiction," Weir argues.Fiction, though, allows for some massaging of the actual science, as our analysis and others like it have shown. But Weir doesn't mind the nitpicking."I have inadvertently educated people a lot about Mars," he says with a laugh. Michael Greshko is a science writer based in Washington, D.C., who has written for NOVA Next, the National Academies, and NYTimes.com, among other outlets. He tweets at @michaelgreshko.