Documentation

pe_getPowerLossSummary

Calculate dissipated power losses

Syntax

lossesTable = pe_getPowerLossSummary(node)
lossesTable = pe_getPowerLossSummary(node,startTime,endTime)

Description

example

lossesTable = pe_getPowerLossSummary(node) calculates dissipated power losses for semiconductor blocks in a model, based on logged simulation data, and returns the data for each block in a table.

Before you call this function, generate or load the simulation log variable into your workspace. To generate the variable, simulate the model with simulation data logging enabled. For more information, see About Simulation Data Logging (Simscape). To load a previously saved variable from a file, right-click on the file and select Load.

Checking dissipated power allows you to determine if circuit components are operating within their efficiency requirements. Blocks in the Semiconductor > Fundamental Components library have an internal variable called power_dissipated. This variable represents the instantaneous dissipated power, which includes only the real power (not the reactive or apparent power) that the block dissipates. When you log simulation data, the time-value series for this variable represents the power dissipated by the block over time. You can view and plot this data using the Simscape™ Results Explorer. The pe_getPowerLossTimeSeries function also allows you to access this data from a cell array.

The pe_getPowerLossSummary function calculates average losses for each block that has a power_dissipated variable. Some blocks have more than one power_dissipated variable, depending on their configuration. For example, for the MOSFET block, both the diode node and the ideal_switch node have a power_dissipated logging node. The function sums the power losses for both nodes to provide the total power loss for the block, averaged over simulation time.

The nonideal semiconductor blocks also have thermal variants. Thermal variants have thermal ports that allow you to model the heat that is generated due to switching events and conduction losses. If you use a thermal variant, the function calculates power losses based on the thermal parameters that you specify. Essentially, the power dissipated is equal to the heat generated.

If you use a variant without a thermal port, the function calculates power losses based on the electrical parameters that you specify, such as on-state resistance and off-state conductance.

example

lossesTable = pe_getPowerLossSummary(node,startTime,endTime) calculates dissipated power losses within a time interval. startTime and endTime represent the start and end of the time interval for averaging the power losses. If you omit these two input arguments, the function averages the power losses over the total simulation time.

Examples

collapse all

This example uses the Push-Pull Buck Converter in Continuous Conduction Mode model. Data logging is enabled for the whole model and the option to limit data points is off.

1. Open the example model. At the MATLAB® command prompt, enter

model = 'pe_push_pull_converter_ccm';
open_system(model)

2. Run the simulation and create the simulation log variable.

sim(model);

The simulation log variable simlog_pe_push_pull_converter_ccm is saved in your workspace.

3. Calculate average power losses for each semiconductor in the model and display the results in a table.

tabulatedLosses = pe_getPowerLossSummary(simlog_pe_push_pull_converter_ccm)
tabulatedLosses =

  4x2 table

                              LoggingNode                               Power 
    _______________________________________________________________    _______

    'pe_push_pull_converter_ccm.Diode1'                                0.30937
    'pe_push_pull_converter_ccm.Diode'                                  0.3092
    'pe_push_pull_converter_ccm.N_Channel_MOSFET_1.mosfet_equation'    0.24497
    'pe_push_pull_converter_ccm.N_Channel_MOSFET_2.mosfet_equation'     0.2449

The table shows dissipated power losses for each of the N-Channel MOSFET and Diode blocks, averaged over the entire simulation time.

1. Open the Push-Pull Buck Converter in Continuous Conduction Mode example model. At the MATLAB® command prompt, enter

model='pe_push_pull_converter_ccm';
open_system(model)

The model has data logging enabled.

2. Run the simulation and create the simulation log variable.

sim(model)

The simulation log variable simlog_pe_push_pull_converter_ccm is saved in your workspace.

3. Calculate power losses for the N-Channel MOSFET 1 block and display the results in a table.

tabulatedLosses = pe_getPowerLossSummary(simlog_pe_push_pull_converter_ccm.N_Channel_MOSFET_1)
tabulatedLosses =

  1x2 table

                LoggingNode                  Power 
    ____________________________________    _______

    'N_Channel_MOSFET_1.mosfet_equation'    0.24497

The table shows dissipated power losses for just the N-Channel MOSFET 1 block, averaged over the total simulation time.

4. Use the sscexplore function to explore the power loss data for the N-Channel MOSFET 1 block further.

a. Open the Results Explorer.
sscexplore(simlog_pe_push_pull_converter_ccm)

b. Expand these nodes:
  • N_Channel_MOSFET_1

  • mosfet_equation

c. Click the power_dissipated node.

The N-Channel MOSFET 1 block has one power_dissipated variable for the mosfet_equation node. The power_dissipated figure shows the instantaneous power loss for the N-Channel MOSFET 1 block during the simulation.

You can calculate average power losses for the individual components of a block in your model.

1. Open the Push-Pull Buck Converter in Continuous Conduction Mode example model. At the MATLAB® command prompt, enter

