#! /bin/sh ############################################################ # This shell script is a "front-end" to 2body which # expedites the analysis of the results from that code, # including the generation of Postscript plots of the # particle position, d(energy), d(angular momentum) as a # function of time using gnuplot. # # History: Doit # # This is Doit with the vast majority of the comments # removed. ############################################################ ############################################################ # Set defaults ############################################################ tmax=5.0 dt=0.05 tol=1.0d-6 ############################################################ # Usage ############################################################ Usage() { cat< [] Default tol: $tol y0 = 1.0 will produce circular orbit. To enable automatic previewing of Postscript files set GHOSTVIEW environment variable to any non-blank value, e.g. setenv GHOSTVIEW on END exit 1 } ############################################################ # Subroutine (fcn) to produce postscript version of # gnuplot plot of data stored in file $1. Postscript # file will be called $1.ps. If optional second argument # is supplied, the resulting Postscript file will be # 'ghostview'ed. ############################################################ gnuplot_it() { gnuplot< $ofile nth 2 3 < $ofile > xcyc_$tag nth 1 2 < $ofile > xc_$tag nth 1 3 < $ofile > yc_$tag nth 1 4 < $ofile > dEtot_$tag nth 1 5 < $ofile > dJtot_$tag for f in xcyc_$tag xc_$tag yc_$tag dEtot_$tag dJtot_$tag; do gnuplot_it $f $GHOSTVIEW /bin/rm $f done /bin/ls -l *$tag*.ps exit 0