Choosing a programming language - physics

In summary, if you want to create computer programs for simulating theories as complicated as string theory, C++ may be the language for you.
  • #1
cyberdeathreaper
46
0
If I'm going to attempt creating computer programs for simulating theories as complicated as string theory, what language should I be looking at? I have some experience with C++, but if I'm going to devote a large part of my free time to learning a language, I'd like to learn something that will be specifically useful for what I need. I'm sure this question has probably been asked before, but I didn't find any search results. Thanks in advance.
 
Computer science news on Phys.org
  • #2
Many of the physics type people i know, like MATLAB for most simulations. The best thing abt it (according to them) being that you don't have to waste time writing graphics packages. ( Otherwise ofcourse any general software development language like C/C++ or Java should help you, ofcourse the amount of effort will the relatively too much )

-- AI
 
  • #3
I concur with that, first do as much as possible scripting in packages such as Matlab, Mathematica - "next level" could be to use subroutine libraries and programming languages in conjunction with general packages such as those 2 above (it's pretty ease to interface stuff), before going all the way and writing from scratch with C++ or any other related language (and in this case picking code from libraries etc. is highly recommendable IMHO, for getting things done as much as getting them working properly - quite a bit of the really "serious software" seems to be written in C++, in "rough" computing fortran still prospers, but would recommend you'd just go deeper with C++ if you've a handle on it).
 
  • #4
Thanks for the recommendations. I didn't realize C++ could be used in conjuction with Matlab/Mathematica - do you know of any sources out there that describe how to do it?
 
  • #5
depends on what you want to do...if youw ant to simulate in Realtime 3D i don't think MATLAB can support that...I've been looking for a port from MATLAB to C++ and vice versa if you've found one can i have it...Matlab utilizes its interface to run doesn't it? How can you export an exe?

As for C/C++ it depends on what you want to do ..again if you want to do REALTIME 3D there are APIs out there for you to use OpenGL/Directx being the standards...also look into GLUT and SDL to maintain the active window...you could also use 3D (game) engines like Quakes/Unreal/Torque/Irrlicht/Ogre3D and it also depends on the methods you want to use for you scene management like BSPs/OCtrees/Particle mesh methods.

There are also numerical packages out there LAPACK(think this was for fortran) but there are others NIM i think was the acronym of one...but you shouhld still learn the basic techniques in numerical methods before moving onto the pacakges.
 
  • #6
For symbolic and some numerical calculations, Maple and Mathematica are good.


If want a physics-friendly real-time 3D, with a minimal learning curve [and minimal programming overhead], try http://www.vpython.org.

Certainly, if you need higher-performance, you can prototype in python, then port to C/C++. (Python does have some scientific library packages [e.g. SciPy, Numerical Python] and some ways to interface to C/C++ [e.g. Boost Python].)

Oh, yeah... Python and VPython are free and run on numerous platforms.
 
  • #7
If you're doing stuff that requires a lot of numerical calculations, I suggest using classic FORTRAN (i.e. FORTRAN 70). It's not really good for more than basic math computation, but it works very fast and has some neat built-in distributive computing functions (to make use of those university clusters).
 
  • #8
Use MATLAB to prototype. If you still need more speed or need to cross a platform,
FORTRAN and C are still the fastest. For numerical work with complex vairables
FORTRAN is better than C unless you prefer programming to physics.
 
  • #9
cyberdeathreaper said:
Thanks for the recommendations. I didn't realize C++ could be used in conjuction with Matlab/Mathematica - do you know of any sources out there that describe how to do it?

The Matlab external interfaces & compiler manuals are good sources (can view at mathwork site), containing the principles of interfacing with fortran, C and Java.
 

1. What programming language is best for physics research?

The best programming language for physics research depends on the specific field of physics and the types of simulations or calculations being performed. Some commonly used languages in physics research include C++, Python, and Fortran.

2. Can I use any programming language for physics research?

Yes, as long as the language has the necessary libraries and tools for the specific type of physics research being conducted. However, some languages may be better suited for certain tasks than others.

3. How do I choose the right programming language for my physics project?

The right programming language for your physics project will depend on several factors, such as the type of calculations or simulations being performed, the availability of necessary libraries and tools, and your own personal familiarity with different languages. It's important to carefully consider these factors before selecting a language.

4. Is it necessary to have programming experience for physics research?

While having programming experience can be beneficial for physics research, it is not always necessary. Many physicists collaborate with computer scientists or have access to software developed by others in their field. However, having some programming knowledge can help in understanding and debugging code.

5. Are there any programming languages specifically designed for physics research?

Yes, there are some languages that have been specifically developed for physics research, such as Mathematica and MATLAB. These languages often have built-in functions and libraries that are useful for performing common physics calculations and simulations.

Similar threads

Replies
17
Views
929
  • Computing and Technology
Replies
2
Views
609
  • Computing and Technology
2
Replies
44
Views
3K
  • STEM Career Guidance
Replies
22
Views
3K
  • Computing and Technology
Replies
9
Views
1K
  • Programming and Computer Science
Replies
8
Views
867
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
16
Views
1K
Replies
5
Views
1K
  • Programming and Computer Science
Replies
11
Views
1K
Back
Top