Main Content

Vehicle Lateral Acceleration at Different Speeds

R2026b

This example shows how to sweep vehicle speed in the constant radius reference application and analyze the resulting lateral acceleration. The maneuver follows standards SAE J266_199601 and ISO 4138:2012.

During the maneuver, the vehicle uses a predictive driver model to maintain a pre-specified turn radius at a set velocity.

For more information about the reference application, see Constant Radius Maneuver.

vdynblksConstRadiusStart;

Run a Constant Radius Maneuver

1. Open the Reference Generator block. By default, the maneuver is set with these parameters:

  • Maneuver — Constant radius

  • Use maneuver-specific driver, initial position, and scene — on

  • Longitudinal velocity reference — 35 mph

  • Radius value — 100 m

2. Select the Reference Generator block 3D Engine tab. By default, the 3D Engine parameter is Disabled. Simulating models in the 3D visualization environment requires Simulink® 3D Animation™. For the 3D visualization engine platform requirements and hardware recommendations, see the Unreal Engine Simulation Environment Requirements and Limitations.

3. Run the maneuver with the default settings. As the simulation runs, view the vehicle information.

mdl = 'CRReferenceApplication';
sim(mdl);
### Searching for referenced models in model 'CRReferenceApplication'.
### Total of 3 models to build.
### Starting serial model build.
### Starting model reference simulation target build for: Driveline
### Successfully updated the model reference simulation target for: Driveline
### Starting model reference simulation target build for: PassVeh14DOF
### Successfully updated the model reference simulation target for: PassVeh14DOF
### Starting model reference simulation target build for: SiMappedEngineV
### Successfully updated the model reference simulation target for: SiMappedEngineV

Build Summary

Model reference simulation targets:

Model            Build Reason                                        Status                        Build Duration
=================================================================================================================
Driveline        Target (Driveline_msf.mexw64) did not exist.        Code generated and compiled.  0h 0m 32.251s
PassVeh14DOF     Target (PassVeh14DOF_msf.mexw64) did not exist.     Code generated and compiled.  0h 2m 28.426s
SiMappedEngineV  Target (SiMappedEngineV_msf.mexw64) did not exist.  Code generated and compiled.  0h 0m 19.076s

3 of 3 models built (0 models already up to date)
Build duration: 0h 3m 46.492s

  • The Vehicle Position window displays the vehicle path (longitudinal distance versus lateral distance). The plot also shows the yaw rate and steering angle.

  • In the Visualization subsystem, open the Steer, Velocity, Lat Accel Scope block to display the steering angle, velocity, and lateral acceleration versus time.

Sweep Vehicle Speed

Run the constant radius reference application with three different speeds. Stop the simulation if the vehicle exceeds a lateral acceleration threshold of 0.5 g.

1. In the constant radius reference application model CRReferenceApplication, open the Reference Generator block. The Longitudinal speed set point, xdot_r block parameter sets the vehicle speed. By default, the speed is 35 mph.

2. Enable signal logging for the velocity, lane, and ISO signals. You can use the Simulink® editor or, alternatively, these MATLAB® commands. Save the model.

  • Select the Reference Generator block Stop simulation at lateral acceleration threshold parameter.

set_param([mdl '/Reference Generator'],'cr_ay_stop','on');
  • Enable signal logging for the Reference Generator Vis signal output port.

ph=get_param([mdl '/Reference Generator'],'PortHandles');
set_param(ph.Outport(1),'DataLogging','on');
  • Enable signal logging for the Passenger Vehicle block output port signal.

ph=get_param([mdl '/Passenger Vehicle'],'PortHandles');
set_param(ph.Outport(1),'DataLogging','on');
  • In the Visualization subsystem, enable signal logging for the ISO block.

set_param([mdl '/Visualization/ISO 15037-1:2006'],'Measurement','Enable');

3. Define the speed set points to sweep. This example uses 32, 35, and 38 mph.

vmax = [32, 35, 38];
numExperiments = length(vmax);

4. Create an array of simulation inputs that set the Reference Generator block parameter Longitudinal velocity reference, xdot_r equal to vmax.

for idx = numExperiments:-1:1
    in(idx) = Simulink.SimulationInput(mdl);
    in(idx) = in(idx).setBlockParameter([mdl '/Reference Generator'], ...
        'xdot_r', num2str(vmax(idx)));
end

5. Save the model and run the simulations.

