molecular dynamics animator
May 25, 2007 12:31 PM Subscribe
Help me find software to animate my molecular dynamics simulation
For my research, I've been trying to learn about molecular dynamics simulations. I've been trying to learn by writing up a simple MD algorithm from scratch in Java. I only have a limited knowledge of computer programming, so my simulation is probably far from the most elegant, efficient, or functional program. Nevertheless, I have managed to write a program that calculates the forces, trajectories, and velocities for a group of N particles. The program also exports the simulation output into a .txt file. There is no graphical interface, and I don't really want to program one.
I'm looking for some software that will do the animation for me. The form of the output is a list (N long) of x and y coordinates. There are as many of these lists as there are time steps in the simulation. So, for example, for 10 particles with 20 time steps, the output file would be 20 10x2 arrays. This output can be formatted or modified slightly. I'm looking for a simple program that will read those coordinates from the output file and animate them with respect to time. Free and easy to use are what I'm looking for.
For my research, I've been trying to learn about molecular dynamics simulations. I've been trying to learn by writing up a simple MD algorithm from scratch in Java. I only have a limited knowledge of computer programming, so my simulation is probably far from the most elegant, efficient, or functional program. Nevertheless, I have managed to write a program that calculates the forces, trajectories, and velocities for a group of N particles. The program also exports the simulation output into a .txt file. There is no graphical interface, and I don't really want to program one.
I'm looking for some software that will do the animation for me. The form of the output is a list (N long) of x and y coordinates. There are as many of these lists as there are time steps in the simulation. So, for example, for 10 particles with 20 time steps, the output file would be 20 10x2 arrays. This output can be formatted or modified slightly. I'm looking for a simple program that will read those coordinates from the output file and animate them with respect to time. Free and easy to use are what I'm looking for.
You'll probably need to convert your data into something that can be rendered into an image. Nonetheless, this page may help you out.
posted by Blazecock Pileon at 1:54 PM on May 25, 2007
posted by Blazecock Pileon at 1:54 PM on May 25, 2007
Once you have images for each frame, you can use QuickTime Pro to render a movie from a set of frames.
posted by Blazecock Pileon at 1:56 PM on May 25, 2007
posted by Blazecock Pileon at 1:56 PM on May 25, 2007
(Caveat: not 100% sure I understand what you're looking for. The following describes a package used for all kinds of graphs using x,y coordinates.)
I recently used JFreeChart with not too much difficulty and good-looking results. (I am a pro programmer, but it includes some samples that should be relatively easy to work with.) To make it animated, simply create a loop that sleeps for x milliseconds (using Thread.sleep()) each iteration and then redraws the graph with that instant's data.
posted by callmejay at 2:07 PM on May 25, 2007
I recently used JFreeChart with not too much difficulty and good-looking results. (I am a pro programmer, but it includes some samples that should be relatively easy to work with.) To make it animated, simply create a loop that sleeps for x milliseconds (using Thread.sleep()) each iteration and then redraws the graph with that instant's data.
posted by callmejay at 2:07 PM on May 25, 2007
You could do this with some work in any 3d-animation package's scripting language. Particularly Maya's MEL or Houdini's HScript. The learning curve will be much higher, but team up with an artist and your results could be pretty spectacular.
Not really your criteria, but something to think about.
This is a total shot in the dark, but I would look around for scripting language binding (i.e. perl/python/ruby) for something like renderman or OpenGL.
posted by milinar at 2:27 PM on May 25, 2007
Not really your criteria, but something to think about.
This is a total shot in the dark, but I would look around for scripting language binding (i.e. perl/python/ruby) for something like renderman or OpenGL.
posted by milinar at 2:27 PM on May 25, 2007
UCSB has a site-license for Mathematica. I've done something somewhat similar to this in the past, so I know it can be done.
The general technique is to make a loop to load the data and do a ListPlot (formatting the points to look nice). You can then collapse the cell all these plots are in and it will animate. I don't recall how to export that, but perhaps that will help nonetheless?
posted by JMOZ at 3:18 PM on May 25, 2007
The general technique is to make a loop to load the data and do a ListPlot (formatting the points to look nice). You can then collapse the cell all these plots are in and it will animate. I don't recall how to export that, but perhaps that will help nonetheless?
posted by JMOZ at 3:18 PM on May 25, 2007
Mathematica will do this, and relatively painlessly. The easiest way I found (when I did a Brownian motion simulation) was to create a graph for each event (in my case, N particles with random x,y, and z movements) and then save it to a graphics array.
The animation function will then animate the graphics array, and you can export it as a QuickTime file by just right clicking the animation (at least in the Mac version, I'm sure the Windows and Linux versions have something very similar.)
Here is a link on reading data from a file. If you want, I can toss my notebook file online and you can see how I handled the graphing.
posted by Loto at 3:28 PM on May 25, 2007
The animation function will then animate the graphics array, and you can export it as a QuickTime file by just right clicking the animation (at least in the Mac version, I'm sure the Windows and Linux versions have something very similar.)
Here is a link on reading data from a file. If you want, I can toss my notebook file online and you can see how I handled the graphing.
posted by Loto at 3:28 PM on May 25, 2007
you could transform your output into a POV-Ray animation reasonably easily, and it is freely available.
posted by paradroid at 3:38 PM on May 25, 2007
posted by paradroid at 3:38 PM on May 25, 2007
If you've already written the dynamics code in Java, consider writing another program to do the animation in Java with OpenGL. It's not too hard if you already know Java, and there's a great deal of information on using OpenGL out there.
posted by demiurge at 8:22 PM on May 25, 2007
posted by demiurge at 8:22 PM on May 25, 2007
It sounds like you're working in 2D, but if you wanted to move to 3D you could write your data in the PDB format and take advantage of the various tools for displaying pdb files. VMD (previously mentioned) will read them, as will programs like PyMOL.
posted by pombe at 8:36 PM on May 25, 2007
posted by pombe at 8:36 PM on May 25, 2007
This thread is closed to new comments.
posted by chrisamiller at 1:02 PM on May 25, 2007