A general framework for stock dynamics of populations and built and natural environments

Sustainable development involves a responsible management of the interactions between humans and their built and natural environment. From a physical perspective, the interactions can be characterized as stocks and flows of energy and matter within and between these spheres. Understanding the dynamics of the stocks is essential to enable their responsible management. A large number of independent disciplines study the dynamics of individual stocks with specific methods. The resulting fragmentation of methods hampers interdisciplinary learning, including the integration of more specialized discipline‐specific models into more encompassing ones. Here, we develop a general mathematical framework for dynamic stock models based on balance, intrinsic, and model‐approach equations. We use the framework to classify a variety of stock models from different disciplines and discuss their applicability. The framework provides a common language for the interdisciplinary analysis of coupled human–environment systems. This article met the requirements for a gold‐gold JIE data openness badge described at http://jie.click/badges.

operating space for humanity" defined by "planetary boundaries" (O'Neill et al., 2018;Rockström et al., 2009;Steffen et al., 2015) that correspond to limits on concentrations of problematic substances in certain environmental reservoirs, such as the atmosphere and the oceans. The actual concentrations depend on the biogeochemical and anthropogenic cycles of the respective elements (Chen & Graedel, 2012a). These cycles link the human population with reservoirs in the built and natural environment through exchanges of matter and energy over time (Haberl et al., 2019).
It is therefore essential to develop an understanding of the concurrent dynamics of the human population as well as the built and the natural environment (Krausmann et al., 2017;Lutz, 2017;Müller et al., 2013;Pauliuk & Müller, 2014;Weisz et al., 2015). Here, we understand the built environment to encompass all physical stocks amassed by human societies except for human bodies, livestock, and crops (Bartuska, 2007). This notion is also known as "technomass" (Inostroza, 2014), "manufactured capital" (Weisz et al., 2015), or "material stocks" (Haberl et al., 2019).
Several disciplines analyze the stocks and flows of anthropogenic and natural systems, including demography (Lutz, 2012), epidemiology (Schoenbach, 2007), population ecology (Beddington & May, 1977;Anderson et al., 2008), industrial ecology (Frosch, 1992), economics (Cleveland et al., 1984;Costanza et al., 1997), urban planning (Wolman, 1965;Inostroza, 2014), engineering (Allwood et al., 2011), and forestry (Müller et al., 2004). These disciplines have often developed their own languages and tools for analyzing stock dynamics in sophisticated ways within their systems of interest. This fragmentation in languages and tools hampers a common learning process as well as the integration of anthropogenic and natural systems into more comprehensive models (Haberl et al., 2019). Integrated assessment models, for example, have only recently started to include built environment stocks explicitly (Pauliuk et al., 2017), and are in the process of refining the resolution of population stocks (Samir & Lutz, 2017). Vásquez Correa (2018) has begun to model both the demographic (Lutz, 2012) and the socio-economic (Fischer-Kowalski & Haberl, 1998) metabolism to study food and housing demand.
To facilitate the development of such models in the future, we (i) develop a general framework for dynamic stock models, (ii) use this framework to classify different ways of describing dynamic stock models, and (iii) discuss how our framework can be applied to human populations and to stocks in the built and natural environment. Our focus lies on physical systems of stock and flow relationships that are common to all three domains, while omitting the exploration of domain-specific external drivers.
Notation. Vectors are denoted by uppercase letters in boldface.

