Sage - Useful Computer Mathematics Program
- Details
- Written by Kevin Horton
- Hits: 3478
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.
The Aeroplane Speaks, H. Barber, 1917
- Details
- Written by Kevin Horton
- Hits: 2791
I just finished reading an interesting book from the early days of aviation - The Aeroplane Speaks, Horatio Barber, published in 1917. The book attempts to explain the theory of flight in simple terms to prospective pilots and aircraft mechanics. I was surprised to learn how much of the theory of flight they had already figured out by 1916, when the very long and detailed prologue was first published as a series of magazine articles.
Some of the terms have changed since 1917 (e.g. what we know as “drag” was then called “drift”), but they had already figured out induced drag and profile drag, the importance of high aspect ratio to improve lift to drag ratio, the value of streamlining to reduce profile drag, how optimum camber varies with speed, etc. They had a pretty good handle on lateral and directional stability, but the understanding of longitudinal stability was still somewhat superficial (or maybe the author had a better understanding, but the description in the book was overly simplified to better meet the intended audience).
The copy I read was found by one of my coworkers in a used bookstore, but the complete book, with illustrations, can be viewed online.
Still Healing
- Details
- Written by Kevin Horton
- Hits: 2727
It was a quiet week. Both Terry and I are healing well. She has much less pain every week, and is almost completely weaned from any pain medication. Now she just has the occasional Tylenol, as required. I have no pain from the leg or wrist, and the collar bone is now not bothering me at all, as long as I don’t make sudden moves of the left arm.
Terry’s sister Sue left on Tuesday, and her sister Jacqueline arrived on Wednesday for a week. She’ll be followed by sister Mary, who will take care of us until the 29th. After that, we’ll be relying on insurance-funded personal care attendants who drop by in the morning and evening. I should get the cast off my left wrist on the 30th, and hope to become a lot more mobile once my left arm is working again.
I’m still working on several articles for Kitplanes, but didn’t make too much progress this week. I got distracted experimenting with Sage, a very capable, and complex, open source computer mathematics program. Sage acts as a unified front end to a whole host of other open source mathematics, data analysis, data plotting etc programs. I wanted to see whether it might provide a better approach to data analysis than the python scripts I have been using. Sage is python-based, so I can still use my python aerocalc package, plus other experimental ones that will eventually make it into aerocalc. One nice thing about Sage is that you can set up a sage server, and then log in from any computer with web access to analyze data. You can get a taste of what it looks like, but without the interactive user interface, by looking at the Sage worksheets that I published.
Slow Progress
- Details
- Written by Kevin Horton
- Hits: 2501
I had another followup visit with the orthopaedic surgeons on Thursday afternoon. The latest X-rays show the leg and wrist are healing well. The collar bone isn’t healing quite the way I hoped, in that the broken ends are not nicely butted up against each other. Instead, they very slightly overlap. The orthopaedic surgeons said that this was not that unusual, and that the two pieces would fuse together and provide normal function. It might just take a little longer than hoped to regain full strength than it otherwise would.
They removed and replaced the cast on the leg to inspect the incisions. The incisions are healing nicely, and the tender spot that was on the inside of the ankle two weeks ago has disappeared.
They expect to remove the cast on my wrist on the next followup visit, scheduled for 30 April. It will be wonderful to get the right arm back, but there will be a few weeks of physio to do before it is fully functional. They also said that they hoped to put my leg in a removable air cast, which will mean I could shower while sitting in a plastic chair - that will be wonderful. I won’t be allowed to put weight on the leg until mid-June.
I’ve been working on a series of articles for Kitplanes magazine. I’ve submitted the first one, and the next two are about half done (these two will be a two-part series, so I’m working on them together).
Terry is healing well too. Our spirits are high. Terry’s sister Sue leaves tomorrow, after a three week visit. She took superb care of us. Thanks Sue! Terry’s sister Jacqui arrives Wednesday for a week, followed by sister Mary for another week. The auto insurance-funded attendant care coverage is spooling up - a nice young lady comes by for two hours every weekday morning to help us get with all the morning activities. Someone is working to arrange attandants for weekend mornings and at bed time. We are in good hands.
Preserving the Engine
- Details
- Written by Kevin Horton
- Hits: 2400
I finally out to the airport Sunday morning to preserve the RV-8 engine. It will be several months before I fly the aircraft again, and the air will get more moist as summer arrives, so there was a significant risk of engine corrosion.
Chris H., a local RV-8 builder picked me up and drove me to the airport. RV-8 builders/flyers Mark R. and John P. showed up to help, alone with RV-7A builder Jim M. I rolled around in my wheelchair and supervised as they pulled the aircraft out, ran it to warm up the oil, and drained the oil. Then they poured in the AeroShell Fluid 2F preservative oil, and did another short engine run. Then they pulled the upper plugs, sprayed fogging oil in the cylinders, installed desiccant plugs, blocked off the exhaust pipe exits and the intake filter. This should keep things nice and dry in there for several months.
Thanks to everyone for their help. It was great to get this done, and it did me a lot of good to get out of the house for the morning.
Here we see Mark running the engine to warm the oil up. It felt quite weird to see someone else running the aircraft. Mark has a longer torso than I do, so he barely fit under the canopy. Good thing he doesn’t hane much hair on top.
Errors in ASI Reading vs Water Manometer Height, Feb. 2009 Kitlpanes
- Details
- Written by Kevin Horton
- Hits: 3019
The tables of ASI reading vs water manometer height in the “Maintain thy airspeed …” article in the Feb. 2009 Kitplanes are completely wrong. All the values of water height that I checked are more than 25% in error. Strangely enough, the same author published a similar article in the July 89 Kitplanes, but the earlier article had correct data.
The following formulae give results that are within 0.1% of the “official” specs in AN 05-10-24:
For ASIs in mph:
water height (inches) =((1+0.2*(ASI/761.22)^2)^3.5-1)*407.51
For ASIs in kt:
water height (inches) =((1+0.2*(ASI/661.48)^2)^3.5-1)*407.51
For ASIs in km/h:
water height (cm) =((1+0.2*(ASI/1225.06)^2)^3.5-1)*1035.083
You can download zipped Excel and OpenOffice spreadsheets that convert between ASI reading and water manometer height.
Correct data follows:
Read more: Errors in ASI Reading vs Water Manometer Height, Feb. 2009 Kitlpanes