autoblks.pwr.PlantInfo

Analyze powertrain power and energy

Description

To assess powertrain efficiencies, use the autoblks.pwr.PlantInfo object to evaluate and report power and energy for component-level blocks and system-level reference applications.

Creation

Description

example

MATLAB creates an autoblks.pwr.PlantInfo object for the system that you specify. VehPwrAnalysis = autoblks.pwr.PlantInfo(SysName) where SysName is the name of the model or subsystem that you want to analyze.

Input Arguments

expand all

Model that you want to analyze.

Example: 'SiCiPtReferenceApplication'

Data Types: char

Properties

expand all

This property is read-only.

Average efficiency, dimensionless.

This property is read-only.

Efficiency, η, dimensionless. To calculate the efficiency, the Eff property implements this equation.

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

The equation uses these variables.

Pstore

Stored power

Pinput, Poutput

Input and output power logged by Power Accounting Bus Creator block

Energy balance absolute tolerance, EnrgyBalAbsTol.

To determine if the system conserves energy, the isEnrgyBalanced method checks the energy conservation at each time step.

EErr=Etrans+EnottransEstore

Blocks change the input energy plus released stored energy to output energy plus stored energy. For example, a mapped engine block uses fuel (not transferred energy) to produce torque (transferred energy) and heat loss (not transferred energy). The total modified energy represents the average between the input fuel energy and the energy exiting the system (torque and heat loss). To calculate the total energy modified by the block, the method uses the integral of the average transferred, not transferred, and stored power.

Etotal=12(0tend(|Ptrans|+|Pnottrans|+|Pstore|)dt)|t=tend

If the energy conservation error is within an error tolerance, the method returns true. Specifically, if either condition is met, the method returns true.

Condition

|EErr|Etotal<EnrgyBalRelTol

or

Etotal<EnrgyBalAbsTol

The equations use these variables.

EErr

Energy conservation error

Etotal

Total energy modified by block

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

Data Types: double

Energy balance relative tolerance, EnrgyBalRelTol.

To determine if the system conserves energy, the isEnrgyBalanced method checks the energy conservation at each time step.

EErr=Etrans+EnottransEstore

Blocks change the input energy plus released stored energy to output energy plus stored energy. For example, a mapped engine block uses fuel (not transferred energy) to produce torque (transferred energy) and heat loss (not transferred energy). The total modified energy represents the average between the input fuel energy and the energy exiting the system (torque and heat loss). To calculate the total energy modified by the block, the method uses the integral of the average transferred, not transferred, and stored power.

Etotal=12(0tend(|Ptrans|+|Pnottrans|+|Pstore|)dt)|t=tend

If the energy conservation error is within an error tolerance, the method returns true. Specifically, if either condition is met, the method returns true.

Condition

|EErr|Etotal<EnrgyBalRelTol

or

Etotal<EnrgyBalAbsTol

The equations use these variables.

EErr

Energy conservation error

Etotal

Total energy modified by block

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

Data Types: double

Energy units.

Example: VehPwrAnalysis.EnrgyUnits = 'MJ';

Data Types: char

Power units.

Example: VehPwrAnalysis.PwrUnits = 'kW';

Data Types: char

Object Functions

addLoggedDataAdd logged data
dispSignalSummaryDisplay powertrain subsystem energy analysis
dispSysSummaryDisplay powertrain system efficiency
findChildSysPowertrain subsystem energy analysis
histogramEffDisplay powertrain subsystem efficiency histogram
isEnrgyBalancedLogical flag for energy conservation
loggingOffTurn signal logging off
loggingOnTurn signal logging on
runRun powertrain energy and power analysis
sdiSummaryDisplay Simulation Data Inspector plots of powertrain energy and power
xlsSysSummaryWrite powertrain energy analysis to spreadsheet

Examples

collapse all

Analyze the power and energy in the conventional vehicle reference application. To create a PlantInfo object, see step 2.

  1. Open the conventional vehicle reference application. By default, the application has a mapped 1.5 L spark-ignition (SI) engine and a dual clutch transmission. Project files open in a writable location.

  2. Set the system name to SiCiPtReferenceApplication.

    Create the autoblks.pwr.PlantInfo object.

    Use the PwrUnits and EnrgyUnits properties to specify the units.

    SysName = 'SiCiPtReferenceApplication';
    VehPwrAnalysis = autoblks.pwr.PlantInfo(SysName);
    VehPwrAnalysis.PwrUnits = 'kW';
    VehPwrAnalysis.EnrgyUnits = 'MJ';
  3. Use the run method to turn on logging, run simulation, and add logged data to the object.

    run(VehPwrAnalysis);
  4. Use the dispSysSummary method to display the results.

    dispSysSummary(VehPwrAnalysis);
  5. Use the xlsSysSummary method to write the results to a spreadsheet.

    xlsSysSummary(VehPwrAnalysis,'EnergySummary.xlsx');
  6. Use the findChildSys method to retrieve the autoblks.pwr.PlantInfo object for the Engine subsystem.

    To display the results, use the dispSignalSummary method.

    Use the histogramEff method to display a histogram of the time spent at each engine plant efficiency.

    EngSysName = 'SiCiPtReferenceApplication/Passenger Car/Engine';
    EngPwrAnalysis = findChildSys(VehPwrAnalysis,EngSysName);
    dispSignalSummary(EngPwrAnalysis);
    histogramEff(EngPwrAnalysis);
  7. Use the findChildSys method to retrieve the autoblks.pwr.PlantInfo object for the Drivetrain subsystem.

    To display the results, use the dispSignalSummary method.

    DrvtrnSysName = 'SiCiPtReferenceApplication/Passenger Car/Drivetrain';
    DrvtrnPwrAnalysis = findChildSys(VehPwrAnalysis,DrvtrnSysName);
    dispSignalSummary(DrvtrnPwrAnalysis);
  8. To plot the results, use the sdiSummary method.

    sdiSummary(VehPwrAnalysis,{EngSysName,DrvtrnSysName})

Introduced in R2019a