# Generate Drive Cycles for Real Driving Emissions

Real Driving Emissions (RDE) is an emissions standard required by the European Union. To meet this standard, a car is driven on public roads and over a wide range of different conditions. Specific equipment installed on the vehicle, the Portable Emission Measuring System (PEMS), collects data to verify that legislative caps for pollutants such as NOx are not exceeded.

This example shows how to generate an RDE-compliant trip.

### RDE trip parameters

Instantiate an RDE object

`DriveCycles = RDE.DriveCycles; % create RDE object`

Sampling interval [s]

`DriveCycles.dt = 1; % sampling interval [s]`

Velocity threshold for stop condition [m/s]

`DriveCycles.StopSpeedTh = 1/3.6; % stop velocity threshold [m/s]`

#### RDE Trip Specifications

RDE trips cover three types of operation: urban, rural, and motorway. All datasets with v ≤ 60 km/h belong to the ‘urban’ speed bin, all datasets with 60 km/h < v ≤ 90 km/h belong to the ‘rural’ speed bin and all datasets with v > 90 km/h belong to the ‘motorway’ speed bin. These classifications are based purely on speed. The urban/rural/motorway mix, based on the speed definition, should be evenly distributed for each category within a 10% tolerance. The table shows the distance and speed specifications for each urban, rural, and motorway part of the RDE test.

#### Boundary Conditions for the RDE Tests

In addition to specifying the trip characterization, other defined boundary conditions include ambient conditions, stop times, maximum speed, and altitude. A set of additional dynamic boundary conditions has been added for the second RDE legislative package to exclude driving that could be regarded as too smooth or too aggressive, based on indicators such as speed and acceleration. The table shows the dynamic boundary conditions for the RDE tests.

*NOTE: The present RDE package does not generate altitude or temperature data.*

#### RDE Parameters

Urban/rural/motorway velocity range [m/s]

*Parameter defined in the RDE legislation at chapter: 6.3.1, 6.4.1, 6.4.2, 6.5.1*

`DriveCycles.OperationModeBoundaries = [60 90]/3.6; % Boundaries between urban, rural, motorway [m/s]`

Allowed distance normalized percentage for the urban part of the trip

*Parameter defined in the RDE legislation at chapter: 6.6.1*

`DriveCycles.UrbanRatioRange = [0.29 0.44]; % Allowed distance normalized percentage for the urban part of the trip []`

Allowed distance normalized percentage for the rural part of the trip

*Parameter defined in the RDE legislation at chapter: 6.6.2*

`DriveCycles.RuralRatioRange = [0.23 0.43]; % Allowed distance normalized percentage for the rural part of the trip []`

Allowed distance normalized percentage for the motorway part of the trip

*Parameter defined in the RDE legislation at chapter: 6.6.3*

`DriveCycles.MotorwayRatioRange = [0.23 0.43]; % Allowed distance normalized percentage for the motorway part of the trip []`

*Parameters defined in the RDE legislation at chapter: 6.7.1*

Usual max velocity [m/s] (can be occasionally higher, for overpassing, etc.)

`DriveCycles.MotorwayUsualMaxSpeed = 145/3.6; % Usual max velocity [m/s] (can be occasionally higher, for overpassing, etc.)`

Time ratio limit for higher velocities

`DriveCycles.MotorwayAbsoluteSpeedTimeRatio = 0.03; % Time ratio limit for higher velocities []`

Absolute max velocity [m/s] (cannot be higher than this)

`DriveCycles.MotorwayAbsoluteMaxSpeed = 160/3.6; % Absolute max velocity [m/s] (cannot be higher than this)`

Urban allowed speed range.

*Parameter defined in the RDE legislation at chapter: 6.8.1*

`DriveCycles.UrbanAverageSpeedRange = [15 40]/3.6; % urban allowed speed range [m/s]`

Urban stop normalized percentage range.

*Parameter defined in the RDE legislation at chapter: 6.8.2*

`DriveCycles.UrbanStopRatioRange = [0.06 0.3]; % Urban stop normalized percentage range []`

Urban min stop time and number of stop events.

*Parameter defined in the RDE legislation at chapter: 6.8.3*

DriveCycles.UrbanMinStopTime = 10; % Urban min stop time [s] DriveCycles.UrbanMinStopCount = 2; % Urban min stop occurrences []

Motorway min velocity and time allowed for min velocity.

*Parameter defined in the RDE legislation at chapter: 6.9.1*

DriveCycles.MotorwayUsualMinSpeed = 100/3.6; % Motorway min velocity [m/s] DriveCycles.MotorwayUsualMinSpeedTime = 5*60; % Time allowed for min velocity [s]

Range for RDE trip duration

*Parameter defined in the RDE legislation at chapter: 6.10.1*

`DriveCycles.TripDurationRange = [90 120]*60; % Allowed total trip duration range [s]`

