an Ass and three Haystacks

[From Bill Williams 22 May 02 O.24 CST]

In the recent discussion concerned with the UEC or now the NEC some confusions
emerged concerning my proposal that the scholastics discusion of Buridan's Ass
problem could be translated into control theory terms. In the original problem
it appears that it was assumed that the ass behvaved as if the two haystacks
acted upon the mule as if they were stimuli. Only if the ass were precisely
symetrical and placed precisely between two identical haystacks in the absence
of any disturbance would the ass be stuck. Hwever, if the problem is considered
in control theory terms, the ass can be placed anywhere between the two
haystacks or even outside the goals, have different loop gains
connected to the two the haystacks, and be the subject of disturvances-- and
still not be able to reach one of the haystacks.

Last april when working on an economics problem I wanted to demonstrate the
behavior of an agent with conflicting or competing goals. Lester is the name of
a fellow at Yale who tried to debate with the Orthodox economists. But Lester
didn't have a model, so he was a _only a critic_. In an effort to avoid
repeating Lester's mistake, I wrote a routine which demonstarted the behavior
of an agent with three goals in which the gain of the loops connecting the
agent and the goals can be changed, and disturbances can be introduced. There
are some glitches in the program, but basically it demonstrates the effect of
changing gains, and the effect of disturbances on an agent with goals that pull
in different directions.