save_system(mdl)
simout = parsim(in,'ShowSimulationManager','on');
[19-Jun-2026 21:45:09] Checking for availability of parallel pool...
Starting parallel pool (parpool) using the 'Processes' profile ...
19-Jun-2026 21:46:12: Job Running. Waiting for parallel pool workers to connect ...
19-Jun-2026 21:47:12: Job Running. Waiting for parallel pool workers to connect ...
Connected to parallel pool with 10 workers.
[19-Jun-2026 21:47:47] Starting Simulink on parallel workers...
[19-Jun-2026 21:48:17] Loading project on parallel workers...
[19-Jun-2026 21:48:18] Configuring simulation cache folder on parallel workers...
[19-Jun-2026 21:48:36] Loading model on parallel workers...
[19-Jun-2026 21:50:00] Running simulations...
[19-Jun-2026 21:52:48] Completed 1 of 3 simulation runs
[19-Jun-2026 21:52:49] Received simulation output (size: 22.48 MB) for run 1 from parallel worker.
[19-Jun-2026 21:52:49] Completed 2 of 3 simulation runs
[19-Jun-2026 21:52:49] Received simulation output (size: 22.62 MB) for run 3 from parallel worker.
[19-Jun-2026 21:52:50] Completed 3 of 3 simulation runs
[19-Jun-2026 21:52:50] Received simulation output (size: 22.61 MB) for run 2 from parallel worker.
[19-Jun-2026 21:52:50] Cleaning up parallel workers...

Use Simulation Data Inspector to Analyze Results

Use the Simulation Data Inspector to examine the results. You can use the UI or, alternatively, command-line functions.

1. Open the Simulation Data Inspector. On the Simulink Toolstrip, on the Simulation tab, under Review Results, click Data Inspector.

  • In the Simulation Data Inspector, select Import.

  • In the Import dialog box, clear logsout. Select simout(1), simout(2), and simout(3). Select Import.

  • Use the Simulation Data Inspector to examine the results.

Use MATLAB commands to create SDI run objects, extract the longitudinal velocity, lateral acceleration, and steering wheel angle signals, and plot them. Assign distinct colors (green, blue, magenta) to distinguish the three speed conditions.

sigcolor=[0 1 0;0 0 1;1 0 1];
for idx = 1:numExperiments
    simoutRun(idx)=Simulink.sdi.Run.create;
    simoutRun(idx).Name=['Velocity = ', num2str(vmax(idx))];
    add(simoutRun(idx),'vars',simout(idx));
    msignal(idx)=getSignalsByName(simoutRun(idx), 'xdot_mph');
    msignal(idx).LineColor =sigcolor((idx),:);
    ssignal(idx)=getSignalsByName(simoutRun(idx), 'SteerAngle');
    ssignal(idx).LineColor =sigcolor((idx),:);
    asignal(idx)=getSignalsByName(simoutRun(idx), 'ay');
    asignal(idx).LineColor =sigcolor((idx),:);
end
Simulink.sdi.view
Simulink.sdi.setSubPlotLayout(3,1);
for idx = 1:numExperiments
    plotOnSubPlot(msignal(idx),1,1,true);
    plotOnSubPlot(ssignal(idx),2,1,true);
    plotOnSubPlot(asignal(idx),3,1,true);
end

The results are similar to these plots, which indicate that the greatest lateral acceleration occurs when the vehicle velocity is 38 mph.

Further Analysis

To understand the relationship between steering input and lateral response at each speed, extract the steering angle and lateral acceleration from the simulation output and compute the lateral acceleration gain.

Extract the lateral acceleration and steering angle. Plot the data. The results are similar to this plot.

figure
for idx = 1:numExperiments
    log = get(simout(idx),'logsout');
    sa=log.get('SteerAngle').Values;
    ay=log.get('<ay>').Values;
    firstorderfit = polyfit(sa.Data,ay.Data,1);
    gain(idx)=firstorderfit(1);
    legend_labels{idx} = [num2str(vmax(idx)), ' mph: Gain = ', ...
        num2str(gain(idx)), ' m/(deg s^2)'];
    plot(sa.Data,ay.Data)
    hold on
end
legend(legend_labels, 'Location', 'best');
title('Lateral Acceleration')
xlabel('Steering Angle [deg]')
ylabel('Acceleration [m/s^2]')
grid on

To verify that the vehicle maintains the intended 100 m radius at each speed, plot the X-Y vehicle trajectory. The results are similar to this plot.

figure
for idx = 1:numExperiments
    xValues = getSignalsByName(simoutRun(idx), 'Passenger Vehicle:1.Body.InertFrm.Cg.Disp.X').Values;
    yValues = getSignalsByName(simoutRun(idx), 'Passenger Vehicle:1.Body.InertFrm.Cg.Disp.Y').Values;
    x = xValues.Data;
    y = yValues.Data;
    legend_labels{idx} = [num2str(vmax(idx)), ' mph'];
    axis('equal')
    plot(y,x)
    hold on
end
legend(legend_labels, 'Location', 'best');
title('Vehicle Path')
xlabel('Y Position [m]')
ylabel('X Position [m]')
grid on

References

[1] J266_199601. Steady-State Directional Control Test Procedures for Passenger Cars and Light Trucks. Warrendale, PA: SAE International, 1996.

[2] ISO 4138:2012. Passenger cars -- Steady-state circular driving behaviour -- Open-loop test methods. ISO (International Organization for Standardization), 2012.

See Also

| |

Topics