Saturday 20 February 2010

The Home Stretch, and then some: ISA Calculator Project Review [MATLAB]

Today was, as I've mentioned before, the deadline for my little MATLAB project. Let's review requirements:


  • Calculate the ISA values for pressure, temperature, density, and viscosity at a user-input height.
  • Create and display a table of values for heights 0 to 15000 meters, at 1000 meter increments.
  • Create and display a plot of temperature, pressure, and density versus height (on three plots).
My end result was 733 lines of code (we needed to print that out... 14 pages of code, it turns out). It provided the user with a GUI window which allowed for easy input of various values. It allowed the table to be calculated for any input range of heights, with any increment, and even allowed for the division of the range into a set number of pieces, which is probably a useless feature but it was interesting to see how little or how much the plots changed as there was an increase in available data points.

It was made such that whatever value was set up for the single height would still be there (and calculated) after looking at graphs and tables, and vice versa, but the tables did draw off of the same information as the graphs.

There were a couple of shortcomings I noticed:
  • It was not configured to allow the user to type in the values and simply hit enter. A push button had to be pressed.
  • The table was displayed with scroll bars, as it did not fit into the window I'd allotted.
  • The original design was done in units of pixels, therefore no window resizing. This means it looks nice, but is not very expandable. I was halfway through fixing this by using normalized units, when I remembered that deadlines and required features were more important.
  • Every time you switched between one of the three plots, it recalculated the entire vector of outputs. I'm sure there was a cleaner way to do it, but again, that was the final moment when I realised there was a deadline fast approaching.  It's inefficient, sure, but you don't notice it unless you set the number of increments ridiculously high.
  • The axes on the graphs were sparsely populated. I should've programmed them to have a certain number of points.
Overall, I'm pleased, but I'm seriously considering going back and correcting these shortcomings before I officially say I'm done with it. Call it obsessive-compulsive, it's just the way I am sometimes.

In a few days (probably when I've fixed at least some of those shortcomings), I think I'll post the code. I doubt there are too many people out there looking for an ISA Calculator programmed in MATLAB, but I do think there are people out there who could learn something from it, and more importantly, I think there are people out there who can point out some of the stupid mistakes I've made.

Next up, Java simulation work. I think. I'm also considering looking into making apps for my new Blackberry, if I can come up with something that'd be useful, playing with the new Java game development book I've received, making my own USB Controller - to - keyboard/mouse mapper (because the one I like to use I don't really have the money for at the moment so I might as well try that out), or any number of other ideas.

3 comments:

Rob said...

I cant believe ur considering working on ur ISA calculator further, even when uve handed it in lol. Im going try and make a GUI next time around, i might try and make something simple in the meantime to see how its done...WITHOUT using their crappy preset thing.

PS Thanks for only waking me up at 01:17 this time haha

Rasori said...

GUIDE is pretty bad, yes. But I'm pretty sure now that I actually know what I'm doing, it'd be pretty useful.

As to waking you up, you said you turned that notification off!

Rob said...

yeh i did, and i wasnt asleep anyway at 1:17...i was just jokin