home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / bit / listserv / csgl / 1448 < prev    next >
Encoding:
Text File  |  1992-11-10  |  2.9 KB  |  93 lines

  1. Newsgroups: bit.listserv.csg-l
  2. Path: sparky!uunet!usc!sdd.hp.com!spool.mu.edu!tulane!darwin.sura.net!Sirius.dfn.de!solaris.rz.tu-clausthal.de!news!zzwz
  3. From: zzwz@rrzn.uni-hannover.de (Wolfgang Zocher)
  4. Subject: Re: Primer for modelers: draft
  5. Message-ID: <1992Nov11.100607.17235@newsserver.rrzn.uni-hannover.de>
  6. Sender: news@newsserver.rrzn.uni-hannover.de (News Service)
  7. Organization: RRZN
  8. X-Newsreader: Tin 1.1 PL4
  9. References: <01GQY0F9Q842006FKI@VAXF.COLORADO.EDU>
  10. Date: Wed, 11 Nov 1992 10:06:07 GMT
  11. Lines: 80
  12.  
  13. POWERS_W%FLC@VAXF.COLORADO.EDU (William T. Powers) writes:
  14. :                Experimenting with the control paradigm
  15. :                    A primer for computer modelers
  16. :                         DRAFT: William T. Powers
  17.  [ beginning part deleted ...]
  18.  
  19. :  The simplest control system to model on a digital computer is one in
  20. :  which all the functions are simple proportionalities except the
  21. :  output function, which is an integrator. Alternatively, the feedback
  22. :  function or the input function can be made into an integrator;
  23. :  however, only one function should be an integrator and the rest
  24. :  should be proportional multipliers. We will use a design with an
  25. :  integrator in the output function; you can experiment with the other
  26. :  possibilities.
  27.  
  28. Why should there be only one integrator? 
  29.  
  30. ..stuff deleted...
  31.  
  32. :  NOTE: I would appreciate it if programmers versed in BASIC, Pascal,
  33. :  and other languages would write versions of the above program, test
  34. :  them, and transmit them to me for inclusion in an appendix to this
  35. :  primer. Programs should be as generic as possible so as to run on as
  36. :  many computers as possible. I especially need versions for mainframes
  37. :  and workstations. In the future I will simplify the program and make
  38. :  it easier for the user to change parameters from the keyboard. For
  39. :  now, I hope that all programmers and would-be programmers will try
  40. :  the program as it stands and learn from it, even if you have to get
  41. :  some help from a 14-year-old. As this primer evolves I will post
  42. :  revisions and again ask for your help.
  43. :  ------------------------------------------------------------------
  44.  
  45. Here is a PASCAL-Version of your program. It should work on whatever
  46. platform ..
  47.  
  48.  
  49. program control;
  50. const kd = 1.0;
  51.       ki = 1.0;
  52.       ko = 8.0;
  53.       kf = 1.0;
  54.       dt = 0.1;
  55.  
  56. var   sp, sr, se : real;
  57.       qi, qo, qd : real;
  58.       i : integer;
  59.  
  60. begin
  61. (* initialize variables *)
  62.    sp := 0.0;
  63.    sr := 20.0;
  64.    se := 0.0;
  65.    qo := 0.0;
  66.    qi := 0.0;
  67.    qd := 0.0;
  68.  
  69.    for i := 0 to 24 do begin
  70.        if i > 12 then qd := 10.0 else qd := 0.0;
  71.        qi := kf*qo + kd*qd;
  72.        sp := ki*qi;
  73.        se := sr - sp;
  74.        qo := qo + ko*se*dt;
  75.  
  76.        write   ('qd = ',qd:6:2,' qi = ',qi:6:2,' qo = ',qo:6:2);
  77.        writeln (' sp = ',sp:6:2,' sr = ',sr:6:2,' se = ',se:6:2);
  78.    end;
  79.    readln;
  80. end.
  81.  
  82. :  Best,
  83. :  Bill P.
  84.  
  85. --
  86. Wolfgang Zocher
  87. Regionales Rechenzentrum f. Niedersachsen
  88. Schlosswender Strasse 5
  89. 3000 Hannover
  90.