3
$\begingroup$

I'm currently considering pursuing postgraduate studies in the field of chaos/dynamical systems/nonlinear phenomena, and was wondering whether there are particular programming languages that are favoured when doing such research. Are there any that stand out in particular that would come in handy? C, C++, Python, Haskell?

I have taken one-term courses in Java and MatLab programming, so I know the basics of programming, but I haven't really programmed much or at all outside of the courses themselves. So I figured it might be useful if I also picked up a language that I'd actually use in grad school, prior to actually getting there and having to learn it on the fly.

$\endgroup$
  • $\begingroup$ I use CUDA with Mathematica. $\endgroup$ – Alexander Gruber Jun 19 '13 at 19:36
  • 1
    $\begingroup$ Matlab is good enough for most users, as long as you stick to ODEs. For speedup, you can code the most computationally heavy component in C and connect to Matlab via the mex options $\endgroup$ – nonlinearism Jun 19 '13 at 20:56
  • $\begingroup$ @nonlinearism, would it be useful to learn Python at all then? I know a grad student that uses it for all kinds of cool stuff in condensed matter physics research, which is why I was thinking it might come in handy here, as well. $\endgroup$ – Ryker Jun 19 '13 at 23:35
  • 1
    $\begingroup$ If you want to try Python, see the book Python Scripting for Computational Science. $\endgroup$ – lhf Jun 20 '13 at 12:38
  • 1
    $\begingroup$ @Ryker, there's a simpler book by the same authors: A Primer on Scientific Programming with Python. $\endgroup$ – lhf Jun 21 '13 at 13:50
3
$\begingroup$

I don't know if there any special "favored" languages in this area, but I suspect that the answer is "no". In any given discipline, you will typically find people using an assortment of different programming languages to explore ideas. In many cases, people choose a particular language just because it's one they already know, not because it's especially well suited to the problems at hand. As the old saying goes -- "when your only tool is a hammer, every problem looks like a nail" :-)

If you're going to learn a new language, here are a few criteria to consider:

(1) Pick one that's "mainstream", rather than some special niche language. So, pick C++, or C#, or Java, or Matlab. Maybe Mathematica. Maybe Python. Not Haskell. That way, the knowledge you gain will be more broadly applicable. It might help you get a job, at some point, for example.

(2) Pick one that is well suited to your problem domain, to make your life easier. So, for dynamical systems, I would expect that Matlab and Mathematica would be good. Python would be good, too, because you have access to the NumPy package. C++, Java, and C# might involve more work, depending on what helpful libraries you can find (there are many, but their quality varies greatly).

(3) Personally, the only reason I ever use C/C++ is when I want my code to run as fast as it possibly can. Unless performance is the main concern, C/C++ are just too much trouble, IMO.

The criteria are conflicting, of course, and only you can decide which ones are important to you.

$\endgroup$
  • $\begingroup$ Thanks, a lot of what you said makes perfect sense. In a way, the most sensible thing to do would be to just revise Java and/or MatLab, and build on that knowledge, but on the other hand, I kind of want to start fresh with something. Mathematica would be might first choice, but I don't have access to it, so at this point I'm leaning heavily towards Python. $\endgroup$ – Ryker Jun 21 '13 at 17:46
  • $\begingroup$ Python would be a reasonable choice. The other strong contender would be C#. I would say that C# (and the .NET world in general) are more main-stream than Python. Python is easier, arguably, but C# is not too bad. It looks a lot like Java, actually, so it should be easy for you. $\endgroup$ – bubba Jun 22 '13 at 1:36
  • $\begingroup$ I think at this point I'm going with Python and the last book lhf recommended in the comments to my original post. $\endgroup$ – Ryker Jun 22 '13 at 17:33
1
$\begingroup$

This question is difficult to answer, because any answer is too broad for the particular problems you will face. With that in consideration, the approach I suggest is the one programmers use for software development:

Cascade from highest level (e.g. Mathematica and Matlab), down to lower levels (e.g. C/C++), in this order. You should only switch to a lower level when you know that a higher level language is not suited for your needs, either because lack of functionality or speed.

The main motivation is that, given the same programming time, higher level languages have broader applicability and faster development than low level languages. This is of course restricted to the languages you are comfortable with.

If you plan to learn a new language, as Bubba correctly pointed out, pick a mainstream language such as (in my personal opinion):

  1. Mathematica
  2. Python
  3. C/C++

ordered from higher to lower level.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.