#!bash
FPrefix=fsw+
FSuffix=.png
Nstart=1000
Nend=1750
Estart=0.1
Estep=0.0132

# wl - WriteLines function (saves some typing).
function wl() {
  Etot=`echo "$Estart+$Estep*($1-$Nstart)" | bc`
  echo "set output \"$FPrefix$1$FSuffix\""
  echo "plot 0 title \"gamma = $Etot\", x*tan($Etot*x)-sqrt(1-(x*x)) title ee"
  echo ""
}

# Output the shared stuff.
cat generic.gnuplot
echo ""

# The important part...a loop.
N=$Nstart
while [ "$N" -le "$Nend" ]
do
  wl $N      # Output plot commands
  ((N += 1)) # Increment the frame/image counter
done

exit 0

