Oh MatLAB… solving differential equations, graphing, plotting and giving you exact values in a matter of SECONDS!!! For anyone in engineering or mathematics, MatLAB instantly makes your life easier. So the best programming language for a lapsi is MatLAB! No… wait what?
Many people (engineers are no exception) get used to using a certain program and try to make it a one-size-fits-all product. A great example of this is the older generation of engineers and VBA (VBA is great but it wasn’t designed to go into space).
MatLAB is excellent for performing mathematical calculations and solving equations. It has programming logic that was meant to be used for very short code. MatLAB is a high-level language, which in simple terms means that programming does not have a basic understanding of the machine level. At the lowest level, the machine is thinking about 0 and 1. The higher you go, the more the compiler will interpret the actual language of the page into machine language. High-level languages are meant to make programming easier, while low-level languages make it run faster and more efficiently.
Since MatLAB is a very high level language that has a LOT of built-in functions and multiple files that build on other files that build on other files and so on, it makes it run VERY inefficiently and VERY slow.
When I first wrote my FSAE lapsim, I naturally used MatLAB because I was taking a course at university and it felt natural to me. After my lapsim grew in size (around 300-600 lines of code), it became painfully obvious that MatLAB isn’t designed for this sort of thing…
So what is a good programming language? Well it depends on your application! As with all things FSAE, you have to have a good reason to use something! Why did I choose JavaScript? Well, in my personal opinion, the Internet is the KING. By that I mean that everything is more accessible on the Internet and everything is easier to use.
Why have a MatLAB file that has to be opened in MatLAB to run when I can program the lapsim in a user friendly web interface where all you need is an internet connection? You can use your iPhone, Android, iPad, Mac, PC or Windows phone to access the site… ANYTHING! On top of that, do you calculate in 5 seconds vs. 5 minutes? Where do I sign!!!
I will say that I had quite a bit of trouble implementing Matrix Algebra in JavaScript. Programming on basic things like multiplication is a doddle, but when you get into QR Decomposition and Gramm Schmidt it starts to get pretty complex. Fortunately, I used part of the Sylvesters libraries to make things easier (3D drawing script).
I hope I have motivated some of you to look for other options when it comes to programming!! Remember, one size does not fit all.