Astro; Die-hards; biochemical systems

[From Bill Powers (920806.0900)]

Avery Andrews (920806) --

... suppose you want to get from point A to point B in minimum time
(assuming newtonian physics), and energy expenditure & avoiding >obstacles

is not an issue. Then you want to go at maximum acceleration >on the first
half of your trip, and maximum deceleration on the second >(the time-
position plot of the second. half will look like that of a >falling coffee-
cup, with time reversed).

I think you're computing output -- trying to determine in advance what the
thruster behavior will be, instead of letting the control system vary the
thruster output by itself.

Here's my C program for making Astro chase a moving mother ship.

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "math.h"
#include "dos.h"

void mother(void);
void astrolev1(void);
void astrolev2(void);

float dt,left,right;
int i;

/* mother ship */
float mv,mx;

/*astro */
float aa, /* astro accel */
      av, /* astro vel */
      ax, /* astro x position */
      pv, /* perception of rel velocity */
      rv, /* reference rel velocity */
      ev, /* rel velocity error */
      px, /* perception of rel x position */
      rx, /* reference rel x position */
      ex, /* rel position error */
      k1, /* velocity control gain */
      k2; /* position control gain */

FILE *data;

void mother() /* mother ship behavior */
{
if(mx < left || mx > right) mv = -mv;
mx += mv;
}

void astrolev1() /* astro's velocity control */
{
pv = av - mv; /* vel perception is difference velocity */
ev = rv - pv; /* compute velocity error signal */
aa = k1*ev; /* compute acceleration (thruster force) */
av += aa * dt; /* integrate accel to get velocity of astro */
ax += av * dt; /* integrate vel to get position of astro */
}

void astrolev2() /* astro's position control */
{
px = ax - mx; /* perception of position difference */
ex = rx - px; /* position difference error */
rv = k2*ex; /* velocity ref prop to position error */
}

