Introduction¶
The aim of the Gearshift tool is obtain the Required Engine Speeds, the Available Powers, the Required Vehicle Speeds and the Gears for the whole WLTC based on the vehicle characteristics. The model should allow accurate calculation of final trace and the operating conditions of the engine.
Overview¶
The calculator accepts as input an excel file that contains the vehicle’s technical data, along with parameters for modifying the execution WLTC cycle, and it then spits-out the gear-shifts of the vehicle and the others parameters used during the obtaining of these. It does not calculate any CO2 emissions.
Input File¶
The input file of the GEARSHIFT tool is an excel file, structured in different sheets.
Case sheet: The case sheet contains a list of cases that the tool will run.
Vehicle sheet: The vehicle sheet contains a list of vehicles along with their characteristics.
Engine sheet: The engine sheet contains the vehicle’s full load curves.
Gearbox Ratios sheet: The gearbox ratios sheet contains the gearbox transmission ratios.
Quick-Start¶
Cmd-line usage¶
The command-line usage below requires the Python environment to be installed, and provides for
executing an experiment directly from the OS’s shell (i.e. cmd
in windows or bash
in POSIX),
and in a single command. To have precise control over the inputs and outputs
$ gearshift --help ## to get generic help for cmd-line syntax
$ gearshift demo ## to get demo input file
$ gearshift run "path_input_file" -O "path_to_save_output_file" ## to run gearshift tool
Usage¶
In this example we will use gearshift model in order to predict the gears.
Setup¶
Import dispatcher(dsp) from gearshift tool that contains functions and simulation model to process vehicle data and Import also schedula for selecting and executing functions. for more information on how to use schedula
from gearshift.core import dsp
import schedula as sh
Load data¶
Load vehicle data for a specific vehicle from excel template
vehData = 'gs_input_demo.xlsx'
Define the input dictionary for the dispacher.
input = dict(input_file_name=vehData)
Dispatcher¶
Dispatcher will select and execute the proper functions for the given inputs and the requested outputs
core = dsp(input, outputs=['sol'], shrink=True)
Plot workflow of the core model from the dispatcher
core.plot()
This will automatically open an internet browser and show the work flow of the core model as below. You can click all the rectangular boxes to see in detail sub models like load, model, write and plot.
The load module
Load outputs of dispatcher Select the chosen dictionary key (sol) from the given dictionary.
solution = sh.selector(['sol'], sh.selector(['sol'], core))
Select each output case
# Select first case solution['sol'][0] # Select second case case solution['sol'][1] # Select gears output for different cases gears = {} for sol in solution['sol']: gears[f'gears_{sol["Case"]}'] = sol['GearsOutput']