Analyze Power and Energy

To assess powertrain efficiency, you can evaluate and report power and energy for component-level blocks and system-level reference applications.

These reference applications include live scripts that analyze the energy consumption. After you open the reference applications, click Analyze Power and Energy to open the live script. To generate the energy report, select Run.

The plant model blocks calculate transferred, stored, and not transferred power. The blocks use the Power Accounting Bus Creator to log the power signals that the live script uses. If you use your own block in the reference application, add the Power Accounting Bus Creator to your subsystem to log the power signals.

The live script provides:

  • An overall energy summary that the script exports to an Excel® spreadsheet.

  • Engine plant, electric plant, and drivetrain efficiencies, including an engine plant histogram of time spent at different efficiencies.

  • Data logging so that you can use the Simulation Data Inspector (SDI) to analyze the powertrain efficiency, power, and energy signals.

Live Script

The live script uses the autoblks.pwr.PlantInfo class to turn on data logging, run the simulation, and report power and energy results. Before running the simulation, the script finds all of the Power Accounting Bus Creator blocks in the model and turns on data logging. During the simulation, the model logs the transferred, not transferred, and stored power. The script uses the logged data to calculate efficiency, energy loss, energy input, and energy output for each component and subsystem. If the component does not conserve energy, the script issues warnings. Finally, the script provides an overall vehicle energy summary, a detailed subsystem summary, and Simulation Data Inspector (SDI) time series plots.

Run Simulation

When you run the simulation, the script creates the autoblks.pwr.PlantInfo object to analyze the model energy and power consumption. Use these properties to set the units:

  • PwrUnits

  • EnrgyUnits

When the script creates the autoblks.pwr.PlantInfo object, the constructor searches the model for Power Accounting Bus Creator blocks. Starting at the top-level model, the constructor creates a child object for each subsystem that contains Power Accounting Bus Creator blocks. The constructor stops at the blocks that have a Power Accounting Bus Creator.

To track the power transferred between the components, the constructor uses the transferred power ports defined in the Power Accounting Bus Creator block mask.

To calculate the efficiency, the autoblks.pwr.PlantInfo class Eff property implements this equation.

η=|PoutputPstore(Pstore>0)PinputPstore(Pstore<0)|

To determine if energy is balanced, the autoblks.pwr.PlantInfo class isEnrgyBalanced method checks the power and energy conservation at each time step.

PErr=Ptrans+PnottransPstoreEErr=Etrans+EnottransEstore

If the power and energy conservation error is within an error tolerance, the method returns true. Specifically, if both these conditions are met, the method returns true.

Condition 

1

PErrPinputPstore(Pstore<0)<EnrgyBalRelTol

or

PErr<EnrgyBalAbsTol

2

EErrEinputEstore(Estore<0)<EnrgyBalRelTol

or

EErr<EnrgyBalAbsTol

Overall Summary

The overall summary provides the efficiency, energy loss, energy input, energy output, and energy stored at the component- and system-level. The summary includes hyperlinks that you can use to investigate model blocks and subsystems.

The script uses the autoblks.pwr.PlantInfo class xlsSysSummary method to export the analysis to an Excel spreadsheet.

Plant Summary

The script provides engine plant, electric plant, and drivetrain efficiencies. Specifically, the script includes the signal energy, and an engine efficiency histogram.

SDI Summary

The script includes the autoblks.pwr.PlantInfo class sdiSummary method to create SDI power, energy, and efficiency signal plots.

Power Signals

The system-level power and energy accounting tests that the system satisfies the conservation of energy. If the component does not conserve energy, the live script issues warnings.

The Power Accounting Bus Creator for the plant blocks in the reference applications sort the signals into three power types.

Power TypeDescriptionExamples

Ptrans

Transferred

Power transferred between blocks:

  • Positive signals indicate flow into block

  • Negative signals indicate flow out of block

  • Crankshaft power transferred from mapped engine to transmission.

  • Road load power transferred from wheel to vehicle.

  • Rate of heat flow transferred from throttle to manifold volume.

Pnottrans

Not transferred

Power crossing the block boundary, but not transferred:

  • Positive signals indicate an input

  • Negative signals indicate a loss

  • Rate of heat transfer with the environment.

    • From environment is an input (positive signal)

    • To environment is a loss (negative signal)

  • Flow boundary with the environment.

    • From environment is an input (positive signal)

    • To environment is a loss (negative signal)

  • Mapped engine fuel flow.

Pstore

Stored

Stored energy rate of change:

  • Positive signals indicate an increase

  • Negative signals indicate a decrease

Energy rate of change:

  • Battery storage

  • Kinetic energy in drivetrain components

  • Vehicle potential energy

  • Vehicle velocity

The power signals satisfy this equation.

Ptrans+Pnottrans=Pstore

To conserve energy, sum of transferred power signals must be near zero.

The equations use these variables.

PErr, EErr

Power and energy conservation error, respectively

EnrgyBalRelTol, EnrgyBalAbsTol

Energy balance relative and absolute tolerance, respectively

Ptrans, Etrans

Transferred power and energy, respectively

Pnottrans, Enottrans

Not transferred power and energy, respectively

Pstore, Estore

Stored power and energy, respectively

Pinput, Poutput

Input and output power logged by Power Accounting Bus Creator block

See Also

Related Examples

More About