Functions¶
- class Functions[source]¶
Methods
clear
copy
dump
from_dict
fromkeys
Create a new dictionary with keys from iterable and values set to value.
get
Return the value for key if key is in the dictionary, else default.
items
keys
load
pop
If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem
Remove and return a (key, value) pair as a 2-tuple.
setdefault
Insert key with a value of default if key is not in the dictionary.
to_dict
update
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values
- __init__(*args, **kwargs)¶
Attributes
ENABLE_ALL_FUNCTIONS
- class default_after_treatment_warm_up_duration[source]¶
- duration = 60¶
After treatment warm up duration for conventional vehicles [s].
- class default_after_treatment_cooling_duration[source]¶
- duration = inf¶
After treatment cooling duration for conventional vehicles [s].
- class parse_solution[source]¶
- CALIBRATION_AS_TARGETS = False¶
Use all calibration outputs as relative prediction targets.
- class select_best_model[source]¶
- MAP = {None: {'wltp_h': ('nedc_h', 'wltp_h'), 'wltp_l': ('nedc_l', 'wltp_l'), 'wltp_m': ('wltp_m',)}}¶
Model selector mapping.
- class calculate_drive_battery_n_parallel_cells_v1[source]¶
- reference_volt = {'Li-FP (Li-Fe-P)': 2.4, 'Li-MO (Li-Mn)': 2.9, 'Li-NCA (Li-Ni-Co-Al)': 2.9, 'Li-NCM (Li-Ni-Mn-Co)': 2.9, 'Li-TO (Li-Ti)': 1.7, 'NiMH': 1.1, 'unknown': 2.9}¶
Voltage for calculating the number of parallel battery cells [V].
- class identify_after_treatment_warm_up_phases[source]¶
- cooling_time = 400¶
After treatment cooling time [s].
- class define_service_battery_electric_powers_supply_threshold[source]¶
- min_soc = 0.1¶
Minimum SOC variation to define service battery charging status [%].
- min_current = -1.0¶
Maximum allowed negative current for the service battery being considered not charging [A].
- class default_final_drive_efficiency[source]¶
- formula = '1 - (n_wheel_drive - 2) / 100'¶
Formula for the default final drive efficiency [function].
- class predict_clutch_tc_speeds_delta[source]¶
- ENABLE = False¶
Enable prediction of clutch or torque converter speeds delta?
- class default_tc_normalized_m1000_curve[source]¶
- curve = {'x': [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.65, 0.7, 0.75, 0.8, 0.87, 0.9, 0.95, 1, 1.1, 1.222, 1.375, 1.571, 1.833, 2.2, 2.5, 3, 3.5, 4, 4.5, 5], 'y': [1, 0.97, 0.93, 0.9, 0.87, 0.83, 0.8, 0.75, 0.7, 0.65, 0.6, 0.55, 0.5, 0.25, 0, -0.099, -0.198, -0.336, -0.535, -0.828, -1.306, -1.781, -2.772, -4.071, -5.746, -7.861, -10.48]}¶
Normalized m1000 curve [-].
- class default_static_friction[source]¶
- coeff = {'new': {'dry': 0.85, 'ice': 0.1, 'puddles': 0.5, 'rainfall': 0.55, 'wet': 0.65}, 'worm': {'dry': 1, 'ice': 0.1, 'puddles': 0.25, 'rainfall': 0.4, 'wet': 0.5}}¶
Static friction coefficient [-].
- class calculate_velocities[source]¶
- dt_window = 5¶
Time window for the moving average of obd velocities [s].
- class calculate_engine_temperature_derivatives[source]¶
- dx = 4¶
Derivative spacing [s].
- order = 7¶
Degree of the smoothing spline [-].
- tw = 20¶
Time window for smoother [s].
- class define_fuel_type_and_is_hybrid[source]¶
- is_hybrid = {1: False, 2: False, 3: False, 4: False, 5: False, 6: False, 7: False, 8: True, 9: False, 10: False, 11: False, 12: False, 13: False, 14: False, 15: True, 16: True, 17: True, 18: True, 19: True, 20: True, 21: True, 22: True, 23: False}¶
Is the vehicle hybrid?
- fuel_type = {1: 'gasoline', 2: 'methanol', 3: 'ethanol', 4: 'diesel', 5: 'LPG', 6: 'NG', 7: 'propane', 8: None, 9: 'gasoline', 10: 'methanol', 11: 'ethanol', 12: 'LPG', 13: 'NG', 14: 'propane', 15: None, 16: 'gasoline', 17: 'gasoline', 18: 'ethanol', 19: 'diesel', 20: None, 21: 'gasoline', 22: None, 23: 'diesel'}¶
The vehicle fuel type.
- class default_start_stop_activation_time[source]¶
- ENABLE = False¶
Enable function?
- threshold = 30¶
Start-stop activation time threshold [s].
- class calculate_last_gear_box_ratio_v1[source]¶
- MAX_RATIO = 2¶
Maximum admissible ratio for the last gear [-].
- MIN_RATIO = 0.2¶
Minimum admissible ratio for the last gear [-].
- DELTA_RATIO = 0.1¶
Delta ratio for calculating the last gear [-].
- class calculate_maximum_velocity[source]¶
- MAX_VEL = 1000¶
Maximum admissible velocity for the vehicle maximum velocity [km/h].
- MIN_VEL = 1¶
Minimum admissible velocity for the vehicle maximum velocity [km/h].
- DELTA_VEL = 1¶
Delta ratio for calculating the vehicle maximum velocity [km/h].
- PREC_FLC = 0.9¶
Full load curve percentage fro calculating the available power [-].
- class MGS[source]¶
- MAX_VEL = 1000¶
Maximum admissible velocity for the vehicle maximum velocity [km/h].
- MIN_VEL = 1¶
Minimum admissible velocity for the vehicle maximum velocity [km/h].
- DELTA_VEL = 0.1¶
Delta ratio for calculating the vehicle maximum velocity [km/h].
- PREC_FLC = 0.9¶
Full load curve percentage fro calculating the available power [-].
- class calculate_maximum_velocity_v2[source]¶
- MAX_VEL = 1000¶
Maximum admissible velocity for the vehicle maximum velocity [km/h].
- MIN_VEL = 1¶
Minimum admissible velocity for the vehicle maximum velocity [km/h].
- DELTA_VEL = 1¶
Delta ratio for calculating the vehicle maximum velocity [km/h].
- class calculate_first_gear_box_ratio[source]¶
- STARTING_SLOPE = 0.5¶
Starting slope [-].
- MAX_TORQUE_PERCENTAGE = 0.95¶
Percentage of maximum engine torque to calculate the first gear [-].
- class design_gear_box_ratios[source]¶
- f_two = [1, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.1, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.2]¶
Two factor to design the gear box ratios [-].
- f_tuning = [1, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.1]¶
Tuning factor to design the gear box ratios [-].
- class calculate_aerodynamic_drag_coefficient_v1[source]¶
- cw = {'bestelwagen': 0.35, 'bus': 0.35, 'cabriolet': 0.28, 'coupé': 0.27, 'hatchback': 0.3, 'mpv': 0.3, 'pick-up': 0.4, 'sedan': 0.27, 'stationwagon': 0.28, 'suv/crossover': 0.35}¶
Aerodynamic drag coefficients function of vehicle body [-].
- class calculate_aerodynamic_drag_coefficient[source]¶
- cw = {'A': 0.34, 'B': 0.31, 'C': 0.29, 'D': 0.3, 'E': 0.3, 'F': 0.28, 'G': 0.29, 'H': 0.29, 'I': 0.32, 'J': 0.38, 'K': 0.38, 'L': 0.32, 'M': 0.32, 'N': 0.38, 'S': 0.29}¶
Aerodynamic drag coefficients function of vehicle category [-].
- class calculate_f2[source]¶
- roof_box = 1.2¶
Deteriorating coefficient of the aerodynamic drag and frontal area due to the roof box [-].
- class calculate_rolling_resistance_coeff[source]¶
- coeff = {'C1': {'A': 0.005900000000000001, 'B': 0.0070999999999999995, 'C': 0.008400000000000001, 'D': 0.009800000000000001, 'E': 0.009800000000000001, 'F': 0.011300000000000001, 'G': 0.0129}, 'C2': {'A': 0.004900000000000001, 'B': 0.0060999999999999995, 'C': 0.0074, 'D': 0.0086, 'E': 0.0086, 'F': 0.0099, 'G': 0.0112}, 'C3': {'A': 0.0035, 'B': 0.0045, 'C': 0.0055, 'D': 0.0065, 'E': 0.0075, 'F': 0.0085, 'G': 0.0085}}¶
Rolling resistance coeff, function of tyre class and category [-]. http://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX: 02009R1222-20120530&from=EN (table A4/1 of eu legislation not world wide)
- class calculate_raw_frontal_area_v1[source]¶
- formulas = {'A': '0.4041 * np.log(vehicle_mass) - 0.338', 'B': '0.4041 * np.log(vehicle_mass) - 0.338', 'C': '0.4041 * np.log(vehicle_mass) - 0.338', 'D': '0.4041 * np.log(vehicle_mass) - 0.338', 'E': '0.4041 * np.log(vehicle_mass) - 0.338', 'F': '0.4041 * np.log(vehicle_mass) - 0.338', 'J': '0.0007 * vehicle_mass + 1.8721', 'M': '0.0007 * vehicle_mass + 1.8721', 'S': '0.4041 * np.log(vehicle_mass) - 0.338'}¶
Frontal area formulas function of vehicle_mass [function].
- class calculate_frontal_area[source]¶
- projection_factor = 0.84¶
Projection factor from the row frontal area (h * w) [-].
- class select_prediction_data[source]¶
- prediction_data = [['calibration', ['angle_slope', 'alternator_nominal_voltage', 'alternator_efficiency', 'battery_capacity', 'cycle_type', 'cycle_name', 'engine_capacity', 'engine_stroke', 'final_drive_efficiency', 'final_drive_ratios', 'frontal_area', 'final_drive_ratio', 'engine_thermostat_temperature', 'aerodynamic_drag_coefficient', 'fuel_type', 'ignition_type', 'gear_box_type', 'engine_max_power', 'engine_speed_at_max_power', 'rolling_resistance_coeff', 'time_cold_hot_transition', 'engine_idle_fuel_consumption', 'engine_type', 'has_start_stop', 'engine_is_turbo', 'engine_fuel_lower_heating_value', 'f0', 'has_energy_recuperation', 'fuel_carbon_content_percentage', 'f1', 'f2', 'full_load_speeds', 'plateau_acceleration', 'full_load_powers', 'fuel_saving_at_strategy', 'stand_still_torque_ratio', 'lockup_speed_ratio', 'change_gear_window_width', 'alternator_start_window_width', 'stop_velocity', 'min_time_engine_on_after_start', 'min_engine_on_speed', 'max_velocity_full_load_correction', 'is_hybrid', 'tyre_code', 'engine_has_cylinder_deactivation', 'active_cylinder_ratios', 'engine_has_variable_valve_actuation', 'has_torque_converter', 'has_gear_box_thermal_management', 'has_lean_burn', 'ki_multiplicative', 'n_wheel_drive', 'ki_additive', 'has_periodically_regenerating_systems', 'n_dyno_axes', 'has_selective_catalytic_reduction', 'start_stop_activation_time', 'has_exhausted_gas_recirculation', 'engine_n_cylinders', 'initial_drive_battery_state_of_charge', 'motor_p0_speed_ratio', 'motor_p1_speed_ratio', 'motor_p2_speed_ratio', 'motor_p2_planetary_speed_ratio', 'motor_p3_front_speed_ratio', 'motor_p3_rear_speed_ratio', 'motor_p4_front_speed_ratio', 'motor_p4_rear_speed_ratio', 'rcb_correction', 'vehicle_mass', 'speed_distance_correction', 'atct_family_correction_factor', 'is_plugin']], ['models', 'all'], ['user', 'all']]¶
WLTP calibration data used to predict.
- class FMEP_egr[source]¶
- egr_fact_map = {('compression', False): 3, ('compression', True): 4, ('positive natural aspiration', False): 2, ('positive turbo', False): 1}¶
Exhausted gas recirculation multiplication factors ids [-].
- class identify_co2_emissions[source]¶
- n_perturbations = 100¶
Number of perturbations to identify the co2_emissions [-].
- enable_first_step = True¶
Enable first step in the co2_params calibration? [-]
- enable_second_step = True¶
Enable second step in the co2_params calibration? [-]
- enable_third_step = False¶
Enable third step co2_params calibration in perturbation loop? [-]
- xatol = 0.0001¶
Absolute error in k_refactor between iterations that is acceptable for convergence in perturbation loop [-].
- class calibrate_co2_params[source]¶
- enable_first_step = False¶
Enable first step in the co2_params calibration? [-]
- enable_second_step = False¶
Enable second step in the co2_params calibration? [-]
- enable_third_step = True¶
Enable third step in the co2_params calibration? [-]
- class BatteryStatusModel[source]¶
- min_delta_time_boundaries = 5¶
Minimum delta time to consider valid a charging state to fit charges boundaries [s].
- min_percentile_bers = 90¶
Minimum acceptance percentile to fit the bers threshold [%].
- min_delta_soc = 8¶
Minimum delta soc to set the charging boundaries [%].
- class default_ki_multiplicative[source]¶
- ki_multiplicative = {False: 1.0, True: 1.05}¶
Multiplicative correction for vehicles with periodically regenerating systems [-].
- class define_fmep_model[source]¶
- acr_full_bmep_curve_percentage = 0.72¶
Percentage of max full bmep curve used as limit in cylinder deactivation strategy [-].
- acr_max_mean_piston_speeds_percentage = 0.45¶
Percentage of max mean piston speeds used as upper limit in cylinder deactivation strategy [-].
- acr_min_mean_piston_speeds_percentage = 1.5¶
Percentage of min mean piston speeds used as lower limit in cylinder deactivation strategy [-].
- lb_full_bmep_curve_percentage = 0.4¶
Percentage of max full bmep curve used as limit in lean burn strategy [-].
- lb_max_mean_piston_speeds_percentage = 0.6¶
Percentage of max mean piston speeds used as limit in lean burn strategy [-].
- egr_full_bmep_curve_percentage = 0.5¶
Percentage of max full bmep curve used as limit in exhausted gas recirculation strategy [-].
- egr_max_mean_piston_speeds_percentage = 0.5¶
Percentage of max mean piston speeds used as limit in exhausted gas recirculation strategy [-].
- class identify_idle_engine_speed_std[source]¶
- MIN_STD = 100.0¶
Min standard deviation value [RPM].
- MAX_STD_PERC = 0.3¶
Max standard deviation percentage of median value [-].
- class StartStopModel[source]¶
- stop_velocity = 2.0¶
Maximum allowed velocity to stop the engine [km/h].
- plateau_acceleration = 0.2777777777777778¶
Minimum acceleration to switch on the engine [m/s2].
- class correct_constant_velocity[source]¶
- CON_VEL_UP_SHIFT = (15.0, 32.0, 50.0, 70.0)¶
Constant velocities to correct the upper limits for NEDC [km/h].
- CON_VEL_DN_SHIFT = (35.0, 50.0)¶
Constant velocities to correct the bottom limits for NEDC[km/h].
- class define_initial_co2_emission_model_params_guess[source]¶
- CO2_PARAMS = {'compression': [('a', {'min': 0.0, 'value': 0.391197}), ('b', {'value': 0.028604}), ('c', {'value': -0.00196}), ('a2', {'max': 0.0, 'value': -0.0012}), ('b2', {'max': 1, 'min': -1, 'value': 0, 'vary': False}), ('l', {'max': 0.0, 'value': -1.55291}), ('l2', {'max': 0.0, 'value': -0.0076}), ('t1', {'max': 8.0, 'min': 0.0, 'value': 3.5}), ('dt', {'min': 0.0, 'value': 1.0}), ('t0', {'expr': 't1 + dt', 'max': 8.0, 'value': 4.5})], 'positive natural aspiration': [('a', {'min': 0.0, 'value': 0.4851}), ('b', {'value': 0.01193}), ('c', {'value': -0.00065}), ('a2', {'max': 0.0, 'value': -0.00385}), ('b2', {'max': 1, 'min': -1, 'value': 0, 'vary': False}), ('l', {'max': 0.0, 'value': -2.39882}), ('l2', {'max': 0.0, 'value': -0.00286}), ('t1', {'max': 8.0, 'min': 0.0, 'value': 3.5}), ('dt', {'min': 0.0, 'value': 1.0}), ('t0', {'expr': 't1 + dt', 'max': 8.0, 'value': 4.5})], 'positive turbo': [('a', {'min': 0.0, 'value': 0.468678}), ('b', {'value': 0.011859}), ('c', {'value': -0.00069}), ('a2', {'max': 0.0, 'value': -0.00266}), ('b2', {'max': 1, 'min': -1, 'value': 0, 'vary': False}), ('l', {'max': 0.0, 'value': -2.14063}), ('l2', {'max': 0.0, 'value': -0.0025}), ('t1', {'max': 8.0, 'min': 0.0, 'value': 3.5}), ('dt', {'min': 0.0, 'value': 1.0}), ('t0', {'expr': 't1 + dt', 'max': 8.0, 'value': 4.5})]}¶
Initial guess CO2 emission model params.
- class default_specific_gear_shifting[source]¶
- SPECIFIC_GEAR_SHIFTING = 'ALL'¶
Specific gear shifting model.
- class default_clutch_k_factor_curve[source]¶
- STAND_STILL_TORQUE_RATIO = 1.0¶
Torque ratio when speed ratio==0 for clutch model.
- LOCKUP_SPEED_RATIO = 0.0¶
Minimum speed ratio where torque ratio==1 for clutch model.
- class default_tc_k_factor_curve[source]¶
- STAND_STILL_TORQUE_RATIO = 1.9¶
Torque ratio when speed ratio==0 for torque converter model.
- LOCKUP_SPEED_RATIO = 0.87¶
Minimum speed ratio where torque ratio==1 for torque converter model.
- class select_default_n_dyno_axes[source]¶
- DYNO_AXES = {'NEDC': {2: 1, 4: 1}, 'WLTP': {2: 1, 4: 2}}¶
Number of dyno axes [-].
- class select_phases_integration_times[source]¶
- INTEGRATION_TIMES = {'NEDC': (0.0, 780.0, 1180.0), 'WLTP': (0.0, 590.0, 1023.0, 1478.0, 1800.0)}¶
Cycle phases integration times [s].
- class get_gear_box_efficiency_constants[source]¶
- PARAMS = {False: {'gbp00': {'m': 0.0043233434399999994, 'q': {'cold': 0.695884329, 'hot': 0.29823614099999995}}, 'gbp01': {'q': {'cold': 0.9793688500000001, 'hot': 0.9895177500000001}}, 'gbp10': {'m': 2.4525999999999996e-06, 'q': {'cold': 0.00012958919999999998, 'hot': 5.15957e-05}}}, True: {'gbp00': {'m': 0.0043233434399999994, 'q': {'cold': 0.695884329, 'hot': 0.29823614099999995}}, 'gbp01': {'q': {'cold': 0.96921995, 'hot': 0.9793688500000001}}, 'gbp10': {'m': 2.4525999999999996e-06, 'q': {'cold': 0.0005171569, 'hot': 0.0001547871}}}}¶
Vehicle gear box efficiency constants (gbp00, gbp10, and gbp01).
- class calculate_engine_mass[source]¶
- PARAMS = {'mass_coeff': {'compression': 1.1, 'positive': 1.0}, 'mass_reg_coeff': (0.4208, 60)}¶
Equivalent gear box heat capacity parameters.
- class calculate_engine_heat_capacity[source]¶
- PARAMS = {'heat_capacity': {'body': 460.0, 'coolant': 3558.1, 'crankcase': 460.0, 'crankshaft': 490.0, 'cyl_head': 910.0, 'oil': 2090.0, 'pistons': 910.0}, 'heated_mass_percentage': {'body': 0.1, 'coolant': 0.04, 'crankcase': 0.18, 'crankshaft': 0.08, 'cyl_head': 0.09, 'oil': 0.055, 'pistons': 0.025}}¶
Equivalent gear box heat capacity parameters.
- class calculate_equivalent_gear_box_heat_capacity[source]¶
- PARAMS = {'gear_box_mass_engine_ratio': 0.25, 'heat_capacity': {'oil': 2090.0}, 'thermal_management_factor': 0.5}¶
Equivalent gear box heat capacity parameters.
- class default_full_load_speeds_and_powers[source]¶
- FULL_LOAD = {'compression': ([0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2], [0.1, 0.278071182, 0.427366185, 0.572340499, 0.683251935, 0.772776746, 0.846217049, 0.906754984, 0.94977083, 0.981937981, 1, 0.937598144, 0.85]), 'positive': ([0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2], [0.1, 0.198238659, 0.30313392, 0.410104642, 0.516920841, 0.621300767, 0.723313491, 0.820780368, 0.901750158, 0.962968496, 0.995867804, 0.953356174, 0.85])}¶
Vehicle normalized full load curve.
- class calculate_engine_max_torque[source]¶
- PARAMS = {'compression': 1.1, 'positive': 1.25}¶
Engine nominal torque params.
- class calculate_engine_moment_inertia[source]¶
- PARAMS = {'compression': 2, 'positive': 1}¶
Engine moment of inertia params.
- class default_fuel_density[source]¶
- FUEL_DENSITY = {'LPG': 699.6521739130435, 'NG': 713.6141906873614, 'biodiesel': 890.0, 'diesel': 832.0, 'ethanol': 794.0, 'gasoline': 745.0, 'methanol': 791.0, 'propane': 510.0}¶
Fuel density [g/l].