void main()
{
data = fopen("data","a");
if(!data) exit(0);
dt = 0.1; /* basic time interval */
mv = 0.2; /* mother moves at this velocity, back and forth */
k1 = 1.0; /* velocity error gain */
k2 = 3.0; /* position error gain */
av = 0.0; /* start astro at 0 velocity */
ax = 0.0; /* start astro at position 0 */
mx = 10.0; /* start mother at position 10 */
rx = 0.0; /* reference relative position = 0 */

left = -15.0; /* limits of mother's motion */
right = 15.0;

for(i=0;i<50;++i)
  {
   mother();
   astrolev1();
   astrolev2();
   fprintf(data,"mx:%5.1f ax:%7.1f aa:%5.1f
                 av:%5.1f\x0d\x0a",mx,ax,aa,av);
  }
fclose(data);
}

Note that Astro's perceptions are astro minus mother, not mother minus
astro as I said in my last post.

The first 50 iterations look like this:

Mother Astro Astro Astro
Pos'n pos'n accel vel

mx: 10.2 ax: 0.0 aa: 0.2 av: 0.0
mx: 10.4 ax: 0.3 aa: 30.8 av: 3.1
mx: 10.6 ax: 0.9 aa: 27.4 av: 5.8
mx: 10.8 ax: 1.7 aa: 23.5 av: 8.2
mx: 11.0 ax: 2.7 aa: 19.3 av: 10.1
mx: 11.2 ax: 3.9 aa: 14.9 av: 11.6
mx: 11.4 ax: 5.2 aa: 10.5 av: 12.7
mx: 11.6 ax: 6.5 aa: 6.3 av: 13.3
mx: 11.8 ax: 7.8 aa: 2.3 av: 13.5
mx: 12.0 ax: 9.2 aa: -1.4 av: 13.4
mx: 12.2 ax: 10.5 aa: -4.7 av: 12.9
mx: 12.4 ax: 11.7 aa: -7.5 av: 12.2
mx: 12.6 ax: 12.8 aa: -9.8 av: 11.2
mx: 12.8 ax: 13.8 aa:-11.6 av: 10.0
mx: 13.0 ax: 14.7 aa:-12.8 av: 8.7
mx: 13.2 ax: 15.4 aa:-13.5 av: 7.4
mx: 13.4 ax: 16.0 aa:-13.8 av: 6.0
mx: 13.6 ax: 16.5 aa:-13.6 av: 4.6
mx: 13.8 ax: 16.8 aa:-13.1 av: 3.3
mx: 14.0 ax: 17.0 aa:-12.2 av: 2.1
mx: 14.2 ax: 17.1 aa:-11.0 av: 1.0
mx: 14.4 ax: 17.1 aa: -9.6 av: 0.1
mx: 14.6 ax: 17.1 aa: -8.0 av: -0.7
mx: 14.8 ax: 16.9 aa: -6.4 av: -1.4
mx: 15.0 ax: 16.7 aa: -4.8 av: -1.9
mx: 15.2 ax: 16.5 aa: -3.1 av: -2.2
mx: 15.0 ax: 16.3 aa: -2.0 av: -2.4
mx: 14.8 ax: 16.0 aa: -1.7 av: -2.5
mx: 14.6 ax: 15.8 aa: -1.3 av: -2.7
mx: 14.4 ax: 15.5 aa: -1.0 av: -2.8
mx: 14.2 ax: 15.2 aa: -0.7 av: -2.8
mx: 14.0 ax: 14.9 aa: -0.4 av: -2.9
mx: 13.8 ax: 14.6 aa: -0.1 av: -2.9
mx: 13.6 ax: 14.3 aa: 0.2 av: -2.9
mx: 13.4 ax: 14.1 aa: 0.4 av: -2.8
mx: 13.2 ax: 13.8 aa: 0.6 av: -2.7
mx: 13.0 ax: 13.5 aa: 0.8 av: -2.7
mx: 12.8 ax: 13.3 aa: 0.9 av: -2.6
mx: 12.6 ax: 13.0 aa: 1.0 av: -2.5
mx: 12.4 ax: 12.8 aa: 1.0 av: -2.4
mx: 12.2 ax: 12.5 aa: 1.0 av: -2.3
mx: 12.0 ax: 12.3 aa: 1.0 av: -2.2
mx: 11.8 ax: 12.1 aa: 1.0 av: -2.1
mx: 11.6 ax: 11.9 aa: 0.9 av: -2.0
mx: 11.4 ax: 11.7 aa: 0.8 av: -1.9
mx: 11.2 ax: 11.6 aa: 0.7 av: -1.8
mx: 11.0 ax: 11.4 aa: 0.6 av: -1.8
mx: 10.8 ax: 11.2 aa: 0.4 av: -1.7
mx: 10.6 ax: 11.0 aa: 0.3 av: -1.7
mx: 10.4 ax: 10.9 aa: 0.2 av: -1.7

I put the data in a file so I could merge it into this post. You could just
use a printf (without writing to a file) to put it on the screen.

Note how Astro starts with a burst of acceleration to catch up, then ends
up lagging a little behind Mother with small and decreasing acceleration.

I don't mean to take over your project, but I think it will help in
learning to do simulations to see a working control system. You may want to
do this differently, but seeing one way that works can't do any harm.

ยทยทยท

-----------------------------
RE: Alife

Diehard PCT-ers believe that living systems have to be made out
of control systems, but nobody really *knows* this yet.

If control is necessary, then control systems are necessary. So the
question comes down (as Rick Marken keeps saying) to whether there's some
reason that the behavior of organisms that we observe has to be control
behavior or whether it may possibly be some other kind of behavior.

Control behavior is required any time that a regular consequence of actions
is seen under circumstances where the organism contributes only one of
several influences that produce that consequence. Astro produces a more or
less constant distance between itself and Mother, under circumstances where
Mother can move independently and Astro can influence its own motions but
not Mother's motions. Therefore it exhibits (as I programmed it) control
behavior. You wouldn't have to see my program to see that control is
involved.

If Astro could sense Mother's motions and convert them into corresponding
open-loop thruster actions, some semblance of control could be maintained
for a while. But Astro moves according to time integrals of thruster force,
so eventually this method of making Astro's movements conform to those of
Mother would drift out of calibration and error would increase without
limit -- integration errors are cumulative. The only way I know of for
Astro to follow Mother INDEFINITELY is to use control loops, as above. I
don't think anyone else knows another method, either.

Similar arguments hold for all real behaviors of organisms that I know
about. It's impossible for organisms to behave as they do, in the
environments where we find them, without being able to control outcomes. It
follows that these behaviors must be produced by control systems, the only
known kind of system that can control outcomes despite unpredictable
disturbances of those outcomes.

So I protest the epithet "Die-hard PCTers." This makes it sound as if we
have decided as a matter of faith that all organisms are control systems
and are going around trying to prove it. Our arguments with Alife, if they
really exist, have to do with their assuming that regular outputs can
produce regular outcomes, which is not true in this universe. If Alifers
come to realize why control is needed and under what circumstances, and
begin devising their models to work in those circumstances, we'll have no
argument left. But as long as Alifers or anyone else continues to devise
models that work only in special environments free of disturbances, using
calculations of infinite precision, I will continue to say that they are
not modeling the behavior of organisms.
--------------------------------------------------------------------
Oded Maler (920806) --

You forwarded a fascinating post. I know just a little about Biochemical
Systems Analysis (Savageau), just enough to know that while feedback has
certainly been recognized, control hasn't. The enormous complexity of
"paths" will, I think, yield to a control analysis, especially one
involving hierarchies of control. What seems to be standing in the way now
is a stubborn refusal by biologists to recognize reference signals for what
they are. When it's not realized that control systems with reference
signals set the concentrations of controlled variables, making those
variables independent of the substrate and of disturbances, the whole
schmear looks complex beyond redemption. I truly wish we had some
biochemists in the CSG, willing to look at these problems from a new point
of view.
----------------------------------------------------------------------
Best to all,

Bill P.