getEnergyInfo
R2026bSyntax
Description
returns information about the energy and power usage for the block that corresponds to the
node in the logged simulation data, energyInfo = getEnergyInfo(node)node. The function returns an
EnergyInfo object, which contains information about the types of energy
used by the block and flowing through its ports, energy conversion and dissipation, and the
assumptions used in calculating energy info for the block.
Before you call this function, you must enable energy accounting and simulate the model with Simscape™ data logging turned on either for the whole model or for specific blocks of interest.
To enable energy accounting, in the Configuration Parameters dialog box, at the bottom of the Simscape pane, under Advanced Parameters, select the Enable energy accounting check box.
You can also use the equivalent command-line interface to set the model configuration parameter:
set_param(bdroot,'SimscapeUseEnergyAccounting','on')
uses the specified energy unit, energyInfo = getEnergyInfo(node,EnergyUnit = unitname)unitname, when it returns information
about the energy usage for the block. The specified unit must be commensurate with the
default energy unit, J.
[
additionally returns information about the exergy and exergy rate usage for the block as an
energyInfo,exergyInfo] = getEnergyInfo(___)ExergyInfo object. Use this syntax for blocks in the thermal fluid
domains, such as thermal liquid or gas. If the block does not calculate exergy, the
ExergyInfo object is empty.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2026b
