home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / elan / intgraph / verhulst.eln < prev    next >
Text File  |  1988-10-13  |  1KB  |  58 lines

  1.  
  2. PROC mark (INT CONST x, REAL CONST y):
  3.   move (margin + sx * x, round ((y + 0.1) * sy));
  4.   plot pixel
  5. ENDPROC mark;
  6.  
  7. program:
  8.   LET number of invisible steps = 40,
  9.       number of visible steps = 40,
  10.       number of points = 50;
  11.   # On a faster computer choose larger values for better approximation #
  12.   enter graphics mode;
  13.   LET margin = 20;
  14.   INT CONST sx :: (graphics x limit - margin) DIV number of points;
  15.   REAL CONST sy :: real (graphics y limit) / 2.0;
  16.   choose interval;
  17.   UPTO number of points
  18.   REP
  19.     next point;
  20.     some invisible steps;
  21.     some visible steps
  22.   ENDREP;
  23.   wait for confirmation (1, graphics y limit - line height);
  24.   leave graphics mode.
  25.  
  26.   choose interval:
  27.     put ("Verhulst dynamics of rapidly growing population");
  28.     line;
  29.     put ("For background read The Beauty of Fractals");
  30.     line;
  31.     put ("by Peitgen and Richter, Springer Verlag 1986");
  32.     LET limit = 3.0;
  33.     REAL VAR x :: 1.9;
  34.     INT VAR xpos :: 0;
  35.     REAL CONST dx :: (limit - x) / real (number of points).
  36.   
  37.   next point:
  38.     xpos INCR 1;
  39.     x INCR dx.
  40.   
  41.   some invisible steps:
  42.     REAL VAR y :: 0.1;
  43.     UPTO number of invisible steps
  44.     REP step
  45.     ENDREP.
  46.   
  47.     step:
  48.       y INCR x * (1.0 - y) * y.
  49.     
  50.   some visible steps:
  51.     UPTO number of visible steps
  52.     REP
  53.       mark (xpos, y);
  54.       step
  55.     ENDREP.
  56.   
  57. 
  58.