#! /bin/sh # plot energy conservation for the harmonic oscillator orbits wait=$1 label='Harmonic Oscillator Potential, q=0.9, \dot{y}_i=0.5' date=`date '+%D %H:%M'` sm -s << FIN if ($wait) {xterm_p} else {laser_pp 'energy.ho.ps' \n lweight 2} expand 0.85 macro plt 4 { sixwin \$1 da ho.q0.9.ydot0.5.\$2.dt\$3 lines 2 10000 read {t 1 de 6} set xx = de concat (-de) limits -1 41 xx box connect t de limits 0 10 0 10 relocate 5 -1.5 putlabel 5 t relocate -2.0 5 putlabel 4 \Delta E relocate 0 10.5 putlabel 6 \$4, dt=\$3 } plt 1 eul 0.01 Euler plt 3 eul 0.001 Euler plt 5 eul 0.0001 Euler plt 2 leap 0.01 Leapfrog plt 4 leap 0.001 Leapfrog plt 6 leap 0.0001 Leapfrog ctype 0 expand 1.1 location 5000 29000 22530 30000 limits 0 10 0 10 relocate 5 12 putlabel 5 $label #putdate "$date" if ($wait) {!sleep $wait} else {hardcopy} FIN