Conservation principles and system variables
The terminology of material flow analysis (MFA) set forth by Baccini and Brunner (1991), Baccini and Bader (1996), as well as Brunner and Rechberger (2004) builds on the notion of mass conservation and defines processes as spatially defined balance volumes that include a "transport, transformation, or storage" of materials. MFA has since been extended to include energy balances (Müller et al., 2004) and been used to measure national and global material stocks and flows (Fischer-Kowalski et al., 2011;Schandl et al., 2018;Wiedenhofer et al., 2019).
Here, we expand the notion of processes to balance volumes of any physical entity, including humans, animals, plants, or man-made artefacts. The expansion needs to be dealt with carefully. The first law of thermodynamics states that energy can neither be created nor destroyed. In the absence of nuclear reactions, it implies the principle of mass conservation. Entities such as living organisms and man-made artefacts, however, undergo cycles of creation and destruction, and obey conservation principles only within further limitations. The conservation of entities other than energy or mass is nevertheless useful in many applications, provided that these limitations are carefully considered by treating creation and destruction as in-and outflows. Demography, for example, accounts for births and deaths to balance human populations (Land et al., 2005).
In MFA, stocks are traditionally defined as quantities of mass or energy in spatially delimited balance volumes at specific points in time. Other entities are included in MFA either as carriers (called goods) of materials and energy or as exogenous parameters influencing mass and energy flows and accumulations. For example, Müller (2006) calculated the quantity of concrete in the Dutch dwelling stock as a function of the Dutch population and its housing needs.
Here, we define stocks as quantities of general entities in processes. Flows represent the amount of entities exchanged between two processes in a fixed period of time. The temporal evolution of a process over a time horizon T can therefore be described by its stock, S, its inflows, I, and its outflows, O. Consistent with MFA terminology, we refer to these variables collectively as system variables. The time horizon is often discretized into N = T∕Δt periods of length Δt. We denote the stock at the end of period t by S t and the inflow and outflow during period t by I t and O t , respectively.
The system variables are then time series, which we henceforth represent mathematically by the non-negative N-dimensional real row vectors I and O for I and O, respectively, and the non-negative (N + 1)-dimensional real row vector S for S.
The conservation principles imply that any difference between the in-and outflow during any period t translates into an equal difference between the stock at the end and the beginning of period t. Formally, the stock change, ΔS t , during any period t obeys the balance (Equation 1) and the intrinsic (Equation 2) equation.
(2) Note that as opposed to the system variables, the stock change may adopt both positive and negative values.
One can visualize the conservation principles by representing the system variables as flows in a directed graph, whose arcs correspond to components of the system variables I, O, and S, and whose nodes correspond to the periods t = 1, … , N ( Figure 1). Note that the term "flow" in graph theory does not only refer to physical flows as in MFA, but can refer to any system variable, including physical stocks. In graph theory terminology, the conservation principles translate into flow conservation, meaning that the total flow entering a node equals the total flow exiting that node, either as an outflow or stock change.
The evolution of the system during any period t is described by the five analysis variables (I t , O t , ΔS t , S t−1 , S t ), where S t−1 plays the role of an initial condition. Although not strictly needed, we added the stock change during period t to the list of descriptors for ease of analysis. The variables may be calculated with the help of five linearly independent equations, which are the balance and intrinsic equations (Equations 1 and 2) and three additional model-approach equations.

Model-approach equations
Model-approach equations consist of parameter functions that are not necessarily founded in physical laws. They often depend on the purpose of the model and are estimated from expert judgement, empirical evidence, or physical models. Forest succession models, for example, may estimate birth, death, and growth rates based on a variety of environmental factors such as temperature, soil humidity, and light availability (Larocque et al., 2016). In general, model-approach equations either define an analysis variable directly, for example, by defining an individual flow or an initial condition for the stock, or link two analysis variables ( Figure 2). For instance, they may link: Matrix description of the analysis variables' cohort composition over N periods 1. Inflow and outflow. The relation between in-and outflow is determined by a time delay, which is often referred to as the lifetime, L. For living organisms, lifetime is a trivial concept. For non-living entities however, the terms "delay" or "residence time" might be more appropriate. Here, we use the term "lifetime" because it is common in many disciplines.
2. Inflow and stock. In population dynamics, the relation between inflow and stock is termed birth rate, b. It relates the stock at the end of the previous period to the inflow during the current period. Birth rates for physical goods are often called differently, such as "construction rates" for buildings. For the sake of simplicity, we henceforth use the term "birth rate" for both living organisms and physical goods.
3. Outflow and stock. In demographics, the relation between the stock at the end of the previous period and the outflow during the current period is known as death rate, d. Death rates correspond to leaching rates (van der Voet et al., 2002) for the loss of materials or substances.
4. Stock and stock change. Growth rates, g, relate the stock at the end of the previous period with the stock change during the current period.
More elaborate model-approach equations may rely on several parameters to relate more than two system variables with each other. For example in demography, the Gompertz-Makeham law of mortality (Makeham, 1860;Missov & Lenart, 2013) stipulates that the outflow O t during period t of an inflow I t 0 during period t 0 is the sum of a term, e (t−t 0 ) I t 0 , that increases exponentially with age, t − t 0 , (which corresponds to a lifetime function), and a term, S t−1 , that depends on the stock size only (which corresponds to a death rate).
In general, the parameter values can change over time. For instance, human life expectancy has increased dramatically over the last 200 years (Horiuchi, 2000). Keeping track of the period in which entities are created, that is, their cohort, will allow us to consider time-dependent parameters explicitly, for example, by assigning a different lifetime to each cohort.

