Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generic diagnostics capability #32

Open
briochemc opened this issue Apr 1, 2020 · 1 comment
Open

Add generic diagnostics capability #32

briochemc opened this issue Apr 1, 2020 · 1 comment

Comments

@briochemc
Copy link
Member

briochemc commented Apr 1, 2020

Let's try to add some diagnostic functionality to AIBECS that generalizes the work done in Pasquier and Holzer, 2018.


Preliminary notes

Let's start from the generic equation

(∂ₜ + T) x = G(x).

x could represent a multitude of tracers and processes. Within x, there may be separate groups of tracers with a group per compound or element. E.g., one could be tracking many elements including, e.g., phosphorus, whose group could be composed of three pools, like PO4, DOP, and POP. For the diagnostics that I am interested in, we will assume for simplicity and without any loss of generality, that there is only one element (one group) here.

We can then express the group's system without loss of generality as a bunch of

  • source terms sp(x) that inject x into the system,
  • of "transfers" terms that exchange the element between tracers of our group Jij(x),
  • and of "death" processes dq(x), which ultimately remove x from the system.

Mathematically, that means we can write

G(x) = ∑p sp(x) + ∑ij Jij(x) + ∑q dq(x).

We construct the LEM by first creating linear-equivalent terms for Jij(x) and dq(x), evaluated at the steady-state solution x given by

T x = G(x)

In other words, the LEM is built such that

G(x) = ∑p sp + ∑ij Lij x + ∑q Lq x

when x is the steady-state, and where

  • Lij is a block matrix where only 2 blocks are non-zero, (i,j) and (j,i), which have diagonals -(Jij(x))i / xi, and +(Jij(x))j / xi, respectively. (Note we use xi to "linearize" Jij so that the rate of transfer is specific to the removed tracer.)
  • and Lq is a diagonal matrix with diagonal dq(x) / x.

We then construct the LEM simply as

(∂ₜ + H) x = ∑p sp

where

H = T - ∑ij Lij - ∑q Lq

and we can then exploit this for powerful diagnostics as in Pasquier and Holzer, 2018. Fractions that came from source sp, or fraction that will be removed via process dq, are available from a single backslash with H. One can also further partition according to each ij passage by removing Jij from H into a F operator and iteratively reapplying the source term. Direct computations leveraging the classical identities ∑n xn and ∑n n xn also allow for direct computations of, e.g., the number of ij passages.

@briochemc
Copy link
Member Author

Maybe classify diagnostics in different groups (passages, age, and so on) and lay down a plan to implenent them. E.g., automate the extraction of the equivalent linear models and use dispatch to solve diagnostic equations of Solved and Unsolved problems (e.g., to solve the main problem and the diagnostic in one go).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant