Transport.ftt_tr_survival module#

Created on Fri Jan 5 14:38:50 2024

These function construct a age bracket matrix from historical and simulated car numbers per country.

The logic is that a fixed percentage of cars per age bracket are scrapped. New cars are the sum of growth in car numbers and scappage.

This means the new car numbers can be quite volatile, especially historically

Transport.ftt_tr_survival.add_new_cars_age_matrix(age_matrix, capacity, lagged_capacity, scrappage)#

Add new cars to the age matrix. Add the growth in capacity (positive or negative) to the scrappage.

New car additions are set to zero if calculation is negative (f.i. with regulation)

Transport.ftt_tr_survival.get_survival_ratio(survival_function_array)#

Transform survival function into a year-on-year ratio of survival.

The survival ratio is reshapen to work with RLTA

Returns:

survival ratio with shape (country, None, age brackets)

Transport.ftt_tr_survival.initialise_age_matrix(data, titles)#

At the start of the simulation, set up an age matrix, assuming an equilibrium has been reached

# TODO: This needs to be replaced with actual data?

Transport.ftt_tr_survival.survival_function(data, time_lag, histend, year, titles)#

Survival function for each car type

We calculate the number of cars by age bracket (RLTA) and scrappage (REVS), Ultimately, we want to include sales and average efficiency in this function too.

Returns:

data – Model variables for the current year

Return type:

dictionary of NumPy arrays