Cohorts
In general, the analysis variables may contain elements of the cohorts c = 1, … , t for any period t. Their cohort composition can be represented by upper triangular matrices whose rows and columns correspond to cohorts and time periods, respectively. For example, O 1,2 is the outflow from cohort 1 during period 2. Here, we focus on new inflows with age zero, that is, on diagonal inflow matrices ( Figure 3). If we allowed for inflows of old cohorts (e.g., imports of used goods or immigration), then the inflow matrix would also be upper triangular.
The balance and intrinsic equations apply to each cohort c individually. In combination with the non-negativity of the inflow, outflow, and stock, they imply that for any period t the sum over the outflows of cohort c that have occurred up to period t must be smaller or equal to the inflow of and that for any cohort c between 1 and t, the quantity of cohort c in the stock at the end of period t is given by the inflow during period c minus the outflows of cohort c during the periods c, … , t.
In general, the initial stock may be non-zero, in which case it consists of cohorts predating the beginning of the modeling time horizon. For Equation (4) to be well defined for all cohorts from the oldest cohort in the initial stock to the youngest cohort in the terminal stock, one may artificially prolong the modeling horizon into the past, so as to include the inflow of the oldest cohort in the initial stock. The stock of all cohorts that matter for the original horizon will then be zero at the beginning of the prolonged horizon and can be described by Equation (4). This will enable us to derive several more equations governing stock dynamics. The price of the horizon extension is an increase in the dimension of all analysis variables and all parameters. As the extended model considers only flows of cohorts that are relevant for the original horizon, it does not properly describe the state of the system before the beginning of that horizon.
The concept of cohorts enables us to define a lifetime matrix, L, whose component L c,t = O c,t ∕I c,c is the fraction of I c,c that leaves the stock during period t. After extending the time horizon, we can assume that the number of cohorts equals the number of time periods. This implies that the lifetime matrix is square and as such may be invertible.
The lifetime matrix yields an easy way to calculate the aggregated outflow O t = ∑t c=1 O c,t during period t as a function of the inflows during the periods 1, … , t. To see this, denote the aggregated in-and outflow and the stock change from all cohorts during the periods 1, … , N as row vectors I = which allows us to express the stock change as a function of I and L, where is the identity matrix of size N. The inflow can now be expressed as a function of the stock change and the lifetime, if and only if ( − L) has full rank, that is, all its diagonal elements are greater than zero. This is the case if and only if the time resolution of the model is fine enough to ensure that no cohort enters and completely leaves the stock during one and the same period.
Recall that the stock change can be computed via the intrinsic equation if the evolution of the stock is known. Equation (8) may thus be used in stock-lifetime-driven models to determine inflows given the lifetime matrix and the evolution of the stock. Solving the equation may seem somewhat cumbersome because it involves the inverse of the matrix ( − L). As this matrix is upper triangular, however, the equation can be solved by forward substitution (Horn & Johnson, 1985;Hackbusch, 2015), that is, by subsequently calculating the inflow during all periods. Doing so takes at most N(N + 1) arithmetic operations. This means that solving stock-lifetime-driven models only takes N more arithmetic operations than solving inflowlifetime-driven models, where outflows are calculated by the matrix product of inflows with the lifetime matrix. If the stock's cohort composition is known, the inflow of a specific cohort c can even be found directly by examining the stock of cohort c at the end of a period t ≥ c such that S c,t > 0.
In fact, Equation (4) yields While the balance and the intrinsic equations are common to all dynamic stock models, the model-approach equations depend on the purpose of the model and on the available prior information about the system variables. Therefore, different disciplines may be familiar with different modelapproach equations. In the next section, we provide a table that classifies dynamic stock models based on the model-approach equations and the prior information they assume. Figure 4 shows 21 combinations of model-approach equations with prior information about system variables. Each of these combinations allows for the direct determination of the unknown system variables and is therefore a valid dynamic stock model.

F I G U R E 4
The system variables can be determined by combining flow and stock measurements with no model-approach equation (green), one model-approach equation (blue), or two model-approach equations (orange). We distinguish models that rely on the full vector of stock measurements, S, including the initial stock, S 0 , from models that rely only on S 0 Note that all models using a lifetime and the initial stock as input also require the cohort composition of the initial stock. In general, knowing the cohort composition allows for a more robust estimation of the system variables. In case 11, for example, the inflow can be calculated directly as I = OL −1 if the lifetime matrix is invertible. If this is not the case but the cohort composition of the outflow is known, as in case 12, then the inflow of a given cohort c can still be calculated as I c,c = O c,t ∕L c,t by using an outflow of cohort c during some period t ≥ c. If however the first outflow of any cohort appears only after having spent periods in the stock, then it is impossible to estimate the inflows during the last periods of the planning horizon based on outflow and lifetime information alone. This means that the initial stock can only be calculated correctly if a fraction of all its cohorts flows out in or before the last period.

DISCUSSION AND CONCLUSION
The green cases in Figure 4 require little modeling since the balance and intrinsic equations suffice to determine all system variables. However, they require data or assumptions about the initial stock and at least two system variables. If data or reasonable assumptions are available for only one (blue cases) or no (orange cases) system variable, then the remaining variables may be calculated with the help of model-approach equations that link the unknown variables to the known variable or the initial stock. Compared to balance and intrinsic equations, the model-approach equations require less direct information about system variables, but more information about the relationships between them.

