Introduction 
============

Note on Nomenclature 
~~~~~~~~~~~~~~~~~~~~
  
The mathematical notation and conventions used throughout this documentation are described in this section.
As this documentation provides a detailed explanation of how the models are implemented within Cascade 
at the mathematical level, certain conventions are adopted to explain concepts which are used 
throughout.

The notation includes the parameters defining each function to convey 
how each strategy is modeled. As an example, the number of flights, :math:`n`, which formally depends on the aircraft type, :math:`ac`, route, :math:`rt`, 
aircraft operator, :math:`op`, and year, :math:`t`, is written as

.. math:: 
    :label:
    
    n = n(ac, rt, op, t).
   

Most calculations within Cascade are done on an aircraft type, 
route, and annual basis. The only calculations specific to operators are those within the :term:`CORSIA` module. 
As a result, the operator argument is dropped from most equations. 

Lowercase variable names are used to denote values on a route-by-route basis, while uppercase variables are used 
to denote the same values aggregated to a fleet level. For example, the total number of flights occurring in a given year, 
:math:`N(t)`, is the sum of flights across all aircraft types, routes, and operators in that year, :math:`n = n(ac, rt, op, t)`,and is denoted by 

.. math:: 
    :label:

    N(t) = \sum_{\mathrm{aircraft}} \sum_{\mathrm{routes}} \sum_{\mathrm{operators}} n(ac, rt, op, t).
    
In cases where intermediate values are computed prior to correcting the value for use in a model, 
the uncorrected value is indicated with an asterisk and the corrected value contains no superscript. 
For example, when calculating distance flown, :math:`d`, the uncorrected distance, :math:`d^*`, is first computed 
using the great circle distance, :math:`gcd`, which is defined as the shortest path between two points on the surface of a sphere, and is thus solely a function of the route, :math:`rt`. The uncorrected 
distance is then generally passed to some function, :math:`f`, to compute the corrected distance flown:

.. math:: 
    :label:

    d^* &= gcd(rt), 

    d &= f(d^*).


Model Structure 
~~~~~~~~~~~~~~~

The Cascade application has a component-based architecture such that each model, representing a single sustainability strategy, 
can be run independently in whatever sequence best suits the scenario being analyzed. Nevertheless, there is a default order 
which will suit a wide range of different possible analyses. Running each model sequentially outputs the total reduction in 
emissions if all strategies were implemented concurrently and allows the difference in emissions to be attributed to specific 
models. This is the architecture used in the Cascade web application.

The standard Cascade modeling pipeline, shown in :numref:`example-modeling-pipeline`, operates on a database containing the flight traffic 
for all scheduled passenger and cargo flights in a given year. By default, a global dataset is used. If the user
wishes to analyze a particular market segment or geographical region, filters are applied to the dataset. 
Base metric calculations are run on the filtered data to calculate fuel burn, energy consumption, and CO2 emissions for each route. 
A traffic growth model is then applied to project the values of these metrics for each year up to the end year. 
Following this pre-processing, models representing sustainability strategies are applied to the time-series 
flight traffic data in the following order:

1. Aircraft (Fleet Renewal, Future Aircraft)
2. Operations
3. Energy (Electricity, Hydrogen, SAF)
4. Offsets & Removals (CORSIA, Custom Global Initiative, and Voluntary Measures)

The behavior of each model depends on the configuration set by the user. Supplemental datasets such as 
aircraft characteristics or life cycle carbon intensities of processes are used by submodules as required. 
At each stage, aggregate metrics such as the overall reduction in CO2 emissions are calculated and saved. 
This information is used in post-processing to generate visualizations showing the change in metrics for 
different strategies. Additional metrics, such as the insertion rate of new aircraft into the fleet or the 
total electricity required for aviation by year, can be calculated from the final metrics after all strategies 
have been applied.

.. _example-modeling-pipeline:

.. figure:: ../../_static/images/introduction/StrategiesFlowDiagram.svg
    
    \- Example Cascade modeling pipeline

