Overview#

Purpose#

E-GRAFS (Extended General Representation of Agro-Food Systems) is a Python model for representing the metabolism of agricultural and agro-food systems. It was designed to convert common agricultural statistics and technical coefficients into physically coherent flow networks.

The core output is an annual transition matrix. Rows are source compartments, columns are target compartments, and values are flows. The nitrogen layer uses ktN/yr as its reference unit. The carbon layer reuses the nitrogen transition matrix and allocation results to derive carbon flows in ktC/yr.

E-GRAFS can be applied at different territorial scales when the required data are available: a small rural territory, a region, a country, or a set of comparable territories over time. It is particularly useful when the research question requires explicit links between crops, livestock, population, trade, excretion management, fertilisation, environmental losses and bioenergy uses.

Why nitrogen is the accounting core#

Nitrogen is central to agro-food systems because it links plant growth, protein production, animal and human nutrition, fertilisation practices, trade in biomass, and environmental losses. In agricultural systems, tracking nitrogen flows helps describe how production is maintained, how biomass is allocated, and where losses occur. It also connects agricultural functioning to atmospheric emissions, water pollution and nutrient use efficiency [Nelson and Cox, 2017, Hawkesford et al., 2023, Conley et al., 2009, Dupas et al., 2019-05-22, Harchaoui and Chatzimpiros, 2019, Nowak et al., 2015].

Nitrogen accounting does not cover everything. It does not replace economic, sociological, agronomic or spatial analysis. It provides a material backbone that can be combined with those perspectives.

Relationship with GRAFS#

E-GRAFS extends the Generalized Representation of Agro-Food Systems (GRAFS), developed by Gilles Billen, Josette Garnier and collaborators and later used for long-term territorial analyses of nitrogen, carbon and phosphorus flows [Lassaletta et al., 2014-04, Le Noë et al., 2018, Le Noe, 2018, Le Noë et al., 2017].

Classical GRAFS represents agro-food systems with a small set of aggregate compartments, typically arable land, permanent grassland, livestock and population. This compact structure is powerful for long historical series and comparative analyses, but it can become limiting when more detailed data are available or when the user wants to distinguish crop types, livestock systems, product categories, trade groups, excreta streams or bioenergy facilities.

E-GRAFS keeps the mass-balance logic of GRAFS while making the compartment structure more flexible and easier to configure through input spreadsheets.

What E-GRAFS adds#

E-GRAFS introduces four main extensions.

  1. Flexible compartment resolution. Crops, livestock categories, products, population groups, excretion streams and energy facilities can be defined by the user in the project file. This makes it possible to adapt the model to data availability and research needs.

  2. Explicit product allocation. Food, feed, imports, exports and energy uses are solved with an optimisation model. This is useful when observed allocation data are incomplete but diet targets, production data and trade rules are available.

  3. Historical and prospective modes. In historical mode, production is mainly read from input data. In prospective mode, crop production is endogenised through fertilisation-response curves, while livestock production follows scenario-defined livestock units and co-production factors.

  4. Additional layers and interfaces. The nitrogen layer is complemented by a carbon layer, bioenergy modules, Sankey visualisation tools and a Streamlit graphical interface.

Core modelling principles#

E-GRAFS is guided by four accounting principles.

  • Nothing comes from nowhere. Inputs must originate from another compartment, an environmental reservoir, an industrial process, imports, or another explicit external node.

  • Flows add up. Internal compartments are balanced by construction. When an output is not directly observed, it is inferred from the accounting balance under documented assumptions.

  • Conventions are explicit. Units, boundaries, signs, environmental outlets and trade nodes are represented consistently across the transition matrix.

  • Interactions matter. The model is not a collection of independent indicators. Changing a crop area, a diet, a livestock population or an energy target changes the flows linking several compartments.

Typical questions#

E-GRAFS is best suited to questions such as:

  • What nitrogen and carbon flows maintain agricultural production in a given territory and year?

  • Which flows connect crops, livestock, population, trade and the environment?

  • How do historical agricultural metabolisms differ across territories or periods?

  • How do prospective scenarios redistribute nitrogen between food, feed, exports, energy uses and environmental losses?

  • Which dependencies or vulnerabilities are revealed when production, imports, fertilisation and biomass uses are represented in one accounting framework?

