[From Bill Powers (2012.11.21.0951 MST)]
Rupert Young 2012.11.20 22.00 UT ]
RY: If we substitute o[t] in (2)
with the right-hand side of (1) we get,i[t] := o[t-1] + g*e[t-1]*dt + d[t].
Yes? That is, the input to a new iteration is a function of the previous
output and a linear additive adjustment (g*e[t-1]*dt), and the
disturbance.
BP: No. I[t] is the current value of the input quantity, which is the sum
of the current values of o and d: i[t] = o[t] + d[t]. When you do the
substitution, the result is that you fail to update the value of o[t] for
use as o[t-1] in the next iteration, so you’ve left out the program step
that is written
o = o + gedt
I put the time subscripts in so it is clear that o on the left is the new
value of o, and the o on the right is the old value of the same
variable at a slightly earlier time: o[t] = o[t-1]*e[t-1]*dt. This is
a program step, not algebra. Algebra doesn’t know anything about previous
and current values of a variable. There is no time in algebra. It it were
algebra, you could solve the equation by subtracting o from both sides to
get
gedt = 0 ← that’s a “zero”.
That’s clearly not what the program step means.
My program steps were
(1) o[t] = o[t-1] + g*e[t-1]*dt /new output = old value plus (gain
- old error * dt)
Come to think of it, that time subscript is a time, not just an index. I
should have written it as
o[t] = o[t - dt] + g*e[t - dt]*dt
because the time between iterations is dt. When you write (t - 1) you are
tacitly saying that the unit of time is dt. The 1 means “1 unit of
time,” not just “one step.” Sp, keeping that in mind, I
can say:
The current value of o[t] will be the old value o[t-1] on the next
iteration. In the current iteration, the variables all have their current
values:
(2) i[t] := o[t] + d[t] /current input quantity = current output +
current disturbance
No time is required for the addition to be carried out and entered as the
new value of i[t].
RY: In ratio control,
however,(3) i[t] := d[t] /
o[t] / new input quantity
= current disturbance / current output
BP: No. You’re thinking of what the equation would mean if its variables
were the logarithms of other variables. They aren’t. i[t] is not
d[t]/o[t]. It is just d + o. The perception is log(i), which means log(d
- o). The input i remains equal to (d + o).
RY:
and I am questioning whether equation (1) is valid in this situation,
which would give(4) i[t] := d[t] / (o[t-1] + g*e[t-1]*dt)
BP: On the next iteration you will find that o[t-1] has the same value it
had in the previous iteration because you didn’t update o before using it
in the environment part of the equation.
Also –
It’s not correct to convert the environmental equation into antilogs. The
variables are just variables in the environment, not logarithms of
variables. Where you introduce antilogs is in translating the perceptual,
reference, and error signals into corresponding meanings in the
environment. This doesn’t change the environmental relationships into
antilogs.
RY: The point I am trying to
make is that equation (1) doesn’t appear to work with ratio control,
however, this does(5) o[t] = o[t-1] + o[t-1]ge[t-1]*dt
Is this valid for ratio control?
BP: You have one too many o[t-1]'s in (5) – the second one. You still
seem to be treating these program steps like algebra. I don’t mean to be
beating up on you here; the reason I know what to say here is that I did
the same thing at first. That’s how I figured out that while you can use
algebra in some program steps – to expand an expression, or take out a
common factor from a parenthetical expression, for example – you can’t
do it across iterations in a simulation.
Step (5) seems to work because the effect is just like writing
o[t] = o[t-1] (1 + ge[t-1]dt)
You’re just adding an extra 1 to ge[t]*dt on every iteration. The result
will be to get too large a value of o, but unless you have the correct
value to compare it with you won’t realize it’s too large. Also, you’ll
find that the output doesn’t stop changing when the error signal is
zero.
If you want the perceptual signal to represent the ratio of d to o (as a
controlled variable), you have to have two logarithmic input functions,
on for d and one for o. You then subtract the second perception
from the first one to get the second-order perception equal to log(d) -
log(o), which is log(d/o). Now you can set up a second-order control
system for controlling that ratio, the error signal setting the reference
level (via an integrator) for log(o) which one of the first-order control
systems controls. And watch the signs so you have negative feedback
around both the first and second-order loops.
Note that the antilogs, in this last model, are automatically computed by
a high-gain negative feedback system. Negative feedback systems make the
output be the inverse feedback function of the input.
All this is very good practice at interpreting the meanings of equations
in simulations. It’s not totally simple. I was fortunate to have a genius
of a math teacher in my freshman year of engineering physics (which was
at the U of Colorado in Boulder in 1946-7), who spent a lot of time on
this very subject. He would start with a set of equations, do one step of
the derivation, and stop. “Now what does this equation mean?”
he would ask. We had to do this for every step to the end. He taught us
not to go through mathematical manipulations blindly, just following the
rules and not thinking. In simulations, every transformation of one
equation to another one produces a new set of meanings. He made us think
about them. I highly recommend learning to do this. It’s extremely
helpful in troubleshooting and can expose wrong steps in the
derivations.
Best,
Bill P.