Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Handling Trace Miss

Trace miss occurs when a vehicle cannot achieve the prescribed speed of the drive cycle. For vehicles, this may be due to high vehicle mass, sluggish acceleration limits, etc. For cycles, this may be due to unrealistically aggressive jumps in speed or road grade.

Trace miss handling and tolerances are configured by setting simulation parameters. For detailed information, see Editing Simulation Parameters.

Building a Challenging Cycle

This cycle has a sharp acceleration from 0 to 8 m/s (~18 mph) in just one second, which a typical vehicle cannot fully achieve:

Trace Miss Options

TraceMissOptions controls what happens when the vehicle cannot match the target speed. The default is "Error" (raise an exception), but four options are available:

OptionBehavior
"Error"(default) Throw an error when trace miss occurs
"Allow"Silently allow trace miss without correction or validation
"AllowChecked"Allow trace miss only if it stays within specified tolerances
"Correct"Correct the trace by adjusting the driver model to catch up with the cycle

Option 1: Error (default)

Expected error: RuntimeError
Message (truncated): solver step failed at line [fastsim-core/src/simdrive/mod.rs:325]
time step: 1
 with originating err...

Option 2: Allow

Simulation completed without error. 9 time steps recorded.

Option 3: AllowChecked

The "AllowChecked" option allows trace miss only if it stays within specified tolerances. This provides a middle ground between permissive and strict behavior.

Simulation with AllowChecked completed. 9 time steps recorded.

Option 4: Correct

The "Correct" option uses a driver model to adjust the acceleration/deceleration and catch back up to the cycle target. The trace_miss_correct_max_steps parameter controls the maximum number of steps to re-rendezvous.

Simulation with correction completed. 9 time steps recorded.

Comparing Results

Compare the target cycle against the achieved speed with each option:

Loading...

Why does the trace miss correction option overshoot the prescribed speed? Let’s evaluate the achieved simulation distance to find out:

Loading...

Here we can see that only the trace miss correction simulation makes up for the missed distance in the cycle, whereas the others fall short.

Prescribed cycle distance:          44.0 m
Achieved cycle distance:
  trace_miss_opts = 'Allow':        38.5 m
  trace_miss_opts = 'AllowChecked': 38.5 m
  trace_miss_opts = 'Correct':      44.0 m

Summary

  • “Error” (default): Raises an exception if trace miss occurs. Forces you to acknowledge the issue and choose a resolution strategy.

  • “Allow”: Permits the vehicle to fall behind without correction. Useful for exploratory analyses but may produce unrealistic behavior.

  • “AllowChecked”: Allows trace miss but validates it against specified tolerances (distance and speed). Provides a middle ground between permissive and strict.

  • “Correct”: Adjusts the driver model to catch back up to the target cycle.

For most use cases, “Correct” is the recommended choice when trace miss is expected, as it ensures the vehicle re-synchronizes with the target cycle while maintaining realistic dynamics.