E-GRAFS does not claim to identify a unique “optimal” agricultural system. It helps make physical constraints, assumptions and trade-offs visible.

Limits of interpretation#

E-GRAFS is a flow-accounting model, not a full agronomic, economic or political model. Results depend on the chosen boundary, data quality, compartment resolution, technical coefficients and optimisation weights. The model checks mass consistency, but it does not by itself validate whether a scenario is socially acceptable, economically viable, institutionally feasible or agronomically detailed enough for farm-level implementation.

Prospective scenarios should therefore be read as physically harmonised configurations under explicit assumptions, not as predictions.

References#

[OV1]

David L. Nelson and Michael M. Cox. Lehninger Principles of Biochemistry. W. H. Freeman, New York, 7th edition, 2017. ISBN 978-1-4641-2611-6.

[OV2]

Malcolm J Hawkesford, Ismail Cakmak, Devrim Coskun, Luit J De Kok, Hans Lambers, Jan K Schjoerring, and Philip J White. Functions of macronutrients. In Marschner's mineral nutrition of plants, pages 201–281. Elsevier, 2023.

[OV3]

Daniel J Conley, Hans W Paerl, Robert W Howarth, Donald F Boesch, Sybil P Seitzinger, Karl E Havens, Christiane Lancelot, and Gene E Likens. Controlling eutrophication: nitrogen and phosphorus. 2009.

[OV4]

Marie-Cécile Dupas, José Halloy, and Petros Chatzimpiros. Time dynamics and invariant subnetwork structures in the world cereals trade network. PLOS ONE, 14(5):e0216318, 2019-05-22. URL: https://dx.plos.org/10.1371/journal.pone.0216318 (visited on 2024-09-13), doi:10.1371/journal.pone.0216318.

[OV5]

Souhil Harchaoui and Petros Chatzimpiros. Energy, nitrogen, and farm surplus transitions in agriculture from historical data modeling. france, 1882–2013. Journal of Industrial Ecology, 23(2):412–425, 2019.

[OV6]

Benjamin Nowak, Thomas Nesme, Christophe David, and Sylvain Pellerin. Nutrient recycling in organic farming is related to diversity in farm types at the local level. Agriculture, Ecosystems & Environment, 204:17–26, 2015. URL: https://linkinghub.elsevier.com/retrieve/pii/S0167880915000651 (visited on 2024-05-06), doi:10.1016/j.agee.2015.02.010.

[OV7]

Luis Lassaletta, Gilles Billen, Bruna Grizzetti, Josette Garnier, Allison M. Leach, and James N. Galloway. Food and feed trade as a driver in the global nitrogen cycle: 50-year trends. Biogeochemistry, 118(1-3):225–241, 2014-04. URL: http://link.springer.com/10.1007/s10533-013-9923-4 (visited on 2024-04-30), doi:10.1007/s10533-013-9923-4.

[OV8]

Julia Le Noë, Gilles Billen, Fabien Esculier, and Josette Garnier. Long-term socioecological trajectories of agro-food systems revealed by n and p flows in french regions from 1852 to 2014. Agriculture, Ecosystems & Environment, 265:132–143, 2018.

[OV9]

Julia Le Noe. Biogeochemical functioning and trajectories of French territorial agricultural systems: carbon, nitrogen and phosphorus fluxes (1852-2014). PhD thesis, Sorbonne Université, 2018.

[OV10]

Julia Le Noë, Gilles Billen, and Josette Garnier. How the structure of agro-food systems shapes nitrogen, phosphorus, and carbon fluxes: The generalized representation of agro-food system applied at the regional scale in France. Science of The Total Environment, 586:42–55, 2017. URL: https://linkinghub.elsevier.com/retrieve/pii/S0048969717302814 (visited on 2024-04-30), doi:10.1016/j.scitotenv.2017.02.040.