Let’s start with a simple situation: the amount of water in a bathtub.
the state of the bathtub is
$X$ = amount of water in the tub (in gallons)
Q. What is changing the amount of water in the bathtub?
A. the inflow of water through the faucet.
The unit of this flow are not gallons, but gallons per minute (or some other time unit). We write that as gal/min.
It’s not “stuff”; it’s “stuff per unit time.”
For instance, your bank account balance (a quantity of, say, dollars) is changed by your income (in, say, dollars permonth) and your expenses (also in dollars per month).
We represent this by a “change equation” in which we take the state variable $X$ and define
$X'$ (called “$X$ prime”) as the change in $X$. Then we write
$X'$ = rate of change of $X$
For the bathtub example, we would write
$X' =$ inflow of water through the faucet.
Let’s make the assumption that the inflow is constant over time, and that its value is 10 gal/min.
We then write
$$X' = 10$$Similarly, if $X$ is your bank account balance and you never withdraw money, then a change equation for the account balance would be
$$X' = D + I,$$where $D$ represents your deposits and $I$ represents interest, both in dollars per month (or year).
Now let's consider a bathtub with a drain so the water flows out.
So the change equation would become
$$X' = -\text{outflow from the drain}$$The outflow is clearly going to subtract from $X$, and make its value less, so it has to have a minus sign.
But what would the “outflow” looks like?
Now we have a situation we haven’t seen before: the flow out of the bathtub is not constant; it depends on the amount of water in the bathtub.
The higher the water level, the greater the water pressure at the drain, and the faster the water will flow out.
But as the water flows out, the pressure decreases, and so the flow rate also decreases.
In order to make this into a real change equation, we need a mathematical expression for how the flow rate depends on the water level $X$. As we just said, the greater the water level $X$, the greater the flow.
Let’s suppose that the relation is that they are proportional.
To say that “$Y$ is (directly) proportional to $X$”, written as $Y \propto X$ means there is some constant $k \neq 0$ (called the proportionality constant) such that
$$Y = kX$$Note that if $Y = kX$, then $X = (1/k)Y$, so $Y \propto X$ is the same as $X \propto Y$.
$Y$ is inversely proportion to $X$ if $Y \propto \dfrac{1}{X}$. Equivalently, $XY \propto 1$.
Exercise 1.4.1 Write the following statements as equations.
a) $A$ is proportional to $B$ with a proportionality constant of $2.5$.
b) $X$ is proportional to $Z$ with a proportionality constant of $−3.7$.
c) An animal’s population density, $P$ , is proportional to body size, $B$, with a proportionality constant of $m$.
Back to the bathtube case.
The wider the drainpipe, the faster the flow for a given pressure so the constant of proportionality is the width of the drainpipe.
So the outflow = $kX$, then we have the change equation $$X' = −kX$$
In this equation, what is the unit of $k$?
Since $X'$ is in gallons per minute and $X$ is in gallons, so the unit for $k$ must be 1/min.
Of course, k is just a symbol. Say, it has the value $k = 0.2$ per min for this bathtub and drain.
Then our change equation is $$X' = −0.2X$$
We will now look at change equations more generally. The ingredients of such equations, which we will discuss now, are stocks and flows.
Stocks are values of state variables.
Example of stocks:
Exercise 1.4.2 Give three more examples of stocks
Flows are factors that change stocks.
Flows are measured in amount/unit time.
Change equations tell us how fast the state variables are changing and whether the change is positive or negative.
Keep in mind that, in most cases, rates of change of state variables are not themselves state variables.
However, there are exceptions. For example, in mechanics, velocities are state variables.
In the bathtub model above, the state variable is $X$, the amount of water in the bathtub.
Variables change their values as the system changes over time.
But what about $k$?
It is constant for a given model and doesn’t change with time. It is called a parameter of the model.
Parameters are, for now, fixed numbers like $0.2$.
Later on, we can generalize this to parameters that change on their own with time (like an outflow tube getting narrower with time).
In this text, we will always use capital letters for state variables, and lowercase letters for parameters, so as never to confuse them.
Let's look at another example. Consider a cup of coffee in cooler room.
Let $T$ be the temperature of the coffee (in degrees Kelvin) which will be our state variable.
Newton's Law of cooling The rate of change in temperature of the coffee is proportional to the difference between the temperature of the coffee and temperature of the room $r$ (a parameter).
Thus, the change looks like:
$$ T' = \text{constant} \cdot (T-r) $$The proportional constant will be another parameter of the model (depending on what is being heated up or cooled down).
Let's think about the sign of this parameter.
If the coffee is hotter than the room, that is $T-r > 0$.
Then the coffee will be cooled down so the sign of $T'$ is negative
and hence the sign of the proportional constant must be negative.
This goes the other way round too. If the coffee (e.g. ice coffee) is cooler than the room, then $T-r < 0$
It will then be warmed up by the room and so $T'$ in this case will be positive.
So, again we conclude that the proportional constant must be negative.
So, we write our final change equation as
$$ T' = -k(T-r)$$where $k$ is a positive constant.
Let $X$ be a stock, we future distinguish
Example. $X=$ amount of water in bathtub. Then facuet is an in-flow of $X$ and sink is an out-flow of $X$. Both measured in say $\ell$/min.
Example. $X=$ amount in a bank account. Then income, interest are in-flows and withdraw is an outflow of $X$ (all measured in $/month)
Exercise 1.4.3 List all the inflows and outflows for each stock you came up with in Exercise 1.4.2.
Exercise 1.4.4 Draw a box-and-arrow diagram for each of your stocks.
For a stock $X$, let
We have
$$ X' = \mathrm{inflows - outflows} $$The word equation for the bathtub example shown in Figure 1.26 is
change in amount of water (per unit time) = inflow rate− outflow rate
The word equation for the population example shown in Figure 1.26 is
change in population (per year) = births per year + immigrants per year− deaths per year − emigrants per year
Exercise 1.4.5 Write word equations for the bank account and battery examples in Figure 1.26.
Exercise 1.4.6 Write word equations for your three box-and-arrow diagrams.
Exercise 1.4.7 Why is there a minus sign in front of the 7 in the previous example?
Exercise 1.4.8 Call the amount of trash in a landfill L and suppose 1000 pounds of trash are added to the landfill daily. Write a change equation for the amount of trash.
Exercise 1.4.9 Suppose 100 births and 95 deaths occur in a population each year. Also, 3 individuals enter the population from outside and 2 leave. Write a change equation for the population size, P .
1.4.7 minus sign because the amount of stock (issue in this case) is decreasing (usage is an outflow)
1.4.8 $L' = 1000$ lb/day.
1.4.9 $P' = 100-95 +3 -2$ person/year