model = 'pe_push_pull_converter_ccm';
open_system(model)

The model has data logging enabled.

2. Add a diode component in the N-Channel MOSFET 1 block using the MATLAB® command prompt:

set_param('pe_push_pull_converter_ccm/ N-Channel  MOSFET 1','diode_param','2')

Alternatively, you can add the component in the Simulink® Editor:

a. Open the Property Inspector pane. In the model window, in the menu bar, click View > Property Inspector

b. Click the N-Channel MOSFET1 block to access the block parameters.

c. In the Property Inspector pane, expand the Integral Diode setting and change the value for the Integral protection from None to Protection diode with no dynamics.

3. Run the simulation, create a simulation log variable, and open the simlog in the Simscape Results Explorer using the sscexplore function.

sim(model)
sscexplore(simlog_pe_push_pull_converter_ccm)

4. View the power loss data for the two N-Channel MOSFET blocks, expand these nodes and CTRL + click the power_dissipated nodes:

  • N_Channel_MOSFET_1 > diode > power_dissipated

  • N_Channel_MOSFET_1 > mosfet_equation > power_dissipated

  • N_Channel_MOSFET_2 > mosfet_equation > power_dissipated

The N-Channel MOSFET 2 block has only one power_dissipated variable. The N-Channel MOSFET 1 block has one power_dissipated variable for each of the two components (MOSFET and diode) that the block contains.

5. Calculate power losses for both components of the N-Channel MOSFET 1 block and display the results in a table

tabulatedLosses = pe_getPowerLossSummary(simlog_pe_push_pull_converter_ccm.N_Channel_MOSFET_1)
tabulatedLosses =

  1x2 table

        LoggingNode         Power 
    ____________________    ______

    'N_Channel_MOSFET_1'    2.6075

The table shows the combined dissipated power losses for both the diode and the MOSFET components of the N-Channel MOSFET 1 block, averaged over the total simulation time.

6. Calculate power losses for only the diode component of the NChannel MOSFET 1 block and display the results in a table.

tabulatedLosses = pe_getPowerLossSummary(simlog_pe_push_pull_converter_ccm.N_Channel_MOSFET_1.diode)
tabulatedLosses =

  1x2 table

    LoggingNode    Power 
    ___________    ______

    'diode'        2.3669

The table shows dissipated power losses only for the diode component of the block, averaged over the total simulation time.

1. Open the Push-Pull Buck Converter in Continuous Conduction Mode example model. At the MATLAB® command prompt, enter

pe_push_pull_converter_ccm

The model has data logging enabled.

2. Run the simulation and create the simulation log variable.

sim('pe_push_pull_converter_ccm');

The simulation log variable simlog_pe_push_pull_converter_ccm is saved in your workspace.

3. The model simulation time (t) is 0.04 seconds. Calculate average power losses for the interval when t is 0.010–0.025 seconds

tabulatedLosses = pe_getPowerLossSummary(simlog_pe_push_pull_converter_ccm,0.010,0.025)
tabulatedLosses =

  4x2 table

                              LoggingNode                               Power 
    _______________________________________________________________    _______

    'pe_push_pull_converter_ccm.Diode'                                  0.3703
    'pe_push_pull_converter_ccm.Diode1'                                0.37022
    'pe_push_pull_converter_ccm.N_Channel_MOSFET_2.mosfet_equation'    0.26598
    'pe_push_pull_converter_ccm.N_Channel_MOSFET_1.mosfet_equation'    0.26595

The table shows dissipated power losses for each of the Diode and MOSFET blocks, averaged over the specified portion of simulation time.

Input Arguments

collapse all

Simulation log workspace variable, or a node within this variable, that contains the logged model simulation data, specified as a Node object. You specify the name of the simulation log variable by using the Workspace variable name parameter on the Simscape pane of the Configuration Parameters dialog box. To specify a node within the simulation log variable, provide the complete path to that node through the simulation data tree, starting with the top-level variable name.

If node is the name of the simulation log variable, then the table contains the data for all blocks in the model that contain power_dissipated variables. If node is the name of a node in the simulation data tree, then the table contains the data only for:

  • Blocks or variables within that node

  • Blocks or variables within subnodes at all levels of the hierarchy beneath that node

Example: simlog.Cell1.MOS1

Start of the time interval for averaging dissipated power losses, specified as a real number, in seconds. startTime must be greater than or equal to the simulation Start time and less than endTime.

Data Types: double

End of the time interval for averaging dissipated power losses, specified as a real number, in seconds. endTime must be greater than startTime and less than or equal to the simulation Stop time.

Data Types: double

Output Arguments

collapse all

Dissipated power losses for each block, returned as a table. The first column lists logging nodes for all blocks that have at least one power_dissipated variable. The second column lists the corresponding losses in watts.

Introduced in R2017a

Was this topic helpful?