I should have written better documentation at the time, then maybe I'd
understand better now how the program works. But basically its a routine that
demonstrates the behavior of an agent with three goals. To run the
program it is first neccesary to let it initialize itself ( press the space key
untill the agent ( the blue circle ) stablizes in the center of the three goals
(the smaller red circles 1,2 and 3. Then a disturbance can be introduced by
pressing the keys 1,2 or 3. The blue circle will be shifted about as a result
of the disturbances. However, after the disturbance has been introduced, if
the space key is repeatedly pressed the agent will return to the center
position between the three goals. The gains of the three loops can be changed
by first pressing 'g' and then intering 1, 2 or 3. This will double the gain
of the loop for the number selected. Or by pressing !,@ or # the gain can be
cut in half. When the gain is changed the agent ( the blue circle ) will shift
from the center position to a location closer to the goal or goals with greater
gain.

I suppose you build an analog simulation by stretching rubberbands between
three posts connected to a ring which would represent the agent. Then changing
the gain could be simulated by increasing the number of rubber bands between
one of the posts and the ring.

To make the display visually more interesting I used loops which are slightly
unstable. This may give the impression that there is more invovlved in the
program than is acutually the case. The display is generated by three control
loops without any other underlying structure.

No telling what the Scholastic philosophers could have accomplished if they'd
only had desk top computers.

Bill Williams

Lester.exe (41.9 KB)

···

______________________________________________________________________
Do you want a free e-mail for life ? Get it at http://www.email.ro/

Because of firewall issues (security) with my mail server I'm unable to
receive .exe files. Would it be possible to get the source code for some of
these demonstration programs?

Thanks,

Steve O

···

-----Original Message-----
From: William Williams [mailto:w.d.williams@EMAIL.RO]
Sent: Wednesday, May 22, 2002 12:29 AM
To: CSGNET@listserv.uiuc.edu
Subject: Re: an Ass and three Haystacks

[From Bill Williams 22 May 02 O.24 CST]

In the recent discussion concerned with the UEC or now the NEC some
confusions
emerged concerning my proposal that the scholastics discusion of Buridan's
Ass
problem could be translated into control theory terms. In the original
problem
it appears that it was assumed that the ass behvaved as if the two haystacks
acted upon the mule as if they were stimuli. Only if the ass were precisely
symetrical and placed precisely between two identical haystacks in the
absence
of any disturbance would the ass be stuck. Hwever, if the problem is
considered
in control theory terms, the ass can be placed anywhere between the two
haystacks or even outside the goals, have different loop gains
connected to the two the haystacks, and be the subject of disturvances-- and
still not be able to reach one of the haystacks.

Last april when working on an economics problem I wanted to demonstrate the
behavior of an agent with conflicting or competing goals. Lester is the name
of
a fellow at Yale who tried to debate with the Orthodox economists. But
Lester
didn't have a model, so he was a _only a critic_. In an effort to avoid
repeating Lester's mistake, I wrote a routine which demonstarted the
behavior
of an agent with three goals in which the gain of the loops connecting the
agent and the goals can be changed, and disturbances can be introduced.
There
are some glitches in the program, but basically it demonstrates the effect
of
changing gains, and the effect of disturbances on an agent with goals that
pull
in different directions.

I should have written better documentation at the time, then maybe I'd
understand better now how the program works. But basically its a routine
that
demonstrates the behavior of an agent with three goals. To run the
program it is first neccesary to let it initialize itself ( press the space
key
untill the agent ( the blue circle ) stablizes in the center of the three
goals
(the smaller red circles 1,2 and 3. Then a disturbance can be introduced by
pressing the keys 1,2 or 3. The blue circle will be shifted about as a
result
of the disturbances. However, after the disturbance has been introduced, if
the space key is repeatedly pressed the agent will return to the center
position between the three goals. The gains of the three loops can be
changed
by first pressing 'g' and then intering 1, 2 or 3. This will double the
gain
of the loop for the number selected. Or by pressing !,@ or # the gain can be
cut in half. When the gain is changed the agent ( the blue circle ) will
shift
from the center position to a location closer to the goal or goals with
greater
gain.

I suppose you build an analog simulation by stretching rubberbands between
three posts connected to a ring which would represent the agent. Then
changing
the gain could be simulated by increasing the number of rubber bands between
one of the posts and the ring.

To make the display visually more interesting I used loops which are
slightly
unstable. This may give the impression that there is more invovlved in the
program than is acutually the case. The display is generated by three
control
loops without any other underlying structure.

No telling what the Scholastic philosophers could have accomplished if
they'd
only had desk top computers.

Bill Williams

______________________________________________________________________
Do you want a free e-mail for life ? Get it at http://www.email.ro/

[From Bill Powers (2002.05.22.1005 MDT)]

Bill Williams 22 May 02 O.24 CST --

In the recent discussion concerned with the UEC or now the NEC some confusions
emerged concerning my proposal that the scholastics discusion of Buridan's Ass
problem could be translated into control theory terms. In the original problem
it appears that it was assumed that the ass behvaved as if the two haystacks
acted upon the mule as if they were stimuli. Only if the ass were precisely
symetrical and placed precisely between two identical haystacks in the absence
of any disturbance would the ass be stuck. Hwever, if the problem is
considered
in control theory terms, the ass can be placed anywhere between the two
haystacks or even outside the goals, have different loop gains
connected to the two the haystacks, and be the subject of disturvances-- and
still not be able to reach one of the haystacks.

That's a very clear demo. It would be a good start toward the NEC
(nonlinear error curve) model if it were more stable. Basically, what you
need is for each control system's output function to have a gain G
determined by (as an example, not the only one possible)

G := Go/(1+g2*abs(e)), where
   Go is basic gain equal to what's in the model now
   g2 is sensitivity of gain-changing modification
   abs(e) is the absolute value of the error signal in the model

The added 1 in the denominator prevents division by zero when the error or
g2 goes to zero. If g2 is zero, we have the original case in your demo. As
you raise g2, there should come a point where the ass will go all the way
(nearly) to one of the goals.

There are, of course, other functions that will give similar results.

Best,

Bill P.

[From Bill Williams 22 May 02 14:50 CST]

Steve O

Because of firewall issues (security) with my mail server I'm unable to
receive .exe files. Would it be possible to get the source code for some of
these demonstration programs?

Here's the source code-- such as it is. After looking at how I wrote the
program a year ago, there's not much in the way I did it that I like. But, it
runs ( more a less ). If I understand what I did then, I got the poorly damped
behavior by integrating the error term. I hope it compiles for you. IF you
want to take a look a the Giffen program I can post.

best

Bill williams

···

______________________________________________________________________
Do you want a free e-mail for life ? Get it at http://www.email.ro/

program Goals_in_Competition
(* Lester conflicting goals *) ; (* 17 April 2001 *)

(* Revisions 23 May 02 *)

  uses dos, crt, graph, grutils;
    var
      c, count : integer;
      key : char;
      textN : string;
      ddx1, ddx2, ddx3, ddy1, ddy2, ddy3 : real;
      Xa, Ya, X1, Y1, X2, Y2, X3, Y3 : real;
      dX1, dY1, dX2, dY2, dX3, dY3 : real;
      Xg1, Xg2, Xg3, Yg1, Yg2, Yg3 : real;
      Xs1, Xs2, Xs3, Ys1, Ys2, Ys3 : real;
      Ex1, Ex2, Ex3, Ey1, Ey2, Ey3 : real;
      Rx1, Rx2, Rx3, Ry1, Ry2, Ry3 : real;
      ix1, ix2, ix3, iy1, iy2, iy3 : real;
      gx1, gx2, gx3, gy1, gy2, gy3 : real;
      ox1, ox2, ox3, oy1, oy2, oy3 : real;
      sx1, sx2, sx3, sy1, sy2, sy3 : real;
      a, s, g, oEx1, oEx2, oEx3, oEy1, oEy2, oEy3 : real;

Begin (* main *)
   initgraphics;

     Xa := 0; Ya := - 40;
     X1 := 200; Y1 := - 140;
     X2 := - 200; Y2 := - 140;
     X3 := 0; Y3 := + 140;

     Ix1 := 0; Ix2 := 0; Ix3 := 0;
     Iy1 := 0; Iy2 := 0; Iy3 := 0;

     Rx1 := 200; Rx2 := -200; Rx3 := 0;
     Ry1 := -140; Ry2 := -140; Ry3 := +140;

     a := 50;

     sx1 := a; sx2 := a; sx3 := a;
     sy1 := a; sy2 := a; sy3 := a;

    ddx1 := a; ddx2 := a; ddx3 := a;
    ddy1 := a; ddy2 := a; ddy3 := a;

    a:= 1;

   gx1 := a; gx2 := a; gx3 := a;
   gy1 := a; gy2 := a; gy3 := a;

   Ox1 := 0; Ox2 := 0 ; Ox3 := 0;
   Oy1 := 0 ; Oy2 := 0; Oy3 := + 0;

   oEx1 := 0; oEx2 := 0; oEx3 := 0;
   oEy1 := 0; oEy2 := 0; oEy3 := 0;

    g := a;

   count := 0;

  repeat

   inc(count);

     setcolor(yellow);
     line(round(Xa + 320), round(Ya + 240 ),round(x1 + 320),round(y1 + 240 ));
     line(round(Xa + 320 ),round(Ya + 240),round(x2 + 320),round(y2 + 240 ));
     line(round(Xa + 320 ),round(Ya+ 240 ),round(x3 + 320),round(y3+ 240 ));

     setcolor(lightblue);
     circle(round(Xa + 320 ),round(Ya + 240 ),10);

       setcolor(lightred);
       circle(round(X1 + 320),round(Y1 + 240 ),5);
       circle(round(X2 + 320),round(Y2 + 240),5);
       circle(round(X3 + 320),round(Y3 + 240),5);

      setcolor(lightgray);
      outtextxy(round(X1 + 335),round(y1 + 240),'1');
      outtextxy(round(X2 + 305),round(y2+ 240),'2');
      outtextxy(round(X3 + 320),round(y3 + 20+ 240),'3');

      (* if keypressed then *)

      if keypressed then key := readkey;

      delay(100);

      setcolor(black);
      circle(round(Xa+ 320),round(Ya + 240),10);
      line(round(Xa + 320 ),round(Ya + 240 ),round(x1 + 320 ),round(y1 + 240 ));
      line(round(Xa + 320 ),round(Ya + 240 ),round(x2 + 320),round(y2 + 240 ));
      line(round(Xa + 320),round(Ya + 240 ),round(x3 + 320),round(y3 + 240));

         for c := 6 to 10 do
           begin
            circle(round(X1 + 320),round(Y1 + 240),c);
            circle(round(X2 + 320),round(Y2 + 240),c);
            circle(round(X3 + 320),round(Y3 + 240),c);
           end;

     if key = 'c' then setgraphmode(2);

    if key = '1' then
        begin
          dx1 := (Xa - x1) * g;
          dy1 := (Ya - y1) * g ;
          Xa := (Xa + dx1) * g ;
          Ya := (Ya + dy1) * g ;
          setcolor(lightred);
          for c := 6 to 10 do circle(round(X1 + 320),round(Y1 + 240),c);
        end;

    if key = '!' then
        begin
          dx1 := (Xa - x1) * g;
          dy1 := (Ya - y1) * g ;
          Xa := (Xa - dx1) * g ;
          Ya := (Ya - dy1) * g ;
          setcolor(red);
          for c := 6 to 10 do circle(round(X1 + 320),round(Y1 + 240),c);
        end;

  if key = '2' then
        begin
          dx2 := (Xa - x2) * g;
          dy2 := (Ya - y2) * g;
          Xa := (Xa + dx2) * g;
          Ya := (Ya + dy2) * g;
          setcolor(lightred);
          for c := 6 to 10 do circle(round(X2 + 320),round(Y2 + 240),c);
        end;

  if key = '@' then
        begin
          dx2 := (Xa - x2) * g;
          dy2 := (Ya - y2) * g;
          Xa := (Xa - dx2) * g;
          Ya := (Ya - dy2) * g;
          setcolor(red);
          for c := 6 to 10 do circle(round(X2 + 320),round(Y2 + 240),c);
        end;

     if key = '3' then
        begin
          dx3 := (Xa - x3) * g;
          dy3 := (Ya - y3) * g;
          Xa := (Xa + dx3) * g;
          Ya := (Ya + dy3) * g;
          setcolor(lightred);
          for c := 6 to 10 do circle(round(X3 + 320),round(Y3 + 240),c);
        end;

      if key = '#' then
        begin
          dx3 := (Xa - x3) * g;
          dy3 := (Ya - y3) * g;
          Xa := (Xa - dx3) * g;
          Ya := (Ya - dy3) * g;
          setcolor(red);
          for c := 6 to 10 do circle(round(X3+ 320),round(Y3 + 240),c);
        end;

   if key = 'g' then
        begin

          setgraphmode(2);

          setcolor(lightgray);
          outtextxy(300,320,'Change Control Loop gains');

          setcolor(lightgray);
          outtextxy(350,350,'gain * 2 : "1", "2", "3" ');

          setcolor(lightgray);
          outtextxy(350,380,'gain / 2 : "!", "@", "#" ');

     key := readkey;

          if key = '1' then ddx1 := ddx1 * 2;
          if key = '1' then ddy1 := ddy1 * 2;

          if key = '!' then ddx1 := ddx1 / 2;
          if key = '!' then ddy1 := ddy1 / 2;

          if key = '2' then ddx2 := ddx2 * 2;
          if key = '2' then ddy2 := ddy2 * 2;

          if key = '@' then ddx2 := ddx2 / 2;
          if key = '@' then ddy2 := ddy2 / 2;

          if key = '3' then ddx3 := ddx3 * 2;
          if key = '3' then ddy3 := ddy3 * 2;

          if key = '#' then ddx3 := ddx3 / 2;
          if key = '#' then ddy3 := ddy3 / 2;

          setgraphmode(2);

   end;

(* control loops *)

      Ex1 := Rx1 - Xa;
     oEx1 := oEx1 + Ex1;
     oEx1 := oEx1 - oEx1/ddx1;
      Ix1 := Gx1 * oEx1;
      Ox1 := Ox1 + ( Ix1 - Ox1 )/Sx1;

      Ex2 := Rx2 - Xa;
     oEx2 := oEx2 + Ex2;
     oEx2 := oEx2 - oEx2/ddx2;
      Ix2 := Gx2 * oEx2;
      Ox2 := Ox2 + ( Ix2 - Ox2 )/Sx2;

      Ex3 := Rx3 - Xa;
     oEx3 := oEx3 + Ex3;
     oEx3 := oEx3 - oEx3/ddx3;
      Ix3 := Gx3 * oEx3;
      Ox3 := Ox3 + ( Ix3 - Ox3 )/Sx3;

      Ey1 := Ry1 - ya;
     oEy1 := oEy1 + Ey1;
     oEy1 := oEy1 - oEy1/ddy1;
      Iy1 := Gy1 * oEy1;
      Oy1 := Oy1 + ( Iy1 - Oy1 )/Sy1;

      Ey2 := Ry2 - ya;
     oEy2 := oEy2 + Ey2;
     oEy2 := oEy2 - oEy2/ddy2;
      Iy2 := Gy2 * oEy2;
      Oy2 := Oy2 + ( Iy2 - Oy2 )/Sy2;

      Ey3 := Ry3 - ya;
     oEy3 := oEy3 + Ey3;
     oEy3 := oEy3 - oEy3/ddy3;
      Iy3 := Gy3 * oEy3;
      Oy3 := Oy3 + ( Iy3 - Oy3 )/Sy3;

       Xa := Ox1 + Ox2 + Ox3;
       Ya := Oy1 + Oy2 + Oy3;

(* end control loops *)

   setcolor(lightgray);
   outtextxy(50,310,'Goals in Competition');
   outtextxy(5,350,'press key');
   outtextxy(5,370,'1,2 or 3 toward goal');
   outtextxy(5,390,'!,@,# away from goal');
   outtextxy(5,410,'press any key to run');
   outtextxy(5,430,'press g to change loop gains');
   outtextxy(5,450,'press q to exit program');

    inc(count);

   if count > 100 then count := 100;

until key in [ 'q','Q']; (* end of repeat loop *)
  closegraph;
end.