Rob Dimeo's IDL Programs (updated 07/14/07)
The following IDL procedures, functions, and objects were developed either for the DAVE software project or otherwise.  Feel free to download these programs and send me feedback if you find any of them useful.

New Programs
Analysis Programs
Compound Widgets
Miscellaneous Programs

New programs

Visualization of 1D Quantum Dynamics

Numerically solves the 1D Schrodinger equation and displays the time-evolution of the wavefunction, probability density, and probability current for a user-defined potential barrier, well, or combination and a user-defined initial wavefunction.

Analysis programs

PAN: Peak Analysis

A general purpose curve fitting program with a graphical user interface.

One-Dimensional Convolution and Neutron Spectroscopy (160 kb) This distribution contains three files relating to convolution in IDL and its application to neutron spectroscopy. The PDF document contains a short summary and details on the mathematics and implementation of one dimensional convolution in IDL. A widget application called XRES provides an interactive demonstration of linear shift-varying convolution. The short program CONVOL_APPROX contains the source code for implementation of the convolution for a linear shift-invariant system in a number of different contexts.
Screen shot of XRES

TREE_MIN_UI is a prototype implementation of a global minimization algorithm using a stochastic tree search.  It provides direct visual feedback of the search strategy by displaying the dynamically evolving tree structure on top of the function to be minimized.  In this strategy the nodes of the tree structure represent possible minima; the information in the nodes indicate which regions of parameter space provide the best values. 

This particular implementation attempts to minimize a function of a single variable.  Note that the underlying logic for the search can be extended to higher dimensions.  The widget program TREE_MIN_UI allows the user to enter their own functions defined over custom ranges and use this stochastic tree search to attempt to get the global minimum.  Note that there is no guarantee that the global minimum will be found using this algorithm.  However this program allows the user to modify the tuning parameters and see the effects that the parameters have on the resulting tree.  The program headers for the two programs contain more information. This algorithm is adapted from a global search strategy used in fitting EPR spectra (see this site for details on that particular application).
Screen shot

RMD_GA.ZIP (contains 4 programs and PDF documentation: 153 kb)
IDL implementation of a simple genetic algorithm which attempts to find the global minimum of a user-specified function.  This is a *simple* GA (SGA) in the sense that it uses roulette-wheel reproduction, simple head-to-head and tail-to-tail swapping crossover and bit-flip mutation.  Parameter encoding is binary.  Termination criteria are either the maximum number of iterations ITMAX has been reached or the average fitness of the whole population is within FTOL of the best fit in the population.  PDF documentation provides a detailed description of usage and examples including determining the ground state of an Ising spin glass. Requires IDL 6.1 and higher.

RMD_PSO.PRO (24 kb)
IDL implementation of the particle swarm optimization algorithm. This function attempts to minimize a function using a particle swarm optimization (PSO) strategy. For additional details on this optimization technique please consult the following web site: swarm intelligence An example usage is located at the end of the source code listing. To run it, compile the file and type PSO_MIN_EXAMPLE at the IDL prompt. Requires IDL 6.1 and higher. Screen shot of example usage

Compound widgets

This compound widget can be used to display text using colored fonts. This is not a replacement for WIDGET_TEXT because it is not editable. It is for display purposes only. See the program appended to the end of the source code for an example implementation. Requires David Fanning's program FSC_COLOR.PRO and IDL 5.6 and higher.
screen shot of example usage

This zip file contains two files: and big_stop.png. To run properly both files must be located in the same directory and the function SOURCEROOT.PRO must also be somewhere in your IDL path. Compound widget (internally written as an object) that can be configured to have the same functionality as a conventional widget button and even extended to have toggle functionality. See the program appended to the end of the source code for an example of how each of these modes works. Requires IDL 6.0 and higher (because of the use of ARRAY_INDICES).
screen shot of example usage

Compound widget (internally written as an object) similar in functionality to CW_BGROUP which comes with the IDL distribution. This compound widget uses user-configured colored buttons using the CW_COLOR_BUTTON compound widget listed above. See the program appended to the end of the source code to see how to use this compound widget. Requires CW_COLOR_BUTTON.ZIP distribution above and IDL 6.0 and higher.
screen shot of example usage

CW_LED.PRO (20.3 KB)
Compound widget (internally written as an object) that provides an LED-light type status indication. LEDs can be turned on and off using WIDGET_CONTROL. Requires IDL 6.0 and higher (because of the use of ARRAY_INDICES).
screen shot of example usage

Compound widget (internally written as an object) that provides a progress bar. Progress can be updated by using WIDGET_CONTROL. Requires IDL 5.6 and higher.
screen shot of example usage

