All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.finmath.climate.models.dice.submodels.EmissionExternalFunction Maven / Gradle / Ivy

Go to download

finmath lib is a Mathematical Finance Library in Java. It provides algorithms and methodologies related to mathematical finance.

There is a newer version: 6.0.19
Show newest version
package net.finmath.climate.models.dice.submodels;

import java.util.function.Function;

/**
 * The function that models external emissions as GtCO2 / year
 * \(
 * 	(t) \mapsto E_{\mathrm{ex}}(t) .
 * \)
 *
 * @author Christian Fries
 */
public class EmissionExternalFunction implements Function {

	private final double externalEmissionsInitial;
	private final double externalEmissionsDecay;	// per 5Y

	private static double annualizedExternalEmissionsDecay = -Math.log(1-0.115)/5.0; //0.115 for 5 years, thus 1-5th_root(1-0.115)

	/**
	 * 
	 * @param externalEmissionsInitial Initial value for the emissions per year. Unit: GtCO2 / year.
	 * @param externalEmissionsDecay Exponential decay rate. Unit: 1/year.
	 */
	public EmissionExternalFunction(double externalEmissionsInitial, double externalEmissionsDecay) {
		super();
		this.externalEmissionsInitial = externalEmissionsInitial;
		this.externalEmissionsDecay = externalEmissionsDecay;
	}

	public EmissionExternalFunction() {
		this(2.6, annualizedExternalEmissionsDecay);
	}

	@Override
	public Double apply(Double time) {
		final double externalEmissions = externalEmissionsInitial * Math.exp(-externalEmissionsDecay * time);

		return externalEmissions;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy