program emin(output);
(* E theoretical curve
   Thomas Schneider
*)

label 1; (* end of program *)

const
(* begin module version *)
version = 1.36; (* of emin.p 1996 Feb 13
version for edmm publication: 1.27, 1990 June 4
origin 1985 dec 20 *)
(* end module version *)

(* begin module describe.emin *)
(*
name
      emin: E theoretical curve

synopsis
      emin(output)

files
      output: E theoretical curve in PostScript

description
      A graph of theoretical E.

documentation

@article{Schneider.edmm,
author = "T. D. Schneider",
title = "Theory of Molecular Machines.
{II. Energy} Dissipation from Molecular Machines",
journal = "J. Theor. Biol.",
volume = "148",
number = "1",
pages = "125-137",
year = 1991}

author
      Thomas Schneider

bugs
      none known
*)
(* end module describe.emin *)

(* begin module pic.const *)
   pi = 3.14159265354; (* circumference divided by diameter of circle *)
   picwidth = 8; (* width of numbers printed to the file *)
   picdecim = 5; (* number of decimal places for numbers *)
   charwidth = 0.0625; (* the width of characters in inches (ie, inches/char)
                        this allows centering of strings. *)
   (* note: for the Times-Roman  font, 0.0625 is a good value.
            for the Courier-Bold font, 0.08   is a good value. *)
   dotfactor = 0.00625; (* the size of dots *)
   defscale = 72; (* default scale factor.  coordinate units per in *)
{   defscale = 28.35; }(* default scale factor.  coordinate units per cm *)
{ making this change would be a big shock to all the programs that
use it, unfortunately.  A major user is xyplo. }
(* end module pic.const version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module interact.const *)
      maxstring = 150; (* the maximum string *)
