Main Content

ee_getPowerLossSummary

Calculate dissipated power losses and switching losses

Description

example

lossesTable = ee_getPowerLossSummary(node) calculates dissipated power losses and switching 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, you must have the simulation log variable in your current workspace. Create the simulation log variable by simulating the model with data logging turned on, or load a previously saved variable from a file. If node is the name of the simulation log variable, then the table contains the data for all semiconductor blocks in the model. If node is the name of a node in the simulation data tree, then the table contains the data only for the blocks within that node.

Checking dissipated power is useful for verifying that circuit components are operating within their working envelopes. All blocks in the Semiconductor Devices library, as well as some other blocks, have an internal variable called power_dissipated, which represents the instantaneous power dissipated by the block. 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.

Note

The power_dissipated internal variable does not report dynamic losses incurred from semiconductor switching or magnetic hysteresis.

Three different variables, lastTurnOnLoss, lastTurnOffLoss, and lastReverseRecoveryLoss report the switching losses.

Switching losses are losses associated with the transition of the semiconductor switch from its on-state to its off-state and viceversa, and also with the energy dissipated during a reverse recovery event. They are frequency dependent. The ee_getPowerLossSummary function averages the switching losses over time and expresses them in watts.

These blocks in the Semiconductors & Converters library support the calculation of switching losses and reverse recovery losses, when applicable:

The ee_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, the N-Channel MOSFET block has separate power_dissipated logging nodes for the MOSFET, the gate resistor, and for the source and drain resistors if they have nonzero resistance values. The function sums all these losses and provides the power loss value for the whole block, averaged over simulation time.

example

lossesTable = ee_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 whole simulation time.

Note

Depending on the solver and data logging configuration, the node Start time and the node Stop time can be different from the simulation Start time and the simulation Stop time.

Examples

collapse all

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 = 'PushPullBuckCCM';
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('PushPullBuckCCM/ N-Channel  MOSFET 1','diode_param','2')

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

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

b. In the Property Inspector pane, expand the Integral Diode setting and change the value for the Integral protection diode from None to 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_PushPullBuckCCM)

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 = ee_getPowerLossSummary(simlog_PushPullBuckCCM.N_Channel_MOSFET_1)
tabulatedLosses =

  1x2 table

         LoggingNode          Power 
    ______________________    ______

    {'N_Channel_MOSFET_1'}    2.6077

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 = ee_getPowerLossSummary(simlog_PushPullBuckCCM.N_Channel_MOSFET_1.diode)
tabulatedLosses =

  1x2 table

    LoggingNode    Power 
    ___________    ______

     {'diode'}     2.3671

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

Open the Class-E DC-DC Converter example model.

model = 'ClassEDCDCConverter';
open_system(model)
% This example model has data logging enabled.

Run the simulation to create the simulation log variable simlog_ClassEDCDCConverter in your current workspace.

sim('ClassEDCDCConverter');

Calculate power losses for the LDMOS block.

mosfetLosses = ee_getPowerLossSummary(simlog_ClassEDCDCConverter.LDMOS)
mosfetLosses =

  1x2 table

    LoggingNode    Power 
    ___________    ______

     {'LDMOS'}     3.6583

The table shows dissipated power losses for the LDMOS block, averaged over the whole 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.

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 node 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 node Stop time.

Data Types: double

Output Arguments

collapse all

Dissipated power losses and switching 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. The third column lists the switching losses of each block, in watts. Switching losses comprise losses associated with the transition of the semiconductor switch from its on-state to its off-state and viceversa, and with the energy dissipated during a reverse recovery event.

Version History

Introduced in R2015a