I’ve been spending quite a bit of time experimenting with the sage computer mathematics system. I have been using python scripts to analyze the data from my flights. Most people would probably use a spreadsheet like MS Excel for this task, but while I find spreadsheets very useful for quickly producing small calculations, they can be quite unwieldy for large, complex calculations that involve a large number of steps, with thousands of data points. I find that it is all too easy to have a hidden copy and paste error where some cells have the wrong formula, as normally you can only see the formula in a given cell if you select it. It is also hard to add enough comments so you can later make sense of what you did and why you did it. And, finally, there are many specific calculations that will be done during many different sets of analysis, such as calculating TAS from CAS, calculating density ratio, etc. It is a pain to copy these formulae every time you need them. Yes, it is possible to use macros for this purpose, but I find the macro languages fairly unwieldy.

Python is quite well suited to data analysis tasks, as it addresses my gripes with spreadsheets, and it has a large number of add-on packages aimed at scientific and mathematical tasks, such as scipy. I created the aerocalc package, which provides a useful set of functions for common tasks. Rather than recreate these functions in each data analysis script, I can simply import the aerocalc package. But, I was never completely satisfied with python for data analysis. It was a nice language, and did many tasks very well, but every once in a while I would run into a task that was a bit tricky to do, ang my Googling would point me at some other computer program that did this particular task extremely well. I would gaze longingly at that program for a few minutes, but a quick pass through its docs would invariably show that while it did task A extremely well, it fell well short of python in all my other selection criteria. Then I discovered sage.

Sage attempts to provide a unified interface to dozens of open source programs that deal with mathematics, computer algebra, numerical analysis, graphing, data analysis, technical documentation writing, etc. Sage is written in python, and its language is 99% the same as python, so I didn’t need to learn a new syntax. It can use my aerocalc package directly, and the vast majority of my existing data analysis can be copied right into sage without modification. And, whenever I hit one of those spots where computer program A had a much nicer approach to a task than python, in every case so far I have found that sage includes that program under yhe surface, and I can easily use that specific function in my data analysis while doing the rest in pure python. And to top it all off, sage includes an optional very spiffy notebook interface that allows you to include text and display mathematical formulae and graphs to illustrate some aspects of the data analysis. You can see an example of this in the Cruise Performance notebook that I published on my server (also available on a public server, in case my personal server is off line). See other example notebooks on the public sage server.

Note: Your web browser will warn about SSL certificate issues when you go to my Cruise Performance notebook. That is because the notebook is hosted on my own server, here at home, and I have a self-signed SSL certificate. Just throw caution to the wind, tell your browser to shut up and let you do what you want.