(* end module interact.const version = 2.68; (@ of dops.p 1995 Nov 8 *)
 
type
(* begin module interact.type *)
      string = record (* a string of characters *)
         letters: array[1..maxstring] of char; (* the letters in the string *)
         length: integer; (* the number of characters in the string *)
         current: integer; (* the letter we are working on *)
      end;
(* end module interact.type version = 2.68; (@ of dops.p 1995 Nov 8 *)

var
(* begin module pic.var *)
   inpicture: boolean; (* true if we are drawing the picture,
                          ie, startpic has been called *)
   picxglobal, picyglobal: real; (* absolute location in the graph *)
   pictolerance: real; (* 10 raised to the picwidth,
      to detect values close to zero *)

   scale: real; (* scale factor.  graphic coordinate units per inch *)

(* NONSTANDARD for efficient use of postscript, keep track of
whether there is a current path *)
   inpath: boolean;

(* NONSTANDARD keep track of number of segments drawn so that
they can be stroked.  This (probably) solves the problem of the
Apple printer dying because it can't handle the data. *)
   segments: integer;

   xsideold, ysideold: real; (* current size of a rectangle.  see rectsize *)
(* end module pic.var version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module halt *)
procedure halt;
(* stop the program.  the procedure performs a goto to the end of the
   program.  you must have a label:
      label 1;
   declared, and also the end of the program must have this label:
      1: end.
   examples are in the module libraries.
   this is the only goto in the delila system. *)
begin
      writeln(output,' program halt.');
      goto 1
end;
(* end module halt version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module interact.clearstring *)
procedure clearstring(var ribbon: string);
(* empty the string *)
var   index: integer; (* to the ribbon *)
begin (* clearstring *)
      with ribbon do begin
         for index := 1 to maxstring do letters[index] := ' ';
         length := 0;
         current := 0;
      end
end; (* clearstring *)
(* end module interact.clearstring version = 2.68; (@ of dops.p 1995 Nov 8 *)
 
(* begin module interact.writestring *)
procedure writestring(var tofile: text; var s: string);
(* write the string s to file tofile, no writeln *)
var   i: integer; (* index to s *)
begin (* writestring *)
      with s do for i := 1 to length do write(tofile, letters[i])
end; (* writestring *)
(* end module interact.writestring version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.functions *)
(* ********************************************************************** *)
(* begin module pic.await *)
procedure await;
(* Wait for user to type a carriage return.  the routine assumes that
there is a global file called input. *)
begin
(* the infinite way:
    writeln(output);
    writeln(output,'*********************************');
    writeln(output,'* Use control-c to kill program *');
    writeln(output,'*********************************');
    while true do begin end;*)
end;
(* end module pic.await version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.startpic *)
procedure startpic(var afile:text; setscale,x,y: real; thefont: char);
(* open the graphics field, with the given scale, and at (x,y)
in that scale.  scale is in device coordinates per inch.
The font is chosen with thefont; t = Times-Roman, c = Courier-Bold *)
(* start pic output to file afile, set the globals *)
(* NONSTANDARD *)
(* this is the actual "world" coordinates used: *)
(*                        xmin,  xmax,  ymin, ymax *)
(*    ns; if (setwindow(-5.0/scale, +5.0/scale, -5.0/scale, +5.0/scale)*)
begin
   writeln(afile,'gsave'); (* save the current graphics state *)

   writeln(afile,'% initgraphics'); (* make sure the printer
           is ready to print, without this, sometimes an Apple laserwriter
           will print the graph upside down, tiny and backwards! *)

   scale := setscale; (* set the global scale *)
   writeln(afile,'% clear erasepage'); (* clean residue from before *)

   case thefont of
      'c': begin
           writeln(afile,'/Courier-Bold findfont'); (* locate the font *)
           writeln(afile,10:1,' scalefont'); (* set the font size in points*)
      end;
      't': begin
           writeln(afile,'/Times-Roman findfont'); (* locate the font *)
           writeln(afile,12:1,' scalefont'); (* set the font size in points*)
      end;
   end;

   writeln(afile,'setfont'); (* put the font into the current font *)

(* If the following statement is done then it will work on the sun, but will
kill the applewriter!!!!

Sun's non-standard PostScript extension, setlinewidth has default 0,
as stated in the Read This First and the NeWS Manual.
This draws very quickly with 1 bit wide lines.
If '1 setlinequality' is not done, then one cannot set the width of lines.
So to use PostScript on the screen, I must first do
'1 setlinequality'.  However, if I send this code to the Applewriter,
it kills PostScript on the Applewriter and I get no output whatsoever!
(It took me several hours to figure this out, since once PostScript is killed
on the Applewriter, the NEXT output is also smashed and I had to figure that
out also...)

So a standard PostScript program will not work correctly with the
default.  "Correcting" the PostScript program so that it works on the
Sun means that it BOMBS on the Applewriter.

The default for setlinequality should be '1 setlinequality' so that
the same PostScript code can be used both on the Sun and with other devices.
If you want speed, use the nonstandard form.
An alternative is to redefine setlinequality so that '0 setlinequality'
does give correct results with standard PostScript.

Please review this, Randy.  I think that Sun should fix it.
   writeln(afile,'1 setlinequality');  makes lines at least 1 bit wide *)

   (* set the scale to inches
   writeln(afile,
                 scale:picwidth:picdecim,' ',
                 scale:picwidth:picdecim,' scale'); *)

   (* define some things in postscript *)
   (* doline allows less stuff to be put in the output file.
      it takes two numbers off the stack, copies them, draws a line
      to them as coordinates. *)
(* replaced by 'currentpoint translate'
   writeln(afile,'/doline { 2 copy lineto } def');
*)
   (* define a function that makes inches out of a number *)
(* do this all internally here, it's faster
   writeln(afile,'/i { ',scale:picwidth:picdecim,' mul} def');
*)

   (* move to the start point on the page *)
   writeln(afile,
                     (x*scale):picwidth:picdecim,
                 ' ',(y*scale):picwidth:picdecim,
                 ' translate');

    writeln(afile);
    writeln(afile,'% Define functions so the text produced is smaller');
    writeln(afile,'/a {stroke newpath 0 0} def     % special for arc');
    writeln(afile,'/c {stroke 0 0 moveto} def      % current point');
    writeln(afile,'/f {findfont 10 scalefont setfont} def');
    writeln(afile,'   % to set fonts simply use the f function.  Example:');
    writeln(afile,'   %/Symbol f (\142) /Courier-Bold f (-galactosidase');
    writeln(afile,'/l {lineto} def');
    writeln(afile,'/m {moveto} def');
    writeln(afile,'/n {stroke newpath 0 0 moveto} def'); (* new segment *)
    writeln(afile,'/rl {rlineto} def');
    writeln(afile,'/rm {rmoveto} def');
    writeln(afile,'/s {newpath 0 0 moveto} def     % Start path ');
    writeln(afile,'/t {currentpoint translate} def % translate ');
    writeln(afile,'/x {show} def                   % show teXt ');
    writeln(afile);

   (* start out the pathway *)
   inpath := false;
   (* start the number of segments written: *)
   segments := 0;

   (* now for the normal pic stuff: *)
   inpicture := true;
   picxglobal := 0.0;
   picyglobal := 0.0;
   pictolerance := trunc(exp(picwidth*ln(10))+0.5)
(*;writeln(output,'pictolerance = ',pictolerance:picwidth:picdecim);*)
end;
(* end module pic.startpic version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.stoppic *)
procedure stoppic(var afile:text);
(* stop pic output to file afile *)
(* NONSTANDARD *)
begin
    if inpath then begin
       writeln(afile,'stroke');
       inpath := false
    end;

    writeln(afile,'showpage');
    writeln(afile,'grestore'); (* restore the current graphics state
                                  to what it was before the startpic *)

    await;

    inpicture := false;
end;
(* end module pic.stoppic version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.drawr *)
procedure drawr(var afile: text; dx,dy: real; visibility: char;
               spacing: real);
(* make a line to file afile by relative draw of dx,dy with visibility
  i invisible
  - dashed
  . dotted
  l line
with the dashes or dots separated by the spacing given
(this has no effect with invisible and line). *)
(* NONSTANDARD *)
var
   ddx,ddy: real; (* changes in dx and dy for dots and dashes *)
   dr: real; (* the hypotenuse, the distance actually drawn *)
   on: boolean; (* draw linesegment if true *)
   y: real; (* the variable for tracking dots and dashes *)
   r: integer; (* number of times to cycle for dots and dashes *)
   ss: real; (* precalculated value to make things a bit faster *)
   theta: real; (* angle of the line *)
procedure checkseg(var afile: text);
(* NONSTANDARD checks how many segments have been written, if
more than 'buffer', stroke them to the postscript page *)
const buffer = 10;
begin
   if segments >= buffer
   then begin
   (* New segment: writeln(afile,'stroke newpath 0 0 moveto'); *)
      writeln(afile,'n');
      segments := 0
   end
   else segments := segments + 1;
end;
begin (* drawr *)
   if not inpath then begin
      (* starts from current coordinates *)
      (* Start path: writeln(afile,'newpath 0 0 moveto'); *)
      writeln(afile,'s');
      inpath := true
   end
   else checkseg(afile);
(* checks
if not (visibility in ['l','i','.','-'])
then writeln(afile,'%YELLLLLL!!!',visibility,'!');
writeln(afile,'% ',visibility,' line');*)

   (* put these on the stack, they will always be used *)
   write(afile,    (dx*scale):picwidth:picdecim,
               ' ',(dy*scale):picwidth:picdecim);
   case visibility of
  'l','i': begin
              case visibility of
                 'i': write(afile,' m');
                 'l': write(afile,' l');
              end
           end;
  '.','-': begin (* make up our own dots and dashes *)
              writeln(afile); (* move away from the (dx,dy) on the stack *)
              if spacing <= 0.0 then begin
                 writeln(output,'drawr: spacing zero with . or - line');
                 halt
              end;
              if dx = 0.0
              then begin
                 ddx := 0.0; (* avoid division by zero *)
                 ddy := scale*spacing;
                 if dy < 0 then ddy := - ddy; (* this makes sure that
                    we draw lines straight down if that was the request *)
              end
              else begin
                 (* find out the angle of the slope, intentionally
                    lose the sign *)
                 theta := arctan(abs(dy/dx));

                 ddx := scale*spacing*cos(theta);
                 ddy := scale*spacing*sin(theta);

                 (* return the sign to the little buggers *)
                 if dx < 0 then ddx := -ddx;
                 if dy < 0 then ddy := -ddy;
              end;
              y := 0;
              case visibility of
                 '.': ss := scale*dotfactor;
                 '-': on := true;
              end;

              dr := sqrt(dx*dx+dy*dy);
              for r := 1 to round(dr/spacing) do begin
                 case visibility of
                 '-': begin
                         write(afile,    (ddx):picwidth:picdecim,
                                     ' ',(ddy):picwidth:picdecim);
                         if on
                         then writeln(afile,' rl')
                         else writeln(afile,' rm');
                         on := not on
                      end;
                 '.': begin
                         (* put out a dot like in dotr *)
                         write(afile,
                                    +ss:picwidth:picdecim,' 0 rl');
                         write(afile,' ',
                                    -ss:picwidth:picdecim,' 0 rl');
                         write(afile,' ',(ddx):picwidth:picdecim,
                                     ' ',(ddy):picwidth:picdecim);
                         writeln(afile,' rm');
                      end;
                 end
              end;
              (* let's make really sure we got there!! *)
              writeln(afile,' m'); (* pulled from the stack *)
           end;
   end;

   (* an elegant way to make postscript keep a global record is
   to translate the coordinates! *)
   (* writeln(afile,' currentpoint translate'); *)
   writeln(afile,' t');

   picxglobal := picxglobal + dx;
   picyglobal := picyglobal + dy;
end;
(* end module pic.drawr version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.mover *)
procedure mover(var afile: text; dx,dy: real);
(* move relative the amount (dx, dy). *)
begin
   drawr(afile,dx,dy,'i',0.0);
end;
(* end module pic.mover version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.liner *)
procedure liner(var afile: text; dx,dy: real);
(* draw a line the relative amount (dx, dy). *)
begin
   drawr(afile,dx,dy,'l',0.0);
end;
(* end module pic.liner version = 2.68; (@ of dops.p 1995 Nov 8 *)


(* begin module pic.drawa *)
procedure drawa(var afile: text; x,y: real; visibility: char;
               spacing: real);
(* make a line to file afile to absolute coordinate x,y with visibility
  i invisible
  - dashed
  . dotted
  l line
with the dashes or dots separated by the spacing given
(this has no effect with invisible and line). *)
var
   dx, dy: real; (* differences between current and desired
                    locations *)
begin
   dx := x - picxglobal;
   dy := y - picyglobal;

   drawr(afile,dx,dy,visibility,spacing)
end;
(* end module pic.drawa version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.movea *)
procedure movea(var afile: text; x,y: real);
(* move to absolute x and y *)
begin
   drawa(afile,x,y,'i',0.0);
end;
(* end module pic.movea version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.linea *)
procedure linea(var afile: text; x,y: real);
(* draw a line from current position to absolute x and y *)
begin
   drawa(afile,x,y,'l',0.0);
end;
(* end module pic.linea version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.graphstring *)
procedure graphstring(var tofile: text; var s: string; justification: char);
(* graph the string s.  If it is recognized as a quoted string (surrounded
by double quotes), graph it without the quotes and center it.
Otherwise justify it based on the justification character:
'l' left, 'c' centered, 'r' right.
For right and centered justification, the drawing point is the same
as before the string was done.  For left justification it is at the
right of the string to allow more to be added on there.
If not in picture (global variable inpicture), there is no output *)
(* NONSTANDARD: PostScript dependent code.  Since different fonts
have different sized characters, one must rely on the PostScript
to handle the justification of the string. *)
var i: integer; (* index to s, and temporary storage *)
    quoted: boolean; (* true if the string is quoted *)
    skipping: boolean; (* true if skipping leading blanks *)
begin
   if (inpicture and (s.length > 0))
   then with s do begin
      if length > 2
      then if (letters[1]='"') and (letters[length]='"')
           then quoted := true
           else quoted := false
      else quoted := false;

      (* override so quoted strings are always centered *)
      if quoted then justification := 'c';

      (* do the non-standard postscript: *)
      if justification <> 'l' then write(tofile,'gsave ');

      (* do postscript to complete pervious path *)
      (* set current point: writeln(tofile,'stroke 0 0 moveto'); *)
      writeln(tofile,'c');

      if justification = 'c' then begin
         (* when centering, skip leading blanks *)
         if letters[1] = ' ' then skipping := true
                             else skipping := false;
      end
      else skipping := false;

      write(tofile,'('); (* begin postscript literal *)
      if quoted (* take it literally *)
      then for i := 2 to length-1 do write(tofile,letters[i])
      else for i := 1 to length
           do if skipping then begin (* skip leading blanks *)
                 if letters[i] <> ' '
                 then begin
                      skipping := false;
                      write(tofile,letters[i])
                 end
              (* else skip the blank by not writing it *)
              end
              else write(tofile,letters[i]);
      write(tofile,')'); (* end postscript literal *)

      if justification = 'c' (* center the string *)
      then write(tofile,' dup stringwidth pop neg 2 div 0 rmoveto')
      else if justification = 'r' (* rigth justify the string *)
      then write(tofile,' dup stringwidth pop neg 0 rmoveto');

      writeln(tofile,' x'); (* show the literal *)
      inpath := false; (* force new path from here *)

      if justification <> 'l' then write(tofile,'grestore ');
   end
(* There is no output if not in picture
   else begin
      writestring(tofile,s);
      writeln(tofile)
   end
 *)
end;
(* end module pic.graphstring version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.stringinteger *)
procedure stringinteger(number: integer; var name: string;
                        width: integer; leadingzeros: boolean);
(* make the string from the number, start putting characters in
after the current length point. use width characters.
if leadingzeros is true, trail zeros before the number. *)
var
   bigdigit: integer; (* the location of the biggest digit *)
   dig: integer; (* number of digits in the number *)
   place: integer; (* place to write the next digit of the number *)
   sign: integer; (* the sign of the number *)
begin
   with name do begin
      if number < 0
      then begin
         sign := -1;
         length := length + 1; (* provide room for the sign!! *)
         number := -number;
         if leadingzeros then begin
            writeln(output,'WARNING: stringinteger: the sign of a negative',
                           ' number with leading zeros is lost');
         end
      end
      else sign := +1;

      (* log 10 of the number plus 1 is the number of digits in the number.
      On this sun computer ln(1000)/ln(10) is 2.9999, which when
      truncated gives 2, rather than the desired 3.  To avoid this
      kind of problem, 0.1 is added. *)
      if number > 9
      then dig := trunc(ln(number+0.1)/ln(10))+1
      else dig := 1;

      if dig > width then begin
         writeln(output,'stringinteger: number width too small');
         writeln(output,dig:1,' digit number (',number:1,')');
         writeln(output,'does not fit in ',width:1,' characters');
         halt
      end;
      if leadingzeros
      then bigdigit := length + 1 (* no sign if leading zeros *)
      else begin
         bigdigit := length + width - dig + 1;

         if (bigdigit <= length) and (sign < 0) then begin
            writeln(output,'stringinteger: no room for sign');
            halt
         end;
      end;
      if sign < 0 then letters[bigdigit-1] := '-';

      for place := length + width downto bigdigit do begin
         case (number mod 10) of
            0: letters[place] := '0';
            1: letters[place] := '1';
            2: letters[place] := '2';
            3: letters[place] := '3';
            4: letters[place] := '4';
            5: letters[place] := '5';
            6: letters[place] := '6';
            7: letters[place] := '7';
            8: letters[place] := '8';
            9: letters[place] := '9';
         end;
         number := number div 10;
      end;
      length := length + width;
   end
end;
(* end module pic.stringinteger version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.stringreal *)
procedure stringreal(number: real; var name: string;
                     width, decimal: integer);
(* make the string from the real number, start putting characters in
at the start point. use width characters and decimal characters
after the decimal place *)
   (* note that the rounding operation to get the digits below zero
      must be done first.  then the digits above zero can be lopped off.
      this makes 99.99 come out correctly to 100.0 (to 1 decimal place)
      otherwise, 99.99 -> 0.99 -> 1.0 (rounded) -> 10 (print with 1 decimal
      place), and stringinteger won't be happy about that. *)
var
   abovezero: integer; (* the number shifted above the decimal place, to
      'decimal' positions (and rounded) *)
   shift: integer; (* power of ten used to shift a number around
      relative to the decimal point *)
   sign: integer; (* the sign of the number *)
   thedecimal: integer; (* integer version of the decimal part of the number *)
   theupper: integer; (* integer version of the upper part of the number *)
begin
   if number < 0 then sign := -1
                 else sign := +1;

   number := abs(number); (* make positive *)

   (* the amount to shift the number above zero *)
   shift := round(exp(decimal*ln(10))); (* amount to move above zero *)
   abovezero := round(number*shift); (* move above zero, round off *)
   theupper := trunc(abovezero/shift);
   thedecimal := abovezero - shift*theupper;

   (* create the actual real number *)
   (* before decimal point *)
   stringinteger(sign*theupper,name,width-decimal-1,false);
   with name do begin (* put in the decimal point *)
      length := length + 1;
      letters[length] := '.';
   end;
   stringinteger(thedecimal,name,decimal,true); (* after decimal point *)
end;
(* end module pic.stringreal version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.picnumber *)
procedure picnumber(var afile: text;
                    dx, dy, number: real; width, decimal: integer;
                    justification: char);
(* Supply graphic commands for a 'number' whose center is at the relative point
(dx, dy) from the current point, 'width' characters wide and 'decimal'
characters beyond the decimal point.
If the width is zero, no number is produced.
procedure stringnumber(number: integer; start: integer; var name: string);
the location after the call is the same as before the call.
The string is optionally justified: left, centered or right: lcr. *)
var
   name: string; (* the string to pack the number into for shipping out *)
begin
   if width > 0 then begin
      mover(afile,dx,dy);

      clearstring(name);

      if decimal>0
      then stringreal(number,name,width,decimal)
      else stringinteger(round(number),name,width,false);

      graphstring(afile, name, justification);
      mover(afile,-dx,-dy);
   end
end;
(* end module pic.picnumber version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.xtic *)
procedure xtic(var afile: text; length, dx, dy, number: real;
               width, decimal: integer;
               logxnormal: boolean;
               logxbase: real);
(* produce a tic mark for the x axis of "length" long.
Supply a number whose center is at the relative point (dx, dy)
from the end to the tick, 'width' characters wide and 'decimal'
characters beyond the decimal point.
If the width is zero, no number is produced.
the location after the call is the same as before the call.
If logxnormal is true, then raise the number
to logxbase. *)
begin
   liner(afile,0.0,-length);
   if logxnormal
   then picnumber(afile,dx,dy,exp(number*logxbase),width,decimal,'c')
   else picnumber(afile,dx,dy,number,width,decimal,'c');
   mover(afile,0.0,length);
end;
(* end module pic.xtic version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.ytic *)
procedure ytic(var afile: text; length, dx, dy: real;
               number: real;
               width, decimal: integer;
               logynormal: boolean;
               logybase: real);
(* produce a tic mark for the y axis of "length" long.
Supply a number whose right side is started at the relative point (dx, dy)
from the end to the tick, 'width' characters wide and 'decimal'
characters beyond the decimal point.
If the width is zero, no number is produced.
the location after the call is the same as before the call.
If logynormal is true, then raise the number
to logybase. *)
begin
   liner(afile,-length,0.0);

   (* convert the number if we are doing logynormal: *)
   if logynormal then number := exp(number*logybase);

   picnumber(afile,dx,dy,number,width,decimal,'r');
   mover(afile,length,0.0);
end;
(* end module pic.ytic version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.doaxis *)
procedure doaxis(var afile: text;
         theaxis: char;
         alength,fromtic,interval,totic: real;
         subintervals: real;
         length, dx, dy: real;
         width, decimal: integer;
         logscale, lognormal: boolean;
         logbase: real);
(* draw an axis starting from the current position.
Which axis it is is defined by theaxis, 'x' (horizontal) or 'y' (vertical).
Combining the code for both axes into one procedure is a little
slower, but drawing the axis does note ever take significant time,
and this allows improvements to be made on both axes simultaneously.
The length of the axis is alength.
The axis is labeled with numbers starting with fromtic
at intervals given up to totic.
The remaining variables describe the form of the tic marks as in ytic.
If the width is zero, no number is produced.
the location after the call is the same as before the call.
If logscale and lognormal is true, then raise the tic numbers to logbase.
 *)
var
   half: real; (* half the jump interval.  By adding this to the while loops,
                  we assure that the very last tic gets done, and isn't lost
                  due to roundoff *)
   jump: real; (* the space to move on the graph between tic marks *)
   jumpdistance: real; (* the total jumps made.  this may not be
      a simple function of the input variables since they may
      not work out to an exact number of jumps *)
   tic: real; (* the numerical value of the tic label *)

   dosubtics: boolean; (* do sub tics *)
   subtic: real; (* the numerical value of the (unlabeled) subtic *)
   subinterval: real; (* the numerical interval between subtics *)
   subjump: real; (* the space to move on the graph between subtic marks *)
   halfsubinterval: real; (* half a subjump, see half *)

   currentspot: real; (* current graphing spot *)
   oldspot: real; (* previous graphing spot *)
   axisscale: real; (* axis scaling factor *)

begin

{
writeln(output,'In doaxis');
writeln(output,'interval=',interval:10:4);
writeln(output,'subintervals=',subintervals:10:4);
writeln(output,'logbase=',logbase:10:4);
}

   if theaxis = 'x' then begin
      liner(afile,+alength,0.0);
      mover(afile,-alength,0.0);
   end
   else begin
      liner(afile,0.0,+alength);
      mover(afile,0.0,-alength);
   end;

   if totic = fromtic then begin
      writeln(output,'doaxis: ',theaxis,' axis fromtic and totic',
                     ' cannot be equal');
      halt;
   end;

   if (alength = 0.0) or (interval = 0.0) then begin
      writeln(output,'doaxis: neither ',
                     theaxis,' axis length nor interval can be zero');

      halt;
   end;

   axisscale := alength / (totic - fromtic);
   jump := axisscale * interval;
   jumpdistance := 0;
   half := interval / 2.0;

   if subintervals > 1 then begin
      dosubtics := true;
      subinterval := interval/subintervals;
      halfsubinterval := subinterval / 2.0;
      subjump := jump/subintervals;
   end
   else begin
      dosubtics := false;
      subinterval := 0;
      halfsubinterval := 0;
      subjump := 0;
   end;

   tic := fromtic;
   if interval > 0.0 then while tic <= totic+half do begin
      if theaxis = 'x'
      then xtic(afile,length,dx,dy,tic,width,decimal,lognormal,logbase)
      else ytic(afile,length,dx,dy,tic,width,decimal,lognormal,logbase);

      tic := tic + interval;
      if tic <= totic+half then begin
{
writeln(output,'TIC=',tic:10:4);
writeln(afile,'% tic=',tic:10:4);
mover(afile,0.05,0.0);
}
         if dosubtics then begin (* do subtic marks *)
            if logscale then begin (* do subtic marks on log scale *)
               (* subtic starts as a "normal" number (ie, no log taken) at tic: *)
{
writeln(output,'2^tic=',exp(tic*logbase):10:4);
writeln(output,'2^(tic+interval)=',exp((tic+interval)*logbase):10:4);
}
               subtic := exp(tic*logbase);
               (* subtic will proceed to the same but at tic+interval.
                  We divide that into the subintervals. *)
{
writeln(output,'halfsubinterval=',halfsubinterval:10:4,' original');
}
               subinterval := (exp((tic+interval)*logbase) - subtic)/subintervals;
               halfsubinterval := subinterval/2.0;

{
writeln(output,'subtic=         ',subtic:10:4);
writeln(output,'subinterval=    ',subinterval:10:4);
writeln(output,'halfsubinterval=',halfsubinterval:10:4);
}

               oldspot := axisscale * tic;
	       while subtic < exp(logbase*(tic+interval)) - halfsubinterval
	       do begin

                  (* although tic is on a log scale,
                     we have to have subtic on the regular scale
                     to alter the positions of the subtics *)

                  (* if subinterval is constant,
                     the following makes linearly spaced marks: *)
                  subtic := subtic + subinterval;

                  (* the actual jumps have to be in the log form: *)
                  currentspot := axisscale*ln(subtic)/logbase;
                  subjump := currentspot - oldspot;
{
writeln(output,'       SUBTIC=',subtic:10:4);
writeln(output,'       ln(SUBTIC)/logbase=',ln(subtic)/logbase:10:4);
writeln(output,'       currentspot=',currentspot:10:4);
writeln(output,'       subjump=',subjump:10:4);
writeln(output,'       oldspot=',oldspot:10:4);
writeln(afile,'% subtic=',subtic:10:4);
}
                  oldspot := currentspot;


                  if theaxis = 'x' then begin
                     xtic(afile,length/2,dx,dy,0,0,0,lognormal,logbase);
                     mover(afile,subjump,0.0);
                  end
                  else begin
                     ytic(afile,length/2,dx,dy,0,0,0,lognormal,logbase);
                     mover(afile,0.0,subjump);
                  end;

                  jumpdistance := jumpdistance + subjump;
               end
            end
            else begin (* do subtic marks on regular scale *)
               subtic := tic;
               while subtic < tic+interval-halfsubinterval do begin
                  subtic := subtic + subinterval;

                  if theaxis = 'x' then begin
                     mover(afile,subjump,0.0);
                     xtic(afile,length/2,dx,dy,0,0,0,lognormal,logbase);
                  end
                  else begin
                     mover(afile,0.0,subjump);
                     ytic(afile,length/2,dx,dy,0,0,0,lognormal,logbase);
                  end;

                  jumpdistance := jumpdistance + subjump;
               end
            end
         end
         else begin (* do regular tic marks *)
            if theaxis = 'x' then mover(afile,jump,0.0)
                             else mover(afile,0.0,jump);
            jumpdistance := jumpdistance + jump
         end
      end
   end
   else if interval < 0.0 then while tic >= totic-half do begin
      if dosubtics then writeln(output,'Sorry, no subtics with negative scales');

      if theaxis = 'x'
      then xtic(afile,length,dx,dy,tic,width,decimal,lognormal,logbase)
      else ytic(afile,length,dx,dy,tic,width,decimal,lognormal,logbase);

      tic := tic + interval;
      if tic >= totic-half then begin
         if theaxis = 'x' then mover(afile,jump,0.0)
                          else mover(afile,0.0,jump);
         jumpdistance := jumpdistance + jump
      end
   end;

   if theaxis = 'x' then mover(afile,-jumpdistance,0.0)
                    else mover(afile,0.0,-jumpdistance)
end;
(* end module pic.doaxis version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.xaxis *)
procedure xaxis(var afile: text;
         axlength,fromtic,interval,totic: real;
         xsubintervals: real;
         length, dx, dy: real;
         width, decimal: integer;
         logxscale, logxnormal: boolean;
         logxbase: real);
(* draw an x axis starting from the current position. *)
begin
   doaxis(afile,
         'x',
         axlength,fromtic,interval,totic,
         xsubintervals,
         length, dx, dy,
         width, decimal,
         logxscale, logxnormal,
         logxbase)
end;
(* end module pic.xaxis version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module pic.yaxis *)
procedure yaxis(var afile: text;
         aylength,fromtic,interval,totic: real;
         ysubintervals: real;
         length, dx, dy: real;
         width, decimal: integer;
         logyscale, logynormal: boolean;
         logybase: real);
(* draw an y axis starting from the current position. *)
begin
   doaxis(afile,
         'y',
         aylength,fromtic,interval,totic,
         ysubintervals,
         length, dx, dy,
         width, decimal,
         logyscale, logynormal,
         logybase)
end;
(* end module pic.yaxis version = 2.68; (@ of dops.p 1995 Nov 8 *)
(* ********************************************************************** *)
(* end module pic.functions version = 2.68; (@ of dops.p 1995 Nov 8 *)

(* begin module eeminsymbol *)
procedure eeminsymbol(var f: text);
(* write the symbol for E/Emin to file f.
The code for this was generated using LaTeX of

% version = 1.00 of eemin.tex 1990 June 4
% make an E/Emin symbol for the emin.ps figure
\documentstyle[12pt]{article}
\input definitions
\topmargin 0.125in % shift the whole thing up
%
\begin{document}
\pagestyle{empty}
\large
\setlength{\parindent}{0.620in}
%$\epsilon_{\mbox{\normalsize t}}$
$\E / \Emin $
\end{document}

LaTeX created a dvi file, which was converted to PostScript
using dvips -f.  The showpage must be removed from the code below.
Also don't have writeln(f,'') !!!  That is pascal bug.3,
it makes null characters that blow PostScript. *)
begin

(* xv -> ps method *)
(*
writeln(f,'/eemin save def');
writeln(f,'%!PS-Adobe-2.0 EPSF-2.0');
{writeln(f,'%%Title: /home/kaylor/toms/paper/edmm/fig/emin.via.xv.ps');}
{writeln(f,'%%Creator: XV Version 3.10  Rev: 12/16/94  -  by John Bradley');}
{writeln(f,'%%BoundingBox: 132 639 194 667');}
{writeln(f,'%%Pages: 1');}
{writeln(f,'%%DocumentFonts:');}
{writeln(f,'%%EndComments');}
{writeln(f,'%%EndProlog');}
writeln(f);
{writeln(f,'%%Page: 1 1');}
writeln(f);
writeln(f,'% remember original state');
writeln(f,'/origstate save def');
writeln(f);
writeln(f,'% build a temporary dictionary');
writeln(f,'20 dict begin');
writeln(f);
writeln(f,'% define string to hold a scanline''s worth of data');
writeln(f,'/pix 186 string def');
writeln(f);
writeln(f,'% define space for color conversions');
writeln(f,'/grays 62 string def  % space for gray scale line');
writeln(f,'/npixls 0 def');
writeln(f,'/rgbindx 0 def');
writeln(f);
writeln(f,'% lower left corner');
writeln(f,'132 639 translate');
writeln(f);
writeln(f,'% size of image (on paper, in 1/72inch coords)');
writeln(f,'61.99200 28.00800 scale');
writeln(f);
writeln(f,'% define ''colorimage'' if it isn''t defined');
writeln(f,'%   (''colortogray'' and ''mergeprocs'' come from xwd2ps');
writeln(f,'%     via xgrab)');
writeln(f,'/colorimage where   % do we know about ''colorimage''?');
writeln(f,'  { pop }           % yes: pop off the ''dict'' returned');
writeln(f,'  {                 % no:  define one');
writeln(f,'    /colortogray {  % define an RGB->I function');
writeln(f,'      /rgbdata exch store    % call input ''rgbdata''');
writeln(f,'      rgbdata length 3 idiv');
writeln(f,'      /npixls exch store');
writeln(f,'      /rgbindx 0 store');
writeln(f,'      0 1 npixls 1 sub {');
writeln(f,'        grays exch');
writeln(f,'        rgbdata rgbindx       get 20 mul    % Red');
writeln(f,'        rgbdata rgbindx 1 add get 32 mul    % Green');
writeln(f,'        rgbdata rgbindx 2 add get 12 mul    % Blue');
writeln(f,'        add add 64 idiv      % I = .5G + .31R + .18B');
writeln(f,'        put');
writeln(f,'        /rgbindx rgbindx 3 add store');
writeln(f,'      } for');
writeln(f,'      grays 0 npixls getinterval');
writeln(f,'    } bind def');
writeln(f);
writeln(f,'    % Utility procedure for colorimage operator.');
writeln(f,'    % This procedure takes two procedures off the');
writeln(f,'    % stack and merges them into a single procedure.');
writeln(f);
writeln(f,'    /mergeprocs { % def');
writeln(f,'      dup length');
writeln(f,'      3 -1 roll');
writeln(f,'      dup');
writeln(f,'      length');
writeln(f,'      dup');
writeln(f,'      5 1 roll');
writeln(f,'      3 -1 roll');
writeln(f,'      add');
writeln(f,'      array cvx');
writeln(f,'      dup');
writeln(f,'      3 -1 roll');
writeln(f,'      0 exch');
writeln(f,'      putinterval');
writeln(f,'      dup');
writeln(f,'      4 2 roll');
writeln(f,'      putinterval');
writeln(f,'    } bind def');
writeln(f);
writeln(f,'    /colorimage { % def');
writeln(f,'      pop pop     % remove ''false 3'' operands');
writeln(f,'      {colortogray} mergeprocs');
writeln(f,'      image');
writeln(f,'    } bind def');
writeln(f,'  } ifelse          % end of ''false'' case');
writeln(f);
writeln(f);
writeln(f);
writeln(f,'62 28 8			% dimensions of data');
writeln(f,'[62 0 0 -28 0 28]		% mapping matrix');
writeln(f,'{currentfile pix readhexstring pop}');
writeln(f,'false 3 colorimage');
writeln(f);
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000');
writeln(f,'000000000000ffffffffffffffffffffffffffffffffffffffffff000000000000ffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffff000000000000000000000000ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000');
writeln(f,'000000000000ffffffffffffffffffffffffffffffffffffffffff000000ffffffffffff');
writeln(f,'ffffffffffffffffffffffff000000000000000000000000000000000000ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffffff');
writeln(f,'000000000000ffffffffffffffffffffffffffffffffffff000000000000ffffffffffff');
writeln(f,'ffffffffffffffffff000000000000ffffffffffffffffff000000000000ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffff');
writeln(f,'000000ffffffffffffffffffffffffffffffffffffffffff000000000000ffffffffffff');
writeln(f,'ffffffffffff000000000000ffffffffffffffffffffffff000000ffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffff000000000000000000ffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff');
writeln(f,'ffffffffffff000000000000000000ffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffff000000000000000000ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffff');
writeln(f,'ffffffffffffffffff000000000000000000ffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000ffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffff000000000000000000ffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffff');
writeln(f,'ffffffffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffff');
writeln(f,'ffffffffffff000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffff');
writeln(f,'ffffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffff000000000000ffffffffffffffffffffffffffffff000000');
writeln(f,'000000ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffff');
writeln(f,'000000000000ffffffffffffffffffffffffffffff000000000000ffffff000000ffffff');
writeln(f,'ffffff000000000000ffffff000000000000ffffffffffffffffff000000000000ffffff');
writeln(f,'ffffff000000ffffffffffff000000000000ffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffff000000000000000000ffffffffffffffffff000000000000');
writeln(f,'ffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffffffffff');
writeln(f,'000000000000000000ffffffffffffffffff000000000000ffffffffffffffffff000000');
writeln(f,'000000ffffff000000000000ffffff000000000000ffffffffffffffffff000000ffffff');
writeln(f,'ffffffffffff000000000000ffffff000000ffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffff000000000000000000000000000000000000ffffff');
writeln(f,'ffffffffffffffffffffffffffffff000000000000ffffffffffffffffffffffffffffff');
writeln(f,'ffffff000000000000000000000000000000000000ffffffffffff000000ffffff000000');
writeln(f,'ffffffffffff000000000000ffffff000000000000ffffff000000ffffff000000ffffff');
writeln(f,'000000ffffff000000ffffffffffff000000ffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffff000000000000000000ffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff000000000000000000ffffffffffffffffffffffffffffff000000000000');
writeln(f,'ffffffffffff000000ffffffffffff000000000000ffffffffffff000000000000ffffff');
writeln(f,'ffffff000000000000ffffffffffff000000ffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffff');
writeln(f,'ffffffffffff000000ffffffffffff000000ffffffffffffffffff000000ffffff000000');
writeln(f,'ffffff000000ffffffffffff000000000000000000ffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffff000000000000ffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000ffffff');
writeln(f,'ffffff000000000000ffffffffffff000000000000ffffffffffff000000000000ffffff');
writeln(f,'ffffff000000ffffffffffff000000000000000000ffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffff000000ffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
writeln(f,'ffffffffffff');
writeln(f);
{ STOP writeln(f,'showpage');}
writeln(f);
writeln(f,'% stop using temporary dictionary');
writeln(f,'end');
writeln(f);
writeln(f,'% restore original state');
writeln(f,'origstate restore');
writeln(f);
{writeln(f,'%%Trailer');}
writeln(f,'eemin restore');
*)

(* latex -> postscript method *)
writeln(f,'/eemin save def');
writeln(f,'%!PS-Adobe-2.0');
{writeln(f,'%%Creator: dvips 5.493 Copyright 1986, 1992 Radical Eye Software');}
{writeln(f,'%%Title: eemin.dvi');}
{writeln(f,'%%Pages: 1');}
{writeln(f,'%%PageOrder: Ascend');}
{writeln(f,'%%BoundingBox: 0 0 612 792');}
{writeln(f,'%%EndComments');}
{writeln(f,'%DVIPSCommandLine: dvips -f eemin');
{writeln(f,'%DVIPSSource:  TeX output 1996.02.13:0115');
{writeln(f,'%%BeginProcSet: tex.pro');}
{writeln(f,'%!');}
writeln(f,'/TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N /X{S N}');
writeln(f,'B /TR{translate}N /isls false N /vsize 11 72 mul N /@rigin{isls{[0 -1 1 0 0 0]');
writeln(f,'concat}if 72 Resolution div 72 VResolution div neg scale isls{Resolution hsize');
writeln(f,'-72 div mul 0 TR}if Resolution VResolution vsize -72 div 1 add mul TR matrix');
writeln(f,'currentmatrix dup dup 4 get round 4 exch put dup dup 5 get round 5 exch put');
writeln(f,'setmatrix}N /@landscape{/isls true N}B /@manualfeed{statusdict /manualfeed');
writeln(f,'true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N');
writeln(f,'/IE 0 N /ctr 0 N /df-tail{/nn 8 dict N nn begin /FontType 3 N /FontMatrix');
writeln(f,'fntrx N /FontBBox FBB N string /base X array /BitMaps X /BuildChar{');
writeln(f,'CharBuilder}N /Encoding IE N end dup{/foo setfont}2 array copy cvx N load 0 nn');
writeln(f,'put /ctr 0 N[}B /df{/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0');
writeln(f,'0 sf neg 0 0]N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data');
writeln(f,'dup length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{128');
writeln(f,'ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub get 127');
writeln(f,'sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data dup type');
writeln(f,'/stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N /rc 0 N /gp 0 N');
writeln(f,'/cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup /base get 2 index get');
writeln(f,'S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 ch-xoff ch-yoff ch-height');
writeln(f,'sub ch-xoff ch-width add ch-yoff setcachedevice ch-width ch-height true[1 0 0');
writeln(f,'-1 -.1 ch-xoff sub ch-yoff .1 add]{ch-image}imagemask restore}B /D{/cc X dup');
writeln(f,'type /stringtype ne{]}if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1');
writeln(f,'ne{dup dup length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}');
writeln(f,'B /I{cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin');
writeln(f,'0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul add');
writeln(f,'.99 lt{/FV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict');
writeln(f,'/eop-hook known{eop-hook}if}N /@start{userdict /start-hook known{start-hook}');
writeln(f,'if pop /VResolution X /Resolution X 1000 div /DVImag X /IE 256 array N 0 1 255');
writeln(f,'{IE S 1 string dup 0 3 index put cvn put}for 65781.76 div /vsize X 65781.76');
writeln(f,'div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N');
writeln(f,'/ruley 0 N /v{/ruley X /rulex X V}B /V{}B /RV statusdict begin /product where{');
writeln(f,'pop product dup length 7 ge{0 7 getinterval dup(Display)eq exch 0 4');
writeln(f,'getinterval(NeXT)eq or}{pop false}ifelse}{false}ifelse end{{gsave TR -.1 -.1');
writeln(f,'TR 1 1 scale rulex ruley false RMat{BDot}imagemask grestore}}{{gsave TR -.1');
writeln(f,'-.1 TR rulex ruley scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /FV{');
writeln(f,'gsave transform round exch round exch itransform moveto rulex 0 rlineto 0');
writeln(f,'ruley neg rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N');
writeln(f,'/tail{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M}');
writeln(f,'B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{4 M}B');
writeln(f,'/w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{p 1 w}B /r{');
writeln(f,'p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p a}B /bos{/SS save');
writeln(f,'N}B /eos{SS restore}B end');
{writeln(f,'%%EndProcSet');}
writeln(f,'TeXDict begin 40258431 52099146 1000 300 300');
writeln(f,'(/home/kaylor/toms/paper/edmm/fig/eemin.dvi) @start /Fa 3 111');
writeln(f,'df<01C003C003C001800000000000000000000000001C00270047004700870087000E000E001C');
writeln(f,'001C001C003800388038807080710032001C000A1C7E9B0E>105 D<381F81F04E20C6184640E8');
writeln(f,'1C4680F01C8F00F01C8E00E01C0E00E01C0E00E01C1C01C0381C01C0381C01C0381C01C0703803');
writeln(f,'807138038071380380E1380380E2700700643003003820127E9124>109');
writeln(f,'D<381F004E61804681C04701C08F01C08E01C00E01C00E01C01C03801C03801C03801C07003807');
writeln(f,'10380710380E10380E2070064030038014127E9119>I E /Fb 1 62 df<00000C00001C00001C');
writeln(f,'0000380000380000380000700000700000700000E00000E00000E00001C00001C00001C0000380');
writeln(f,'000380000380000700000700000700000E00000E00000E00001C00001C00001C00003800003800');
writeln(f,'00380000700000700000700000E00000E00000E00001C00001C00001C000038000038000038000');
writeln(f,'0700000700000700000E00000E00000E00001C00001C00001C0000380000380000380000700000');
writeln(f,'700000700000E00000E00000C00000163C7DAC1D>61 D E /Fc 1 70 df<000007F000003FFC00');
writeln(f,'00FFFE000181FE0006007E000C003E0018003C003800380070003000F0004000F0000001F00000');
writeln(f,'01F0000001F8000001F8000001FC000000FF000000FFC000007FFC00001FF0000007E000001C00');
writeln(f,'000020000000C000000180000003000000060000000E0000001C0000003C000000380000007800');
writeln(f,'000078000020F80000C0F8000180F8000300FC000600FE000C00FF0018007FC060003FFFC0001F');
writeln(f,'FF000007F800001F2B7EA920>69 D E end');
{writeln(f,'%%EndProlog');}
{writeln(f,'%%BeginSetup');}
{writeln(f,'%%Feature: *Resolution 300dpi');}
writeln(f,'TeXDict begin');
writeln(f);
{writeln(f,'%%EndSetup');}
{writeln(f,'%%Page: 1 1');}
writeln(f,'1 0 bop 350 241 a Fc(E)5 b Fb(=)p Fc(E)448 250 y Fa(min)p eop');
{writeln(f,'%%Trailer');}
writeln(f,'end');
writeln(f,'userdict /end-hook known{end-hook}if');
{writeln(f,'%%EOF');}
writeln(f,'eemin restore');

end;
(* end module eeminsymbol *)

{zzz}

(* begin module pynysymbol *)
procedure pynysymbol(var f: text);
(* write the symbol for pyny sub t to file f.
The code for this was generated using LaTeX of

\pagestyle{empty}
\large
\setlength{\parindent}{1.7cm}
$P_y / N_y$

LaTeX created a dvi file, which was converted to PostScript
using dvips -f.  The showpage must be removed from the code below *)
begin

writeln(f,'gsave');

writeln(f,'250 -260 translate');
writeln(f,'%!PS-Adobe-2.0');
{writeln(f,'%%Creator: dvips, version 5.41 (C) 1986-90 Radical Eye Software');}
{writeln(f,'%%Title: pyny.dvi');}
{writeln(f,'%%Pages: 1 1');}
{writeln(f,'%%BoundingBox: 0 0 612 792');}
{writeln(f,'%%EndComments');}
{writeln(f,'%%BeginProcSet: tex.pro');}
writeln(f,
'/TeXDict 200 dict def TeXDict begin /N /def load def /B{bind def}N /S /exch');
writeln(f,
'load def /X{S N}B /TR /translate load N /isls false N /vsize 10 N /@rigin{');
writeln(f,
'isls{[0 1 -1 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale');
writeln(f,
'Resolution VResolution vsize neg mul TR matrix currentmatrix dup dup 4 get');
writeln(f,
'round 4 exch put dup dup 5 get round 5 exch put setmatrix}B /@letter{/vsize');
writeln(f,
'10');
writeln(f,
'N}B /@landscape{/isls true N /vsize -1 N}B /@a4{/vsize 10.6929133858 N}B');
writeln(f,
'/@a3{');
writeln(f,
'/vsize 15.5531 N}B /@ledger{/vsize 16 N}B /@legal{/vsize 13 N}B /@manualfeed{');
writeln(f,
'statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0');
writeln(f,
'0]N');
writeln(f,
'/FBB[0 0 0 0]N /df{/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf');
writeln(f,
'0');
writeln(f,
'0 sf neg 0 0]N df-tail}B /df-tail{/nn 8 dict N nn begin /FontType 3 N');
writeln(f,
'/FontMatrix fntrx N /FontBBox FBB N string /base X array /BitMaps X /BuildChar');
writeln(f,
'{CharBuilder}N /Encoding IE N end dup{/foo setfont}2 array copy cvx N load');
writeln(f,
'0');
writeln(f,
'nn put /ctr 0 N[}B /E{pop nn dup definefont setfont}B /ch-image{ch-data');
writeln(f,
'dup');
writeln(f,
'type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /ch-width{ch-data dup');
writeln(f,
'length');
writeln(f,
'5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{128 ch-data');
writeln(f,
'dup');
writeln(f,
'length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub get 127 sub}B /ch-dx{');
writeln(f,
'ch-data dup length 1 sub get}B /ctr 0 N /CharBuilder{save 3 1 roll S dup');
writeln(f,
'/base');
writeln(f,
'get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 ch-xoff');
writeln(f,
'ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice ch-width');
writeln(f,
'ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 add]{ch-image}imagemask');
writeln(f,
'restore}B /D{/cc X dup type /stringtype ne{]}if nn /base get cc ctr put');
writeln(f,
'nn');
writeln(f,
'/BitMaps get S ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf div');
writeln(f,
'put');
writeln(f,
'}if put /ctr ctr 1 add N}B /I{cc 1 add D}B /bop{userdict /bop-hook known{');
writeln(f,
'bop-hook}if /SI save N @rigin 0 0 moveto}B /eop{clear SI restore');
      (* showpage'); we can't allow this here! *)
writeln(f,
'userdict /eop-hook known{eop-hook}if}B /@start{userdict /start-hook known{');
writeln(f,
'start-hook}if /VResolution X /Resolution X 1000 div /DVImag X /IE 256 array');
writeln(f,
'N');
writeln(f,
'0 1 255{IE S 1 string dup 0 3 index put cvn put}for}B /p /show load N /RMat[1');
writeln(f,
'0 0 -1 0 0]N /BDot 260 string N /v{/ruley X /rulex X V}B /V{gsave TR -.1');
writeln(f,
'-.1');
writeln(f,
'TR 1 ruley scale rulex 1 false RMat{BDot}imagemask grestore}B /a{moveto}B');
writeln(f,
'/delta 0 N /tail{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p');
writeln(f,
'tail}');
writeln(f,
'B /c{-4 M}B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3');
writeln(f,
'M}B');
writeln(f,
'/k{4 M}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{p 1 w}B /r{p');
writeln(f,
'2 w}');
writeln(f,
'B /s{p 3 w}B /t{p 4 w}B /w{0 rmoveto}B /x{0 S rmoveto}B /y{3 2 roll p a}B');
writeln(f,
'/bos');
writeln(f,
'{/SS save N}B /eos{clear SS restore}B end');
{writeln(f,
'%%EndProcSet');}
writeln(f,
'TeXDict begin 1000 300 300 @start /Fa 1 122 df<1C00C02701C04701C04701C0870380');
writeln(f,
'8703800E03800E03801C07001C07001C07001C0700180E00180E00180E001C1E000C3C0007DC00');
writeln(f,
'001C00001800603800F03000F06000E0C0004180003E0000121A7E9114>121');
writeln(f,
'D E /Fb 3 81 df<00000600000E00000E00001C00001C00001C00003800003800003800007000');
writeln(f,
'00700000E00000E00000E00001C00001C00001C000038000038000038000070000070000070000');
writeln(f,
'0E00000E00000E00001C00001C00001C0000380000380000700000700000700000E00000E00000');
writeln(f,
'E00001C00001C00001C0000380000380000380000700000700000700000E00000E00000E00001C');
writeln(f,
'00001C0000380000380000380000700000700000700000E00000E00000C00000173C7DAC1E>61');
writeln(f,
'D<003FF80007FFC0003FFC0007FFC00000FC00007C0000017E0000300000013E0000200000013E');
writeln(f,
'0000200000011F0000200000021F0000400000020F8000400000020F8000400000020FC0004000');
writeln(f,
'000407C0008000000407C0008000000403E0008000000403E0008000000803F0010000000801F0');
writeln(f,
'010000000801F8010000000800F8010000001000F80200000010007C0200000010007C02000000');
writeln(f,
'10007E0200000020003E0400000020003F0400000020001F0400000020001F0400000040000F88');
writeln(f,
'00000040000F8800000040000FC8000000400007C8000000800007F0000000800003F000000080');
writeln(f,
'0003F0000000800001F0000001000001E0000001000001E0000003000000E000000FC00000E000');
writeln(f,
'00FFFC0000400000FFF8000040000032297EA830>78 D<003FFFFFE000003FFFFFFC000001F800');
writeln(f,
'7F000001F0001F800001F0000F800001F00007C00001F00007C00003E00007E00003E00007E000');
writeln(f,
'03E00007E00003E00007E00007C0000FC00007C0000FC00007C0000F800007C0001F80000F8000');
writeln(f,
'1F00000F80003E00000F80007C00000F8001F000001F0007E000001FFFFF0000001F0000000000');
writeln(f,
'1F00000000003E00000000003E00000000003E00000000003E00000000007C00000000007C0000');
writeln(f,
'0000007C00000000007C0000000000F80000000000F80000000000F80000000000F80000000001');
writeln(f,
'F00000000001F00000000001F00000000003F000000000FFFFC0000000FFFF800000002B297EA8');
writeln(f,'26>80 D E end');
{writeln(f,'%%EndProlog');}
{writeln(f,'%%BeginSetup');}
{writeln(f,'%%Feature: *Resolution 300');}
writeln(f,'TeXDict begin ');
{writeln(f,'%%EndSetup');}
{writeln(f,'%%Page: 1 1');}
writeln(f,'bop 365 257 a Fb(P)403 266 y Fa(y)427 257 y Fb(=)m(N)502 266');
writeln(f,'y Fa(y)p eop');
{writeln(f,'%%Trailer');}
writeln(f,'end');
writeln(f,'userdict /end-hook known{end-hook}if');
{writeln(f,'%%EOF');}

writeln(f,'grestore');
end;
(* end module pynysymbol *)

(* begin module emin.etcurve *)
procedure etcurve(var afile: text; height, width, range: real);
(* make the e theoretical curve of some height and width in inches
up to a signal to noise ratio of range.
the height is the height for Emin. *)
var
	dpn: real; (* a change in pn *)
	scalex: real; (* scale factor for x axis *)
	scaley: real; (* scale factor for y axis *)
	pn: real; (* signal to noise ratio *)
function et(pn: real):real;
(* the et function *)
begin
	if pn <> 0.0
	then et := pn/ln(1+pn)
	else et := 1.0;
end;
procedure special(pn: real);
(* produce several marks at special locations *)
const   dashlength=0.1;
var
	e: real; (* an e corresponding to pn *)
	xloc, yloc: real; (* coordinate of the point on the
	   curve which we are drawing special lines for *)
begin
	e:=et(pn);
	xloc := pn*scalex;
	yloc := e*scaley;
	movea(afile,0.0,yloc);
	ytic(afile,0.05,-0.2,-0.02,e,4,2,false,2);
	drawa(afile,xloc,yloc,'-',dashlength);
	drawa(afile,xloc,0.0,'-',dashlength)
end;
begin
	(* set up the scale factors *)
	scalex := width/range;
	scaley := height/et(range);

	(* create the axes *)
	xaxis(afile,width, 0.0,1.0,range, 1.0, 0.05,0.0,-0.12,1,0,false,false,2.0);
	movea(afile,0.0,0.0);
        linea(afile,0.0,height); (* y axis without tic marks *)
	(* yaxis(afile,height, 0.00,1.00,1.00, 0.05,-0.2,0.0,0,0);*)

	(* label x axis *)
{
	movea(afile,width+0.1,-0.05);
	writeln(afile,'(P/N) show');
}

	(* label y axis *)
	movea(afile,0.0,0.0);
	ytic(afile,0.05,-0.2,0.0,0.0, 4,2,false,2);

	movea(afile,0.0,et(0.0)*scaley);
	ytic(afile,0.05,-0.2,0.0,et(0.0), 4,2,false,2);

{
	movea(afile,-0.1,height+0.1);
	writeln(afile,'(E / Emin) show');
}

	(* make special lines and tic marks *)
	special(1.0);
	special(2.0);
	special(3.0);
	special(4.0);

	(* generate the curve *)
	pn:=0.0;
	dpn := 0.01;
	movea(afile,pn*scalex,et(pn));
	while pn <= range do begin
		linea(afile,pn*scalex,et(pn)*scaley);
		pn := pn + dpn
	end
end;
(* end module emin.etcurve *)

(* begin module emin.themain *)
procedure themain(var afile: text);
(* the main procedure of the program *)
begin
   writeln(afile,'%! emin ',version:4:2);

   writeln(afile,'%***************************************************');
   writeln(afile,'% produce PyNy symbol');
   pynysymbol(afile);
   writeln(afile,'% end of PyNy symbol');
   writeln(afile,'%***************************************************');
   writeln(afile);

   writeln(afile,'%***************************************************');
   writeln(afile,'% produce Emin/E symbol');
   eeminsymbol(afile);
   writeln(afile,'% end of Emin/E symbol');
   writeln(afile,'%***************************************************');
   writeln(afile);

   startpic(afile,81.0,2.0,5.0,'t');
   etcurve(afile, 3.0,3.0,4.3);
   movea(afile,-2.0,0.0);
   stoppic(afile);
end;
(* end module emin.themain *)

begin
	themain(output);
1:end.
