Menu

#67 Add graphical output

0.2.0
done
nobody
None
nobody
2017-11-10
2016-07-08
Ulf Lorenz
No

It should be possible for the user to easily visualize the wave function in various ways. As a first step towards this goal, implement visualization for a simple one-dimensional wave function on the respective grid.

Technical Details

  • The visualization should be done by a special PropagationObserver that can be attached to the propagation to visualize.
  • The observer should write out data files with the minimum content "x, |psi(x)|, arg(psi(x))", so that the full information is available. The name of the data files should be specifiable with some automatic suffix (step number or so). Additional metadata should be available as comments at least.
  • The observer should write out the current time step in a separate file, so that the user does not have to follow in detail what files were written.
  • Optionally, the observer should also write out for each data file a Gnuplot file that can be processed with Gnuplot to obtain an image of the wave function.
  • The gnuplot output should be easily customizable. As an idea: write a " header" file that lays out everything, and have the gnuplot files for each timestep only include the file and set some variables.

Additional points:

  • The plotting needs a tutorial to demonstrate the feature.
  • Would additional convenience scripts be useful? Examples would be: make a movie out of the gnuplot files, always show the current time step.
  • Can it be implemented that the current time step is always shown on the screen? Either by calling a settable external program from the code or through additional scripts?

Discarded Idea:

We want to have MathGL as an optional dependency to produce graphical output with.
Tasks:

  • upgrade build: allow optional linking against MathGL if requested and available.
  • Note: There are some special restrictions with regard to the MathGL license (LGPL applicability)
  • add a simple plotting functionality (as a PropagationObserver) for a one-dimensional wave function. This class may be limited in features, it mainly serves as a target to get the MathGL dependency up and running.
  • upgrade the build image
  • add a demo and a tutorial/documentation on how to use this feature.

Additional work:

  • add more plotting options
  • completely hide the MathGL interface (so that only the library is required for linking user programs); does this make sense?

Problems with this idea:

  • MathGL is a significant additional dependency. It also introduces further dependencies depending on the backend used.
  • Already minor customization requires essentially writing the MathGL code yourself or exposing a lot of interface.
  • For plotting, Gnuplot or similar is probably the better choice because of the extensive customization involved (and it is easier to do). However, then we effectively duplicate all plotting code, once for MathGL, once for Gnuplot.

Discussion

  • Ulf Lorenz

    Ulf Lorenz - 2017-11-10

    Dropped the writing of the current timestep.

    Noone (as of now) uses it, so it is not clear if this is a useful feature, but it makes the setup more complicated (more things for the user to know). And the advanced features (automatically calling an external program) are difficult to implement in a usable way.

     

    Last edit: Ulf Lorenz 2017-11-10
  • Ulf Lorenz

    Ulf Lorenz - 2017-11-10
    • status: assigned --> done
    • assigned_to: Ulf Lorenz --> nobody
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.