That is wonderful. It now works fine! I graphed the inc. temperature, inc. loss and the CO2 pulse from the marginal model. The inc. temperature goes up to 5.4 E-13 °C by 2029 then declines. Emissions are 0.1 tCO2/y for 10 years = 1 tCO2. The loss is positive for 4 years, then mostly negative to 2100 then positive, but with big up and down spike.
I am unclear in what the marginal loss number represents. I ran the model with n = 5000 trials, so there should be 5000 values for the marginal loss in each year. From “marg_loss = SCCO2.mm[:impactaggregation, :loss]”, the loss in 2020 was 0.021. Is this the loss in 2020 of the n = 5000th trial, or the mean of all 5000 trials, or the median of all 5000 trials?
The calculated “median(SCCO2.sc)” is 0.63 with eta = 0.0, prtp = 0.03. But when I apply 3% discounting to the loss for years 2020 to 2400 in Excel, the discounted loss is -0.74. If the loss returned by the SCCO2.mm is the median of 5000 trials, I expected these two number to be the same. Can you explain why these are different?
You wrote “even though the pulse was a million tons of C for ten years” but I think the pulse size is 10 MtCO2, or 1.0 MtCO2/yr for 10 years. That is the pulse size in the compute_scco2 is in tCO2. It is converted in the function add_marginal_emissions! by “pulse_size / 1e7 * (gas == :CO2 ? 12/44 : 1)” to 2.727 MtC, then we convert it back to 10 MtCO2 in notebook via * 44/12. Do you agree?