Numerical Analysis Programming Language

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
occh
Messages
14
Reaction score
2
In two semesters or so, i will be taking a numerical analysis course as part of an Applied Mathematics major. In the course description it says that you should have knowledge of at least one programming language, but i cannot find any more information about this. What do you all think would be a good language to learn in order to prepare for this class?
 
Physics news on Phys.org
C++, C, Python and Fortran come to mind, in no particular order of preference. If you don't have any idea which one you're more likely to use in your work later on, just pick whichever one you can find compilers and learning resources for easily. Don't stress out over the choice. Whichever one you choose, you'll probably end up needing to learn one of the others at some point, if you program regularly as part of your career.
 
In my experience, numerical analysis courses may require a programming language like C++, Fortran, or python, but a lot of times it's simply programming an algorithm into matlab. The focus of the course will probably be more about derivation, bounds, methods, and maybe run times. Programming aspect will probably be in the form of implementing the different methods. Thus, there really isn't anything extremely complicated you need to know programming wise. IF you are unfamiliar with programming entirely, learning in any language how for loops, do while, while and foreach loops work would be beneficial to avoid common bugs that occur when people miss count the index. Other good things to know is the difference between a global variable and local variable.

If the course uses matlab, learning how MATLAB takes arguments will save a few headaches too.

Just as a personal opinion, python, to me, is the easier to get up and running with little to no help. Especially if you download anaconda package you'll have basically everything you'll need for scientific computing and data munging. Thus, I'll consider that a good starting point to learn a language.
 
MATLAB is particulary good for matrix and vector manipulation and data visualization. The problem is that it is expensive. Scilab is my favorite alternative, though it is a little bit kooky in the way it implements functions.

I am just learning python myself, it has some ups and downs but it is a pain working with matrices. It is more powerful than MATLAB and thus has a steeper learning curve. Python is also used with a lot of MOOCS and other software. I'm not sure how I feel about python yet.

C/C++ is the most advanced of them all. You can do almost anything you want with C, but the learning curve is steeper and you'll have to look for libraries that can implement advanced math (unless you want to write your own). I enjoyed C++, but it is severely lacking in the data visualization department.
 
Get "Engineering Problem Solving in C++" by Etter. Go through everything but feel free to stop when it gets to classes. This is the equivalent of one intro C++ class only better.

Also, get a good programming environment. If you have a Mac, learn the command line. If you have Windows, install a Linux partition (or thumb drive installation).