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

inverse emissions calculation unstable with current parameters #137

Open
benmsanderson opened this issue Jun 9, 2024 · 3 comments
Open

Comments

@benmsanderson
Copy link
Collaborator

Current implementation of inverse carbon calculation can fail due to negative CO2 concentrations generated in bisection algorithm.

convergence fails when the log is taken in the npp calculation:
np.log(self.co2_hold["xCO2"] / 278.0)

(line 308, carbon_cycle_mod)
Propose reducing the width of the initial window:
from current

    min_guess = self.simplified_em_backward(co2_conc_now / 2, co2_conc_zero)
    max_guess = self.simplified_em_backward(co2_conc_now * 2, co2_conc_zero)

to the following:
min_guess = self.simplified_em_backward(co2_conc_now / 1.2, co2_conc_zero)
max_guess = self.simplified_em_backward(co2_conc_now * 1.2, co2_conc_zero)

This is still wide enough to accommodate vast annual +ve or -ve emissions, but seems in practise less likely to blow up.

Ideally, on the medium term to-do list, this should be a free parameter.

@maritsandstad
Copy link
Contributor

The width of the guess should be a free parameter, that seems a bit weird, this is the most like random starting point for solution iteration, it being a free parameter seems strange...? Also, can we just require that the minimal guess be larger than zero? Did you encounter this from back-calculating with a very flat emissions profile?

@benmsanderson
Copy link
Collaborator Author

benmsanderson commented Jun 10, 2024 via email

@maritsandstad
Copy link
Contributor

Is there somewhere that you have your setup for this that I can have look at, maybe I can think about a slightly less ad hoc solution...

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

2 participants