# Bruce's equations

[From Bill Powers (950104.1635 MST)]

Bruce Abbott (960104.1430) --

A very interesting model you have come up with. I admire your
mathematical bravery! But jeez, Bruce, you are going to give me a brain
hernia if you keep making me try to remember how to solve differential
equations.

(1) R = B/n environment function (ratio schedule)
(2) F = F0 + (m*R - M)*t food amount at time t
(3) p = F perceptual signal
(4) e = Fr - F error signal
(5) B = g * e output function

For a simulation solution, the second line should be cast as an
integral:

F := F + (m*R - M) * dt,

with F initialized to F0. This says that in one iteration, the amount of
F increases by the amount m*R, and decreases by the amount M, times the
time per iteration, dt.

Put in terms of the calculus, the second line would be written

dF/dt = m*R - M.

The constant of integration, F0, will be introduced when you integrate
the combined equations to solve them.

Solving for dF/dt, we have

dF/dt = m*g*(Fr - F)/n - M.

If we set k = -m*g/n and
a = (m*g/n)*Fr - M,

this equation becomes a recognizable form,

dF/dt = kF + a.

The general solution with a parameter A to be determined is

(6) F = A*exp(k*t) - a/k

Putting the equivalents of k and a back into equation (6) we get

F = A*exp(-m*g*t/n) + Fr - M*n/(m*g)

At t = 0 (where F = F0) we have

F0 = A + Fr - M*n/(m*g), or

A = F0 - Fr + M*n/(m*g)

This leads to the final solution for F:

F = F0*exp(-m*g*t/n) + (Fr - M*n/(m*g)]*[(1 - exp(-m*g*t/n)]

That's the best I can do. I hope I did this right. The only way to check
the answer is to run a simulation and see if the analytical solution
matches the simulation output. I'll try to do that. If anybody else on
the net cares to check my solution I would be grateful. I've spent too
many years avoiding having to do this kind of math.

···

----------------------------
I don't know if I can express intelligibly what your mistake was in step
2. The basic problem is that you presented an equation for F as if the
effect of R simply increases linearly with time. But R depends on F, so
the real solution will not be a linear function of time. You have to
approach the solution in increments of dt, and as you can see the result
is a different form of the equation for F. Some of your numerical
results may be right, since you used the balance between mR and m to
find them. But some others may be wrong -- we'll see.
-----------------------------------------------------------------------
Best,

Bill P.

[From Bruce Abbott (960105.1900 EST)]

Bill Powers (950104.1635 MST) --

Bruce Abbott (960104.1430)

A very interesting model you have come up with. I admire your
mathematical bravery!

Well, I don't know about bravery. You know what they say about fools
rushing in!

I don't know if I can express intelligibly what your mistake was in step
2. The basic problem is that you presented an equation for F as if the
effect of R simply increases linearly with time. But R depends on F, so
the real solution will not be a linear function of time. You have to
approach the solution in increments of dt, and as you can see the result
is a different form of the equation for F. Some of your numerical
results may be right, since you used the balance between mR and m to
find them. But some others may be wrong -- we'll see.

Thanks for the lesson, Bill. As usual, I have learned something of value.
I do understand the problem, but believe it or not, there WAS method to my
madness (or was it madness to my method? (:->). While in rainy Florida, I
wrote a short program in BASIC called, by a strange coincidence, FOOD.BAS,
which carries out the simulation correctly, as you presented it in your
FOOD1.PAS. I used this program to observe how the system behaved and to
find the asymptotic values being approached as time went by. As you found,
both R and B went to zero when M = 0 (i.e., no disturbance). With M > 0, B
gets just large enough to make m*R = M, and F remains just enough under Fr
to maintain this rate of output.

The (incorrect) analysis I presented intentionally adopted the approach used
by Killeen (1995) in his "behavioral mechanics" analysis, which seems to
involve getting average rates over some time period, t. I thought if I used
Killeen's approach, I could directly compare his solutions to a real
control-system model. As a quick check on the method, I used the system
equations I derived using that method in a program that gave the values at
time t = 10 minutes and also at time t = 30 minutes; the results seemed to
be converging on the right asymptotic values so I assumed that the method
was O.K. Now that you pointed it out, however, I do understand that the
averages given by Killeen's method assume constant rates over time t,
whereas the actual rates would change as a negative exponential.

I had planned to compare my equations with those that emerge from Killeen's
analysis as there are some interesting parallels, but given the
circumstances I will take another approach. My interest over the break was
in understanding Killeen's "mechanics of behavior" model and evaluating it
against the simple control-of-food-level model I developed. I believe I do
now understand Killeen's model (or at least the portion that was presented
in the 1995 JEAB article) and therefore am in a good position to evaluate
it. I'll try to get that evaluation posted tomorrow, if time permits.

Regards,

Bruce