Wolfram Computation Meets Knowledge

Stranded on Mars: Exploring Travel on Mars in The Martian

The popular book The Martian by Andy Weir will be released in movie form on October 2. The Martian is about an astronaut, Mark Watney, stranded alone on Mars. The crew of Ares 3, the third manned mission to Mars, thought he had been killed during an evacuation. When the crew left, they took the only planned means of escape and communication with them. The next manned mission to Mars isn’t for four years, so Watney has to face the fact that he must either figure out how to survive for up to four years on Mars or die. The book does a wonderful job of supplying technical details of the conditions and supplies available, as well as of the problems that arise as a result of using things in ways for which they were not designed. The details are great for allowing us to explore the travels of the main character with the Wolfram Language.

It’s at this point I should probably post a warning: SPOILER ALERT! From here on I will be exploring aspects of the story and so will be giving away plot points. If you don’t like those kinds of details, stop here and go read the book… and then come back and read this blog.

Travel and communication with NASA are among the major problems Watney faces. He decides to modify the abandoned mission rover for longer travel and go to the nearest communication site, the Mars Pathfinder landing site. The book tells us the coordinates of Watney’s home base, called a habitat, or HAB for short. I used Mathematica 10.2 (which includes high-resolution tiles of Mars) and GeoGraphics to visualize the area around the Ares 3 HAB:

Using GeoGraphics to visualize the area around the Ares 3 HAB

To put this into a more global perspective, you can change the GeoRange and the GeoProjection:

Using GeoRange and GeoProjection to gain a global perspective

The distance from the HAB to the Mars Pathfinder can be easily computed using the Wolfram Language:

Finding the distance between HAB to the Mars Pathfinder

We can visualize the path Watney takes using GeoGraphics:

Visualisizing the path Watney takes using GeoGraphics

Once Watney has retrieved the Mars Pathfinder and established communication, he makes plans for an escape. Because of the way the Ares missions are planned and executed, the Mars Ascent Vehicle (MAV) is landed long before the arrival of the next crew (the way off the planet). Basically, the Ares 4 crew won’t arrive for four years, but its MAV has already landed. The problem is that the Ares 4 MAV is in a different location on Mars, Schiaparelli Crater.

Schiaparelli Crater

This is quite a long way from the Ares 3 HAB—over 2000 miles. This is much farther than the previous jaunt to get the Mars Pathfinder:

Distance to get to the Mars Pathfinder

Of course, nothing is ever easy. Due to craters, valleys, and other complications, the actual path is not a straight line. One of the first deviations along the way comes from Mawrth Vallis. This is a water-carved valley on Mars that bridges the transition from the relatively flat Acidalia Planitia (upper left in the following graphic) to the more rugged, higher-altitude, and crater-strewn Arabia Terra (lower right in the following graphic):

Mawrth Vallis

Although Mawrth Vallis makes for a less direct route, it’s a more gradual slope, and therefore easier to traverse. We can zoom into Mawrth Vallis by changing the GeoRange:

Mawrth Vallis

In the CDF version of this post (downloadable below), if you click the graphic and press the “.” key on the keyboard you can hover over the graphic to get various latitude/longitude coordinates. In addition, you can click and set down a set of points and trace out a path through Mawrth Vallis. Once the path is laid down, you can do a simple copy and paste to paste the set of points that were just specified. I also rounded the results to 0.01 angular degrees, which is around 1/2 of a pixel in the above graphic. These can be used to create a GeoPath through Mawrth Vallis:

Creating a GeoPath through Mawrth Vallis

Along the way to Schiaparelli Crater, Watney navigates using a number of geographic features, and even names some after himself. For example, he names the area bounded by Becquerel Crater, Trouvelot Crater, and Marth Crater the “Watney Triangle”. In the words of Mark Watney, “I’m calling it the Watney Triangle because after what I’ve been through, #!&% on Mars should be named after me.”

The Watney Triangle

Taking all of the references and features mentioned in the book, we can get a fairly decent picture of the region visited by Watney along his way:

Using references and features mentioned in the book to get a picture of the region visited by Watney

The actual path covered is far from a straight line, so the total distance traveled is longer than the straight-line distance computed earlier. We can combine all the destination points together to estimate the total distance Watney actually had to travel, nearly 300 miles farther than the straight-line distance:

Calculating the total distance Watney traveled

The story doesn’t end there. Once Watney reaches the Ares 4 MAV, he still has to take off and intercept the Hermes, the large spacecraft used to ferry astronauts between Earth and Mars. Due to the use of ion propulsion, the Hermes cannot make sudden changes in its velocity, and due to the abrupt change in plans, Hermes can’t enter orbit. So Watney has to figure out how to take a MAV designed to only reach orbit and get it to go much higher to intercept the Hermes as it makes a close flyby of Mars. The proposed solutions to these problems are almost as scary as the problems themselves. The book was really fun to read. Mark Watney had a lot of challenges to overcome in order to survive on Mars. I will not reveal the ultimate outcome so you have something to look forward to. I just hope I can survive the wait until the movie comes out!

Download this post as a Computable Document Format (CDF) file.


Join the discussion

!Please enter your comment (at least 5 characters).

!Please enter your name.

!Please enter a valid email address.


  1. Great post, Jeffrey! I listened to an Audible.com version of “The Martian” last year and was bowled over by the author’s attention to detail and technical accuracy. I wish I’d had your code to follow Watney’s wanderings when I was listening to the book. Like you, I can hardly wait for the movie. Adam Savage( of Mythbusters fame) interviewed Andy Weir about the book on ‘The Talking Room’ video podcast. The interview is also on YouTube.

  2. I’m sure the movie will have to cut a number of details for the sake of time. I’m nervous about what will be cut. I heard that the audio book was really well done. Although the first version had a couple of technical goofs, for example the narrator refers to the ASC 2 standard (which was supposed to be ASCII). Kind of funny when the guy reading the material doesn’t understand what he’s reading. Also some subtle Linux-isms that were mispronounced. Supposedly fixed in later audio book revisions.

  3. Yes, all of the major solid bodies in the solar system have coordinate systems defined. The Wolfram Language, via SolarSystemData, has the coordinates for most of the recognized and named permanent features on the solid bodies, including planets, asteroids, and moons. Gas planets, although they have coordinate systems, are more complicated and there are no permanent features that use those coordinates (exception would be the Great Red Spot on Jupiter available in Alpha). Presenting these features in maps is somewhat limited in GeoGraphics. High resolution maps are available for the Moon and Mars in Mathematica 10.3 and later (Mars in 10.2). Other bodies work as well if you plot things at the global level, but zooming in is not recommended since high-resolution maps are not available. See the documentation for SolarSystemFeatureData for a collection of some examples.

  4. I’m viewing your article “Secrets of the Universe Hiding on My Home Computer” and wondering if you could send me the original May08_0132.fit image file so I can begin your project from the start? Could not find a link to that file in the article. Thanks.