Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best language for physics modeling?

I've been out of the modeling biz, so to speak, for a while now. When I was in college, most of the models I worked with were written in FORTRAN, which I never liked. I'm looking to get back into science, so I'm wondering if there are modern languages with feature sets suited for this kind of application. What would you consider to be an optimal language for simulating complex physics systems?

like image 908
FCBastiat Avatar asked Sep 24 '10 23:09

FCBastiat


People also ask

What language is used in physics?

Although mathematics has long been regarded as the "language" of physics, the connections between these independent disciplines have been far more complex and intimate than previous narratives have shown.

Do theoretical physicists use Python?

Python is an enormously powerful tool and widely used in theoretical and computational physics.

Is C++ used in physics?

C++ and programming languages are not at all important in physics or the real sciences. Do scientific ideas come out of C++, that weren't possible before? There might be a case of OO modelling algebras (of computational objects), and thus being able to model the elements of physics and their interactions, or messages.


2 Answers

While certainly Fortran was the absolute ruler for this, Python is being used more and more exactly for this purpose. While it is very hard to say which is the BEST program for this, I've found python pretty useful for physics simulations and physics education.

like image 166
Daniel Rodriguez Avatar answered Sep 21 '22 19:09

Daniel Rodriguez


It depends on the task

  • C++ is good at complicated data structures, but it is bad at slicing and multiply matrices. (This task equires you to spend a lot of time writing for loops.)
  • FORTRAN has a nice notation for slicing and multiplying matrices, but it is clumsy for creating complicated data structure such as graphs and linked lists.
  • Python/scipy has a nice notation for everything, but python is an interepreted language, so it is slow at certain tasks.
  • Some people are interested in languages like CUDA that allow you to use your GPU to speed up your simulations.

In the molecular dynamics community c++ seems to be popular, because you need somewhat complicated data structures to represent the shapes of the molecules.

like image 43
nielsle Avatar answered Sep 19 '22 19:09

nielsle