Min distance for urban, rural, and motorway parts

*Parameters defined in the RDE legislation at chapter: 6.12*

DriveCycles.UrbanMinDistance = 16000; % Min distance for urban part [m] DriveCycles.RuralMinDistance = 16000; % Min distance for rural part [m] DriveCycles.MotorwayMinDistance = 16000; % Min distance for motorway part [m]

Rural and motorway average speed range

DriveCycles.RuralAverageSpeedRange = [60 90]/3.6; % Rural average speed range [m/s] DriveCycles.MotorwayAverageSpeedRange = [90 145]/3.6; % Motorway average speed range [m/s]

#### Dynamic Boundary Conditions Used by the Relative Positive Acceleration (RPA) and VA95

These conditions are defined in order to exclude driving that could be regarded as too smooth or too aggressive, based on indicators such as speed and acceleration.

To be valid, each urban, rural, and motorway section of an RDE trip must be below the VA95 constraint line and above the RPA constraint line.

The constraints are defined as below

RPA has units m/s^2 or kWs/(kg*km) and positive acceleration means values greater than 0.1 m/s^2.

VA95 is the 95th percentile of the product of vehicle speed per positive acceleration greater than 0.1 m/s^2 and has units of m^2/s^3 or W/kg, similar to a power to mass ratio.

#### Parameters for VA95 indicator verification (used in calcVa95Boundary)

Parameters defined in the RDE legislation at section 4.1.1 (VERIFICATION OF TRIP VALIDITY)

DriveCycles.VA95VelocityThreshold = 74.6/3.6; % m/s DriveCycles.VA95BoundarySpeedCoeff1 = 0.136; % units equivalent to m/s^2 DriveCycles.VA95BoundaryBias1 = 14.44; %W/kg DriveCycles.VA95BoundarySpeedCoeff2 = 0.0742; % units equivalent to m/s^2 DriveCycles.VA95BoundaryBias2 = 18.966; % W/kg

#### Parameters for RPA verification (used in calcRpaBoundary)

Parameters defined in the RDE legislation at section 4.1.2 (VERIFICATION OF TRIP VALIDITY)

DriveCycles.RPAVelocityThreshold = 94.05/3.6; % m/s DriveCycles.RPABoundarySpeedCoeff = -0.0016; % units equivalent to 1/s DriveCycles.RPABoundaryBias = 0.1755; % m/s^2 DriveCycles.RPALowerBound = 0.025; % m/s^2

#### RDE generator parameters

DriveCycles.ShapeParameter = 1; % Velocity generator uses the gamma PDF and this is the PDF's tuning parameter DriveCycles.SmoothingMethod = 'loess'; % velocity using MATLAB smooth function DriveCycles.SmoothingWindowLength = 5; % window length

Number of RDE trips to be generated

`DriveCycles.NTrips = 4; % number of RDE trips`

Number of tries to generate a valid RDE trip

`DriveCycles.NumberOfIterations = 10000; % iteration find valid trip limit`

Output folder for RDE data

DriveCycles.OutputFolder = fullfile(pwd(), 'results'); % output folder location

### Generate RDE trips

This will also save the timeseries data as separate CSV files.

`DriveCycles.generateDriveCycles(); % generated the results `

RDE compliant drive cycle successfully generated in 81 iterations RDE compliant drive cycle successfully generated in 92 iterations RDE compliant drive cycle successfully generated in 33 iterations RDE compliant drive cycle successfully generated in 120 iterations

To view and check the drive cycle files, open them using an application available on your platform. For example, on the Windows® platform, use the command `winopen("./results/drive_cycle_1.csv")`

.

### Plot the generated RDE trips

`DriveCycles.plotDriveCycles % plot the results `

### References

The RDE legislation has been divided into four legislative packages, covering various areas such as specifications for measurement equipment, trip definitions, and boundary conditions.

**RDE legislative packages:**

#### RDE package 1

Basic features of the RDE test, such as characterization of the RDE trip, the vehicle family concept, description of the data evaluation tools, technical requirement of the PEMS equipment, and reporting obligations.

Official Journal of the European Union, L 82, 31 March 2016. 2016/427

#### RDE package 2

Determination of the conformity factors and the timetable for RDE implementation. Technical features include the introduction of dynamic boundary conditions and a limit for altitude gain together with a detailed approach to calculating it.

Official Journal of the European Union, L 109, 26 April 2016. 2016/646

#### RDE package 3

Particulate number measurement along, provisions for hybrids, and a procedure to include cold starts and regeneration events in the RDE test.

Official Journal of the European Union, L 175, 7 July 2017. 2017/1151

**RDE package 4**

In service compliance and surveillance tests along with specific provisions for light commercial vehicles (vans)

Official Journal of the European Union, L 301, 27 November 2018. 2018/1832