[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.