Resolve Partitioning Solver Simulation Issues for Simscape Driveline Models

The Partitioning solver is a Simscape™ fixed-step, local solver that improves performance for certain models. However, when using the Partitioning solver, some Simscape Driveline™ models generate warnings, stop and generate errors, fail to initialize, or yield signal chatter due to numerical difficulties. These examples show how to eliminate errors, mitigate warnings, and reduce chatter by resolving numerical difficulties.

Resolving Issues for Blocks with Stiffness or Friction

Numerical difficulties that prevent models from simulating to completion, yield warnings, or introduce chatter are typically related to blocks that have high stiffness or friction. Simscape Driveline blocks with high stiffness or friction include clutches, belt pulleys, tires, and flexible shafts.

To resolve numerical difficulties in models that contain these blocks, use one or more of the methods:

  • Adjust the solver settings.

  • Remove high-priority variable redundancies.

  • Unlock clutch initial conditions.

  • Loosen friction-related tolerances.

  • Eliminate high-stiffness blocks.

  • Eliminate degrees of freedom.

Using the Partitioning Solver

When simulating models using the Partitioning solver:

  1. Simulate the model by using a global variable-step solver to capture baseline results that agree with your mathematical model or empirical data.

  2. Configure the local solver for a Partitioning solver simulation.

  3. Run the Partitioning solver simulation. If the simulation:

    • Runs to completion — Compare the Partitioning solver simulation results to the baseline results. If the results do not agree, adjust the solver settings or model components and simulate again. For example, decrease the step size or simplify model dynamics. For more information, see Reduce Numerical Stiffness, Choose Step Size and Number of Iterations, and Reduce Fast Dynamics.

      Repeat until the simulation returns results that agree with the baseline results.

    • Fails to simulate to completion due to numerical issues — Resolve the issues by applying one or more of the methods listed in Resolving Issues for Blocks with Stiffness or Friction. Rerun the simulation. Repeat until the simulation runs to completion, then compare the results to the baseline results. If the results do not agree, adjust the solver settings or model components and rerun the simulation. Repeat until the Partitioning solver simulation returns results that agree with the baseline results.

Resolve Initial Condition Errors and Warnings

This example shows how to resolve numerical difficulties that generate initial condition errors and warnings. When an initial condition issue prevents a simulation from initiating or running to completion, MATLAB® stops the simulation and generates an error. When a simulation is unable to satisfy high-priority targets, the simulation continues to run, but MATLAB generates a warning.

  1. Open the model. At the MATLAB command prompt, enter:

    %% Open the Model
    model = 'sdl_transmission_helicopter_base';
    open_system(model)
    

    The model window indicates that the Simulink® global solver is a variable-step solver.

  2. To examine the Simscape local solver configuration, open the Solver Configuration block settings.

     See Code

    The model is configured to simulate using the Simulink global solver because the Use local solver check box is cleared.

  3. Simulate the model and then, to examine the baseline results from the variable-step simulation, open the Scope block.

     See Code

  4. Configure the model for a Partitioning solver simulation. In the Solver Configuration block settings, select the Use local solver check box.

     See Code

    When you select the Use local solver check box, related parameters are enabled. By default, the parameters in the Solver Configuration block are set to:

    1. Solver typePartitioning

    2. Sample time0.05

    3. Partition methodRobust simulation

    4. Partition storage methodExhaustive

    5. Use fixed-cost runtime consistency iterations — Selected

    6. Nonlinear iterations3

  5. Simulate the model.

     See Code

    Warning: Simscape succeeded in finding consistent states with which to start the simulation, 
    but the states found may deviate from requested initial conditions.
    

    The simulation runs to completion, but it generates a warning. The results agree with the baseline results in terms of the significant characteristics for the model (such as the slopes, magnitudes, and inflection points).

  6. The warning is caused by initial condition issues. Investigate the issues by examining the variables in the model. To open the Variable Viewer, in the model window, on the Debug tab, click Simscape > Variable Viewer. To filter for variables that have targets that the simulation is unable to satisfy, click the arrow to the right of the Status column header, and in the drop-down list, clear the OK check box.

    There are several variables that have High priority targets that the simulation is unable to satisfy.

  7. Eliminate the warning by unlocking the initial state of the clutch. Open the Unidirectional Clutch block and set the Initial state parameter to Unlocked. Then simulate the model, examine the variables, and view the results.

     See Code

    The initial condition warning is not generated and the Variable Viewer reports that all targets are satisfied. The results agree with the baseline results in terms of the significant characteristics for the model.

Resolve Chatter Due to Stiffness

