• July 8, 2022

JavaScript? Why not MatLAB?

Oh MatLAB… solving differential equations, graphing, plotting and giving you exact values ​​in SECONDS!!! For anyone in engineering or math, MatLAB makes your life instantly 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 to 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 of 0s and 1s. The higher you go, the more the compiler interprets the actual language of the page in machine language. High-level languages ​​are intended 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 building on top of other files building on top of other files and so on, it makes it run VERY inefficiently and VERY slowly.

When I first wrote my lapsim FSAE I naturally used MatLAB because I was taking a course in college and it seemed natural to me. After my lapsim grew in size (about 300-600 lines of code), it became painfully obvious that MatLAB is not designed for this kind 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 wear something! Why did I choose JavaScript? Well, in my personal opinion, the Internet is 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 needs to be opened in MatLAB to run when I can program the lapsim in an easy to use 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 piece of cake, 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.

Leave a Reply

Your email address will not be published. Required fields are marked *