Main Content

Build and Operate Virtual Vehicle

When you use the Virtual Vehicle Composer to configure your virtual vehicle and test plan, you can then build the vehicle model. You can operate the vehicle model in two types of simulations:

  • Running the entire test plan you specified

  • Power accounting, which runs only the last scenario in your test plan and creates reports and figures summarizing the energy flow during that scenario

Diagram of Virtual Vehicle Composer workflow with Build and Operate tabs highlighted

Build the Virtual Vehicle

To build your virtual vehicle, in the Build section on the toolstrip, click Build Virtual Vehicle to build your vehicle.

Virtual Vehicle Composer Build icon

The build takes time to complete. View progress in the progress bar.

Virtual Vehicle Composer build progress bar

When the build is complete, the app displays a Simulink® model that incorporates the vehicle architecture and parameters that you have specified. The app also associates the model with the test plan you have assembled.

Virtual Vehicle Composer model completed

You can now operate your virtual vehicle.

Run Entire Test Plan

To run the entire set of test scenarios you selected, in the Operate section on the toolstrip, click Run Test Plan. A Simulation Manager pane appears.

Note

If you click the Run button on the model pane, the app will only run the last scenario in your test plan.

The simulations take time to complete. View progress in the MATLAB® Command Window.

To view the results of the simulations, see Review Virtual Vehicle Test Results (Powertrain Blockset).

Run Power Accounting

For certain vehicle model configurations, you can generate reports and figures summarizing the energy flow during that scenario. Power accounting summaries have these requirements:

  • Vehicle class is set to Passenger vehicle

  • Model template is set to Simulink

  • Vehicle dynamics is set to Longitudinal vehicle dynamics

If your model meets these requirements, take these steps to produce your reports and figures:

  1. Place the desired test scenario last in your test plan.

  2. Build your virtual vehicle.

  3. In the model pane, double-click the Analyze Power and Energy button.

instruction to start power accounting

The app opens a live script. Click the Run button to execute.

Running the Power Accounting live script.

When the script finishes, you can go under the View tab and click Output Inline to view the results inline with the live script.

Changing livescript results display to Inline

The results include several summaries of the energy flow during the test, including reports, a histogram, and a Sankey diagram.

The overall summary report gives you an energy balance of each of the listed components, considering each as a thermodynamic system. Note that braking losses are accounted for in the wheel systems, and the losses for the vehicle body are from aerodynamic drag.

Power accounting tabular output

You can also display a Sankey diagram summarizing the energy flow during the test.

Power Accounting Sankey diagram.

See Also

| (Powertrain Blockset)

Related Examples

More About