ftt_core.ftt_shares module#
Created on Thu Jul 24 08:36:58 2025
@author: Femke Nijsse
Two versions of the shares equation are included 1. The normal shares equation as described by Mercure (2012) 2. The shares equation for premature replacements as described in Knobloch (2017)
- ftt_core.ftt_shares.shares_change(dt, regions, shares_dt, costs, costs_sd, subst, reg_constr, num_regions, num_techs, upper_limit=None, lower_limit=None, limits_active=False, T_Scal=1.0)#
Wrapper for the jitted shares function. Ensures consistent input types to enable faster compilation.
T_Scal: Time scaling factor. Default 1.0 (no scaling). Power uses 10.0. Applied AFTER RK4 integration to match Cascading branch behavior.
- ftt_core.ftt_shares.shares_change_jitted(dt, regions, shares_dt, costs, costs_sd, subst, reg_constr, num_regions, num_techs, upper_limit, lower_limit, limits_active=False, T_Scal=1.0)#
Calculates change in market shares, based on previous market shares, substitution rates and costs
- Parameters:
dt (float) – Time step size
shares_dt (ndarray) – Shares, costs and standard deviation of costs at previous timestep
costs (ndarray) – Shares, costs and standard deviation of costs at previous timestep
costs_sd (ndarray) – Shares, costs and standard deviation of costs at previous timestep
subst – Substitution matrix (determines speed), called Aij in paper
:param : Substitution matrix (determines speed), called Aij in paper :param reg_constr: Regulatory constraints: stops share changes to this tech :type reg_constr: ndarray :param num_regions: Number of regions and technologies :type num_regions: int :param num_techs: Number of regions and technologies :type num_techs: int :param upper_limit_dt: Any minimum and maximum limits (e.g. for grid stability) :type upper_limit_dt: ndarray :param lower_limit_dt: Any minimum and maximum limits (e.g. for grid stability) :type lower_limit_dt: ndarray :param limits_active: Whether limits are active or not :type limits_active: bool :param T_Scal: Time scaling factor. Default 1.0 (no scaling). Power uses 10.0. :type T_Scal: float
- Returns:
Change in shares, taking into account regulation and endogenous limits (optional)
- Return type:
ndarray
Notes
Decorated with @njit(fastmath=True) for performance optimization.
- ftt_core.ftt_shares.shares_change_premature(dt, regions, shares_dt, costs_marg, costs_marg_sd, costs_payb, costs_payb_sd, subst, reg_constr, num_regions, num_techs)#
Calculates change in market shares due to premature replacements, based on previous market shares, substitution rates and various costs
- Parameters:
dt (float) – Time step size
costs (shares_dt) – Shares in previous timestep
costs_sd (ndarray) – Shares in previous timestep
costs_marg (ndarray) – Marginal costs (fuel costs + O&M etc.)
costs_marg_sd (ndarray) – Marginal costs (fuel costs + O&M etc.)
costs_payb (ndarray) – Payback costs: more expensive than levelised cost, due to faster payback times
costs_payb_sd (ndarray) – Payback costs: more expensive than levelised cost, due to faster payback times
subst (ndarray) – Substitution matrix (determines speed) and regulation (to slow growth)
reg_constr (ndarray) – Substitution matrix (determines speed) and regulation (to slow growth)
upper_limit_dt (ndarray (implmentation still needed)) – Any minimum and maximum limits (e.g. for grid stability)
lower_limit_dt (ndarray (implmentation still needed)) – Any minimum and maximum limits (e.g. for grid stability)
num_regions (int) – Number of regions and technologies
num_techs (int) – Number of regions and technologies
- Returns:
The change in shares due to premature replacements, taking into account regulation. Endogenous limits still need implementing
- Return type:
ndarray
Notes
Decorated with @njit(fastmath=True) for performance optimization.