Two Stocks, One Shared Flow
Many systems contain two places where some quantity can be stored, with material moving between them. Water may move between two reservoirs, money between two accounts, or a substance between two compartments. Each stock changes according to what enters and leaves it.
A transfer between the two stocks has two effects: it decreases the stock it leaves and increases the stock it enters. The transfer is one flow, not two unrelated events. Writing it consistently in both balance equations makes it possible to check whether it changes the combined amount.
The key distinction is between internal flows, which move quantity between the two stocks, and external flows, which bring quantity into or remove quantity from the combined system.
Set the Direction and Name the Other Flows
Suppose \(a_x(t)\) and \(a_y(t)\) are external inflow rates to the first and second stocks, while \(b_x(t)\) and \(b_y(t)\) are external outflow rates from them. We take each of these four rates to be nonnegative, with outflows listed separately from inflows. All rates must use the same quantity-per-time units.
For the first stock, the shared transfer leaves, so it contributes \(-q(t)\). For the second stock, that same transfer arrives, so it contributes \(+q(t)\). The balances are therefore:
These equations do not require the transfer to be constant or to depend on only one stock. The rate \(q(t)\) may depend on time, on \(x(t)\) and \(y(t)\), or on other quantities specified by the model. What matters for the accounting is that the same signed rate is used in both equations.
Why the Shared Transfer Cancels
The combined stock is \(S(t)=x(t)+y(t)\). Its rate of change is the sum of the rates of change of its two parts. Adding the balance equations gives:
The cancellation is not an assumption that the flow is small or that the stocks are equal. It follows because a transfer counted as leaving one stock is counted as entering the other stock in the same amount and at the same rate.
To justify the conservation statement, suppose all external rates are zero. Then \(dS/dt=0\) at every time in the interval. By the fundamental theorem of calculus, for any two times \(t_0\) and \(t_1\) in that interval,
Hence \(S(t_1)=S(t_0)\): internal transfer alone redistributes the amount but does not change its total. If external flows are present, the total is not necessarily conserved. Instead, its rate of change is exactly the total external inflow minus the total external outflow.
Worked Example: A One-Way Transfer with External Flows
Worked Example: A One-Way Transfer with External Flows
Two water tanks contain \(x=120\) L and \(y=45\) L. Water enters the first tank at \(8\) L/h, leaves it for the outside at \(3\) L/h, and transfers from the first tank to the second at \(5\) L/h. The second tank receives \(2\) L/h from outside and loses \(4\) L/h to the outside. Find the instantaneous stock rates and check the combined balance.
Take \(q=5\) L/h, positive from the first tank to the second. The first balance is:
The second balance is:
The combined stock is \(S=120+45=165\) L, and its rate of change from the individual rates is \(0+3=3\) L/h. The external-flow calculation gives the same result:
The internal \(5\) L/h transfer cancels. As a final check, adding the original balances gives \((8-3-5)+(2-4+5)=0+3=3\) L/h, matching the total external inflow minus outflow.
Worked Example: A Transfer That Can Reverse Direction
Worked Example: A Transfer That Can Reverse Direction
Consider two closed compartments containing a substance, with no external flows. Let \(x\) and \(y\) be measured in kilograms. Suppose the signed transfer rate is \(q=0.2(x-y)\) kg/h, where \(x\) and \(y\) are the current stock amounts in kilograms. At an instant when \(x=30\) kg and \(y=10\) kg, calculate both stock rates and verify conservation.
First calculate the difference between the stocks:
The coefficient has units \(0.2\ \text{h}^{-1}\), so the transfer rate is:
There are no external terms. Therefore,
The combined rate is \(-4+4=0\) kg/h. The total is \(30+10=40\) kg, and its rate is zero, as required for a closed system.
The signed definition also handles reversal. For example, if \(x=10\) kg and \(y=30\) kg, then \(x-y=10-30=-20\) kg and \(q=0.2(-20)=-4\) kg/h. The equations give \(dx/dt=-(-4)=4\) kg/h and \(dy/dt=-4\) kg/h. Thus material moves from the second compartment to the first, while the combined rate remains \(4-4=0\) kg/h.
Worked Example: Different External Losses at a Particular State
Worked Example: Different External Losses at a Particular State
Two stores hold a material measured in kilograms. At a particular time, \(x=5\) kg and \(y=20\) kg. The first receives \(12\) kg/h from outside and loses material externally at rate \(0.4x\) kg/h. The second receives \(3\) kg/h externally and loses material at rate \(0.1y\) kg/h. A shared transfer of \(6\) kg/h goes from the first store to the second. Find the two instantaneous rates and verify the aggregate rate.
First evaluate the external loss from the first store:
The coefficient \(0.4\) has units \(\text{h}^{-1}\), so multiplying it by kilograms gives kilograms per hour. The first stock rate is:
Next evaluate the second store's external loss:
Its stock rate is:
Therefore the combined stock changes at \(4+7=11\) kg/h. Independently, the net external rate is \(12+3-2-2=15-4=11\) kg/h. The two calculations agree, and the shared \(6\) kg/h transfer has no effect on the combined rate.
A Common Sign Error
A frequent mistake is to put the shared transfer in with a plus sign in both equations. For example, writing \(dx/dt=a_x-b_x+q\) and \(dy/dt=a_y-b_y+q\) would imply that a transfer from the first stock to the second increases both stocks. Adding these incorrect equations gives an apparent contribution \(2q\) to the total rate.
That result contradicts what an internal transfer means: the material that leaves the first stock is precisely the material arriving in the second. With \(q\) defined positive from the first stock to the second, the correction is to use \(-q\) in the first balance and \(+q\) in the second. Their sum is \(-q+q=0\).
Another useful check is units. If the stocks are measured in kilograms, then \(dx/dt\), \(dy/dt\), and \(q\) must all be measured in kilograms per unit time. A rate in kilograms cannot be added directly to a stock rate in kilograms per hour.
When Conservation Does and Does Not Apply
Conservation of the combined stock requires that the combined system have no net external flow. It is not enough that there is a shared transfer. If one or both stocks receive material from outside or lose it outside, the total can change even though the internal transfer still cancels.
For example, the total can remain constant even when external flows are present, provided their rates balance:
In that case \(dS/dt=0\). Conversely, if the total external inflow exceeds the total external outflow, then \(dS/dt>0\), and the combined stock increases at that instant. If external outflow exceeds external inflow, then \(dS/dt<0\), and it decreases.
When constructing a model, identify the system boundary before deciding which flows are internal. A transfer between the two stocks is internal when both stocks are included in the combined total. If only one stock is being tracked, that same transfer is an inflow or outflow across the boundary of the smaller system.
Check Your Understanding
Use the convention that a positive shared transfer goes from the first stock to the second.
- Write the two balances if the first stock has external inflow \(u\), external outflow \(v\), the second has external inflow \(r\), external outflow \(s\), and the shared transfer is \(q\).
- Explain why \(q\) appears with opposite signs in the two equations.
- If there are no external flows, what is the rate of change of \(x+y\), and what does that imply over an interval of time?
- If \(x=8\) kg, \(y=3\) kg, and \(q=2\) kg/h with no external flows, calculate both stock rates and their sum.
- Can external flows be present while \(x+y\) remains constant? State the condition on their rates.