Miscellaneous programs

There are three main files in this ZIP file and a folder containing the documentation: TDSE_SOLVER.PRO, SE_SIM.PRO, and RMD_WINDOW.PRO (an auxiliary widget application that allows visualization of .

TDSE_SOLVER.PRO is a function that returns the space- and time-dependent complex wavefunction for a user-specified initial (t=0) wavefunction and user-defined 1-D potential. Note that the potential can have both real and imaginary components but unitarity is not maintained if an imaginary component is present. It is based on an algorithm described in an article by Goldberg et. al. (Goldberg et. al., Am.J.Phys. vol. 35, p. 177, 1967).

SE_SIM.PRO is a GUI wrapper for TDSE_SOLVER.PRO that allows the user to explore the time-evolution of one-dimensional quantum systems. The application allows the user to define an initial wavefunction, a (possibly complex) potential function (general barriers, wells or combinations thereof), and the discretization of time and space needed for the numerical solution of the Schrodinger equation. Computation of the time-development of the quantum system is relatively rapid (of order a few seconds for many interesting cases) and the interface gives the user control over the speed of the animation. Once the calculation is complete, the user can play back the animation--skipping frames to increase playback speed--as well as pause and resume the sequence at any time. User can zoom into the visualization to explore various features in the probability density, the real and imaginary parts of the wavefunction in configuration or momentum space, and the probability current. Additional features include the ability to write individual frames from the animation out to a graphics file and/or save the sequence as an animated GIF file. "Canned" examples are provided in the menu that illustrate quantum tunneling, wavepacket spreading, reflection/transmission at a square barrier, reflection/transmission at a square well, excitation of virtual/metastable states, and wavepacket scattering from a periodic structure.

Note that SE_SIM.PRO uses IDL's EXECUTE function. screen shot of example usage

Click here for an example of animated GIF output for wavepacket scattering from a well.
Click here for an example of animated GIF output for wavepacket scattering and tunneling from a barrier.

File selection utility that allows additional functionality beyond DIALOG_PICKFILE. In particular it is possible to use the FILTER_IN to specify a filetype filter. On input the user can specify which files to display when the dialog first launches. If the user changes the filter in the "Filter" text box then the new filter string is passed out of the function via the FILTER_OUT keyword. Requires IDL 6.1 and higher (version updated 02/16/05) screen shot of example usage

This function returns the nodes of an equilateral n-dimensional simplex.  The input parameter is the dimenion of the desired simplex (an integer greater than 0).  Input keywords specify the center of the resulting simplex (vector of length n-dimension) and the radius (scalar) of the hypersphere upon which the nodes are located.  The default is a center at the origin and unit radius.

This simple widget program solves the Schrodinger equation in one dimension using the discrete variable approximation. The user can type in a function of x that represents the potential (in IDL syntax), and the eigenvalues and probability density are calculated for that potential. The accuracy of the eigenvalues increases as the size of the Hamiltonian increases but at the cost of processing speed.
Screen shot

This widget program simulates simple calculator operations. This program was developed for an IDL applications development course.
Screen shot

This widget program simulates a simple analog clock. This program was developed for an IDL applications development course.
Screen shot

This widget program is based on the original TETRIS.PRO written by Ray Sterner (Johns Hopkins Applied Research Lab). It requires the object class PRINTOBJ__DEFINE.PRO found below. This program was developed for an IDL applications development course.
Screen shot

This object class is used in XTETRIS.PRO above for easily updating a graphics screen with text. This program was developed for an IDL applications development course.

Object class definition for artificial self-driven, interacting particles (similar to BOIDS) that are capable of swarming-type cooperative behavior. Implementation of this class can be found in the widget program called XSWARM, appended to the end of this class definition. To run the widget program, compile this file and type XSWARM at the IDL command line.
Screen shot

This simple widget program is a demonstration of combining objects and widgets in an application and was written as a learning exercise.  The program simulates flipping a (possibly biased) coin and displays the evolution of the distribution as the number of coin tosses increases.  This program uses widget timer events for the animation of the evolution of the distribution.
Screen shot

This is a simple widget program that mimics the old carnival game-of-chance called chuck-a-luck.  Rather than using the compound dice widget that comes with the IDL distribution, a new object widget class (called with RMD_DICE) is included that is written so that common blocks are not necessary.  PDF documentation on compound widget objects and this particular set of programs can be found here.
Screen shot


This software is provided without any warranty whatsoever.  Permission to use, copy, modify, and distribute modified or unmodified copies is granted provided that this disclaimer is included unchanged.