This example also shows how to resolve numerical difficulties that yield chatter in Simscape Driveline simulations that use the Partitioning solver. In this case, the chatter is caused by stiffness. A stiff model is one that contains both fast and slow dynamics.

  1. Open the model with block. At the MATLAB command prompt, enter:

    %% Open the Model
    model = 'sdl_vehicle_dual_clutch';
    open_system(model)
    

    The model is configured for a variable-step simulation that uses the global solver. Data logging is enabled only for the signal that contains the gear state data.

  2. Configure the model for data logging. For this example, tire slip is the data of interest and logging additional data increases the computational cost of simulation. Enable data logging for tire slip and disable data logging for the gear state.

    1. In the Vehicle subsystem, the Tire LF Tire (Magic Formula) block represents the left-front tire of the vehicle. The Tire LF S port, which transmits the tire slip data, is a physical signal port. You can log physical signal data using Simulink data logging. The destination for the signal is the Tire slip Scope block, which is in the Scopes subsystem.

      1. Open the Scopes subsystem.

      2. The tire slip data is in the signal that the FrontSlip From block transmits to the Tire slip Scope block. Select the signal, and in the Simulink toolstrip, on the Signal tab, click the arrow on the right side of the Monitor section. In the Signal Monitoring category, click Log Signals.

       See Code

    2. In the Transmission Controller subsystem, in the Shift state subsystem, the z3 Unit Delay block transmits the gear state.

      1. Open the Transmission Controller subsystem.

      2. Open the Shift state subsystem.

      3. The Gear state G subsystem transmits the gear state to a Unit Delay block, which, in turn, transmits the data to the Gear state Outport block. The signal that connects the Unit Delay block to the Gear state Outport block is marked for data logging. Select the signal, and in the Simulink toolstrip, on the Signal tab, click the arrow on the right side of the Monitor section. In the Signal Monitoring category, click Log Signals.

       See Code

  3. Obtain and examine the baseline results. Simulate using the global variable-step solver and review the results in the Simulation Data Inspector.

    1. Run the simulation. In the Simulink toolstrip, on the Simulation tab, in the Simulate section, click Run.

       See Code

    2. Open the Simulation Data Inspector. In the Simulink toolstrip, on the Simulation tab, click the arrow on the right side of the Review Results section, and, in the Signal Logging Results category, click Signal Logging Results.To inspect the tire slip data, select the From8:1 check box.

       See Code

  4. Configure the local solver for fixed-step simulation using the Partitioning solver.

    1. In the model, open the Solver Configuration block settings.

    2. Select the Use local solver check box.

     See Code

  5. Simulate using the Partitioning solver.

     See Code

  6. Compare the baseline and Partitioning solver results in the Simulation Data Inspector.

    1. Open the Simulation Data Inspector.

    2. In the top, left pane, select Compare.

    3. Configure the comparison. In the top, right pane:

      1. On the right side of the Baseline setting, click the down arrow and select Run 1: sdl_vehicle_clutch.

      2. On the right side of the Compare to setting, click the down arrow and select Run 2: sdl_vehicle_clutch.

      3. Click Compare.

    4. To change the Partitioning solver results line color, in the Properties pane, in the Compare to column, click the colored Line, select a different color, such as yellow, and then click Set.

     See Code

    The results from the Partitioning solver simulation contain significant chatter.

  7. Chatter in the front tire slip is due to the parameters specified for the Tire (Magic Formula) block. To resolve the signal chatter and the initial condition warning, simplify the tire dynamics:

    1. Open the Vehicle subsystem.

    2. Open the Tire LF block settings.

    3. In the Dynamics settings, set Inertia to No Inertia.

    4. Using the same process, omit the inertia for the Tire RF, Tire LR, and Tire RR blocks.

     See Code

  8. To better understand the cause of the warning, examine the variables in the model. To open the Variable Viewer, on the Apps tab, in the Physical Modeling category, click Simscape Variable Viewer. To filter for variables that have targets that the simulation is unable to satisfy, click the arrow to the right of the Status column header, and in the drop-down list, clear the OK check box.

    The Variable Viewer shows that several high priority variable targets are not satisfied. For some driveline models with clutches, this issue is resolved by unlocking any clutches that are initially locked. For a clutch, a locked initial state is more numerically constraining. For more information, see Fundamental Friction Clutch.

    To resolve the warning:

    1. Open the Dual Clutch Transmission subsystem.

    2. Open the Gears subsystem.

    3. Open the Dog Clutch 1 block settings. In the Initial Conditions settings, set Clutch initial state to Unlocked.

     See Code

  9. Simulate and then examine and compare the results in the Simulation Data Inspector.

    1. Run the simulation.

       See Code

    2. Open the Simulation Data Inspector and compare the results from the Partitioning solver fixed-step simulation to the baseline results from the variable-step simulation. To configure the comparison, in the top, right pane:

      1. On the right side of the Baseline setting, click the down arrow and select Run 1: sdl_vehicle_clutch.

      2. On the right side of the Compare to setting, click the down arrow and select Run 3: sdl_vehicle_clutch.

      3. Click Compare.

     See Code

    The results from the Partitioning solver simulation no longer contain significant chatter and are much more similar to the baseline results.

See Also

Related Examples

More About