A Galway garden adds 2 kg of seed weekly. Why does its stock rise by more?
A Galway community garden starts with ten kilograms of seed and has twelve a week later. From then on, the model takes half the last week's gain and adds two kilograms to get the next gain. How much seed will the garden have at week four?
Call the stock at week n, in kilograms, u sub n. Without the fixed input, the next gain is half the previous one. Collecting the stock terms gives the first equation. The characteristic equation has two distinct roots, one and a half, giving a constant term and a power of one half.
The stock rises from ten to twelve, a gain of two. Halve that gain and add two to get three. Do it again to get three point five. Add those gains to get the next stocks. Now subtract consecutive gains for second differences, then subtract those for the third difference.
Suppose the stock gained six kilograms last week. The model carries over half that gain and adds two kilograms. How much does the stock gain this week? Pick the number that gives the gain, rather than the total stock.
Write the next gain as half the previous gain plus two. Rearrange for the next stock. A constant trial gives C equals C plus two, which is impossible. Since one is a simple root, try k times n. Its gain k equals half of k plus two, so k is four.
Add four times n to the homogeneous solution before using the starting values. Week zero gives A plus B equals ten. Week one gives A plus half of B equals eight after subtracting four. Subtract the equations to get B equals four, then substitute to get A equals six.
Keep the same stock rule, but start at eight kilograms in week zero and eleven in week one. The particular term is still four times n. Use both starting values to find A and B, then pick the pair that fits.
Here's the trap: fit the unforced formula to ten and twelve, then tack on four times n. Week zero still gives ten, because four times zero is zero. But week one jumps to sixteen. If you include the particular term before fitting, both starting values hold.
Read the dots at whole weeks. The grey curve guides you through the stocks without the fixed input, and the blue curve guides you through the stocks with it. Both models start at ten and twelve kilograms. By week two, the grey dot is at thirteen and the blue dot is at fifteen.
To calculate the stock after four weeks, start Python with ten and twelve, then iterate the stock rule three times. Generate a list from each formula. The comparisons give true for input zero and for input two. With input two, the week-four stock is twenty-two point two five kilograms.