Skip to content

Start Stop Model

stefanosts edited this page Aug 6, 2016 · 1 revision

Inputs

Name Units Source / Comments Parameter
Start Stop Technology - Input has_start_stop
Start Stop Activation Time sec Parametric Calculated Input start_stop_activation_time
Velocity Profile km/hr, sec Input velocities, times
Acceleration m/sec2 Calculated by Vehicle Model accelerations
Gear-shifting - Calculated by Gearbox Model gears
Gearbox Type - Input gear_box_type

Outputs

  • Engine Status [-] / on_engine
  • Engine Starts [-] / engine_starts

Source Code

def define_start_stop_model_parametric(
        has_start_stop, start_stop_activation_time):

    sst = start_stop_activation_time

    def model(times, velocities, accelerations):
        status = np.ones(shape=times.shape, dtype=int)
        
        b = (velocities < VEL_EPS) & (abs(accelerations) < ACC_EPS)
        b &= (times > sst)

        if has_start_stop: status[b] = 0
            
        return status

    return model

def predict_on_engine_parametric(model, times, velocities, 
                      accelerations, gears, gear_box_type):

    on_engine = model(times, velocities, accelerations)
    on_engine = np.array(on_engine, dtype=int)

    if gear_box_type == 'manual':
        on_engine[gears > 0] = 1

    on_engine = clear_fluctuations(times, on_engine, TIME_WINDOW)

    return np.array(on_engine, dtype=bool)

def identify_engine_starts(on_engine):
    return np.append(np.diff(np.array(on_engine, dtype=int)) > 0, False)