Choice of model-approach equations
The choice of model-approach equations depends on prior understanding of the system's behavior, on the purpose of the model, and on available data. Thus, a set of model-approach equations cannot be judged in terms of absolute truth, but only by how useful it is in answering predefined research questions. As modelers, we need to assume a causal link between drivers and system variables that is not necessarily present in the real system; this is often a simplification of reality and may create systematic errors.
We name the cases in Figure 4 after the system variables and the parameters they depend on. Since the initial stock is used in almost all cases, we only include it in the name if the case does not depend on any other system variable (as in the orange cases). For example, an estimate of dwelling construction based on housing needs, dwelling lifetime, and the existing housing stock is stock-lifetime-driven. In the following, we compare the use of models in different literature streams based on their driving variables and parameters.
To date, the dynamics of the built environment are mostly described by inflow-lifetime-or stock-lifetime-driven models (Müller, 2006;Pauliuk & Müller, 2014;Müller et al., 2014). The former are particularly useful to model and reproduce the evolution of systems in the past, since data on historic inflows tend to be more easily accessible than data on historic stocks (Chen & Shi, 2012;Chen & Graedel, 2012b;. In addition, inflow-driven models tend to be more accurate in the short term because they allow for the modeling of sudden changes such as migration waves or the market penetration of new technologies (Ciacci et al., 2019;Liu et al., 2021). Conversely, stock-driven models, particularly for entities with long lifetimes such as cars or buildings, are well suited for longer-term prospective studies because stocks average out inflow fluctuations and are thus less sensitive to business cycles (Hatayama et al., 2012). In fact, their averaging effect is similar to the one of a low-pass filter in signal processing. In addition, in-use stocks can be seen as a proxy for the level of service, such as housing or transportation, they provide to a population (Müller, 2006;Pauliuk & Müller, 2014;Lin et al., 2017).
Outflow-lifetime-driven approaches are rather uncommon in the MFA literature but very common in perishable inventory management (Fries, 1975;Nahmias, 1977), where the ordering quantities (inflows) depend on demand (outflows) and the residence time (lifetime) of products in the inventory. In addition, outflow-lifetime-driven approaches can be of interest to estimate past inflows and stock sizes based on current outflows and known lifetimes.
Initial-stock-driven approaches are commonly used in system (Forrester, 1968) and population dynamics (Bacaër, 2011). The central premise in these models is that the system is completely described by its initial condition and the laws governing its dynamics, that is, model-approach equations. For example, one might wonder how the size of an animal population evolves given its initial size as well as birth and death rates. Alternatively, one could estimate the depletion of a non-renewable stock such as an ore deposit based on its initial size and extraction rate.

Lifetime versus death rate approach
Outflows can be determined using different types of parameter functions in model-approach equations (Figures 2 and 4). The functions either link inflows with outflows through lifetimes, or they connect stock sizes to outflows through death rates. The lifetime approach can be useful if there is evidence that the time span between inflows and outflows follows a robust statistical pattern (Melo, 1999). Estimating such a pattern usually F I G U R E 5 Comparison of lifetime-and death-rate-driven models with logistic stock growth and time horizon T. The underlying data can be found in the data repository by Lauinger et al. (2021) requires long-term observations, especially for long-lived entities (Müller et al., 2007;Oguchi et al., 2010;Bongaarts & Feeney, 2013;Kontis et al., 2017). If such a pattern cannot be estimated, an age-independent, possibly time-dependent death rate may still be calculated. Age-independent mortality may be correlated with predation, disease, or adverse environmental conditions for living organisms, and with accidents, natural disasters, or weathering for material goods. Figure 5 compares the evolution of in-and outflows with a time-invariant lifetime, following a truncated normal distribution, and a constant death rate, equal to the inverse of the mean lifetime, for a model with logistic stock growth. During the initial growth phase, the death rate approach leads to larger in-and outflows than the lifetime approach. The effective death rate of the lifetime approach is therefore lower than the constant death rate. The two rates converge once the stock and its age composition stabilize.

Time-varying versus constant lifetime
In general, every cohort may have a different lifetime. In England and Wales, for example, there have been two main changes to human longevity since 1850: (i) infant mortality has decreased drastically, and (ii) adult life expectancy has increased by over 20 years. If historic data about live births are coupled with cohort survival curves, it becomes possible to calculate the deaths of each cohort in each year. This in turn allows us to calculate how many individuals of each cohort are still alive in each year. Figure 6 shows the influence of using an average rather than the actual lifetime for each cohort: the average lifetime overestimates the lifetime of early cohorts and underestimates the lifetime of late cohorts. Initially, the average lifetime approach thus underestimates mortality and overestimates the size of the population born since 1850. From 1920 onward, the average lifetime approach overestimates mortality. From 1950 onward, it underestimates the size of the population born since 1850. This leads to wrong conclusions. The average lifetime approach suggests that the population born after 1850 peaked around 1930 and has been declining ever since, whereas the cohort-explicit lifetime approach shows that, in fact, the population has not reached its peak yet and may continue its increase beyond the year 2000.
Conversely, every cohort may have a similar lifetime in a stable environment. For example, human life expectancy between 1770 and 1870 was about 30 years with only slight fluctuations (Zijdeman & da Silva, 2015). In this case it suffices to use an average lifetime for all cohorts.

F I G U R E 6
Native female population, survival curves, live births, and deaths from 1850 to 2000 for England and Wales. The underlying data can be found in the data repository by Lauinger et al. (2021) and is based on "past and projected data from the period and cohort life tables, 2016-based: England and Wales, 1841 to 2066" by the UK Office for National Statistics

Cohorts versus age classes
The effect of time-varying lifetimes can be modeled by distinguishing either cohorts or age classes. While cohort approaches are useful when the properties of individual cohorts are preserved over time (e.g., the material composition of vehicles of a specific cohort is preserved throughout the lifetime of the vehicles, while technological change results in changes in material composition over different cohorts), age-class approaches may be preferable if the properties of a specific age class are robust (e.g., the likelihood of mechanical failure tends to be higher for older vehicles than for newer ones, independent of the cohort). A major difference between the two approaches is that models based on age classes do not always conserve the properties of individuals. For instance, a forestry model distinguishing land parcels by grouping trees into age classes would not conserve the same spatial boundaries over time, as one parcel will keep advancing from one age class to the next. On the other hand, a cohort-based model always keeps track of the same cohort, whose spatial boundaries will remain constant over time. Therefore, properties of individuals and effects of external factors (such as local environmental conditions that may affect growth) are easier to track with a cohort-based model. However, if the age classification reaches the same resolution as the cohorts (at any time t the age of a cohort c is simply t minus c), both approaches can potentially be integrated and thereby preserve balance consistency as well as properties related to both cohorts and age classes.

Interdisciplinary learning
We have developed a general framework for stock dynamics and discussed its applications to human populations and to stocks in built and natural environments. The framework can be applied to stocks of any category and has thus the capacity to bridge disciplinary boundaries and to facilitate interdisciplinary learning. It thereby enables comprehensive studies that integrate stocks of human populations and of built and natural environments. The understanding of integrated systems is essential to identify development pathways ensuring human well-being, as it relies upon the "opportunities that are provided to meet human needs in the forms of built, human, social and natural capital" (Costanza et al., 2007).

DATA AVAILABILITY STATEMENT
The code and data behind Figures 5 and 6 are available at www.github.com/lauinger/a-general-theory-for-stock-dynamics and on Zenodo .