randomized

(To Bill Williams from Bill Powers, 2001.10.13.0930 MDT)])

Hi, Bill:

I like the feature allowing the program to run without the keypress. I think
there is a need for a "freeze" feature.

That's easy. If p or P is to be the "pause" feature, add this to the case
statements:

    'p','P': begin key := readkey; key := #0; end;

The "key := #0" is needed to keep the same command from being executed over
and over -- for example, if you hit "S" to end the pause, "key" would be
equal to "S" until the next keystroke.

Balancing a proportional against integral control loops seems to work well,

I don't see the proportional control loops. Can you show me where they are?

>My grad student is thinking about how to work backward from the control
theory

programs to an equation. All the theories with which he is familiar start
with equations.

Actually, for any one control loop the equations are pretty simple:

let qi = input quantity (part of environment)
     Fi = input function (sensors plus perceptual computations)
     p = perceptual signal
     r = reference signal
     e = error signal
     Fo = output function
     qo = output quantity (part of environment)
     Ff = feedback function (part of environment)
     qd = disturbing quantity (part of environment)
     Fd = disturbance function (part of environment)

The simultaneous equations are:

     p = Fi(qi) [perceptual signal = input function of input quantity]
     e = r - p ] Comparator function, inside the control system]
     qo = Fo(e) [output quantity = output function of error signal]
     qi = Ff(qo) + Fd(d) [Input quantity = functions of disturbance, qo]

The independent variables are the reference signal r (inside the system)
and the disturbing quantity (in the environment). All of the variables are
functions of time, so when written in detail, these will all be
differential equations. For your equations, of course, the various
Functions are just linear multiupliers, except for Fo which is a leaky
integrator.

Since the waveforms of qd and r are arbitrary, there is no general solution
for these equations. They can be solved only for special cases where r and
qd are functions that allow solutions -- for example, a square wave, a sine
wave, or a decaying exponential. Approximations can be solved, for example
if the waveforms of qd and r are represented as the first few terms of a
Fourier expansion of the waveforms. You then add together all the solutions
for the individual sine-wave driving functions.

If we allow time-lags in Fi, as in your simulation, then the solution is
best done with Laplace transforms, where a lag is a multiplying factor of
exp(-tau*p), tau being the lag and p being the Lapace variable (I think).

All bets are off if you make the systems nonlinear, which is easy to do and
to simulate. For nonlinear systems, only upper and lower bounds are
generally computable, and for the equations themselves no solution can be
found analytically. In this case, the only feasible approach is through
simulation (which is really a form of numerical solution).

>What would you think about moving the discussion to the CSGnet? Seems to
me a

better use of bandwidth than blaming more victims.

No sooner said than done (see CC). I will send you my latest version of
your program, with a writeup as comments at the start of the source code,
and let you append it to your next post to CSGnet. I think that a few
others will want to join in.

Best,

Bill P.