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

Continuous-inflow and outflow LDF in DSM #13

Open
JakobBD opened this issue Aug 7, 2024 · 1 comment
Open

Continuous-inflow and outflow LDF in DSM #13

JakobBD opened this issue Aug 7, 2024 · 1 comment

Comments

@JakobBD
Copy link
Collaborator

JakobBD commented Aug 7, 2024

Currently, The lifetime distribution function assumes that all input to the DSM happens on 1 January at once.
This is irrelevant for longer $lifetimes >> 1 year$. But for plastics packaging we have much shorter lifetimes.
If instead we take time averages of the lifetime distribution functions, we would get

$\lim_{lifetime\rightarrow 0} stock = annual\_inflow * lifetime\_in\_years$,

which is the actual limit, instead of some other, incorrect value of the LDF.

However, we should make this behaviour optional.

@JakobBD
Copy link
Collaborator Author

JakobBD commented Aug 23, 2024

Proposed methodology:

  • 2 "modes":
    • One with "time instant" like now, which receives a vector of points in time, such that the survival function at input year = output year is always zero.
    • One with "time average", where each time step represents the average stock and flow in that period.

Time instant implementation:

  • first get a difference matrix (previously called "remaining ages") $D_{o,i} = \max(0, t_o - t_i)$, where $i$ and $o$ are input year and output year indices and $t$ is the time vector.
  • get a matrix "end of life share by year" $E_{o,i} = \rho_i(D_{o,i})$ with the lifetime distribution function $\rho$ (e.g. log-normal; NOT the survival function), the parameters of which may depend on the input year.
  • Get the survival function $S_{o,i} = 1 - \sum_{\tilde{o}=1,...,o} (E_{\tilde{o},i})$, i.e. one minus the cumsum over $o$.

Changes for average formulation

  • instead of a vector of time instants, this method needs a vector of time interval lengths $l$ and a vector $s$ with the starting points of the time intervals. Since we can't assume that such a vector is passed, I'd add a method to create it from a vector of time instances, where each interval bound is in the midpoint between two time instances. The starting point vector is one element longer than $t$, as $s_{n+1}$ is needed as the end point of the interval $n$.
    I assume that $t$ indices run from 1 to $n$. Then $s_i=(t_i + t_{i-1})/2$ for $i=2,...,n$, and extrapolation yields $s_1=s_2 - (t_2 - t_1)$ as well as $s_{n+1}=s_n + (t_n - t_{n-1})$. . The vector of interval lengths is then $l_i = (s_{i+1}-s_{i})$ for $i=1,...n$.
  • $\tilde{D}_{o,i} = \max(0, s_o - s_i)$ is also required in the adapted/extended version.
  • instead of getting $E_{o,i} = \rho_i(R_{o,i})$, we now get it via the integral average formulation
    $E_{o,i} = [P_i (\tilde{D} _{o,i})-P_i(\tilde{D} _{o+1,i})]/l_i$ . Here, $P$ is the scipy survival function belonging to each ldf. Its parameters (mean, std) can be dependent on $t_i$.
  • The calculation of $S_{o,i}$ remains the same as for the time instant implementation

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