Calculate dissipated power losses
lossesTable = elec_getPowerLossSummary(node)
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.
elec_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
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.
Open the Solar Power Converter example model.
This example model has data logging enabled. Run the simulation
to create the simulation log variable
your current workspace.
Calculate power losses for the MOS1 block.
mosfetLosses = elec_getPowerLossSummary(simlog_ee_solar_converter.MOS1)
mosfetLosses = LoggingNode Power ___________ ______ 'MOS1' 15.316
The table shows dissipated power losses for the MOS1 block, averaged over the whole simulation time.
sscexplore function to further
explore the power loss data for the MOSFET block.
The block has several
mos, and under
15.316 value calculated by the
is a sum of all these losses, averaged over the simulation time.
node— Simulation log variable, or a specific node within the simulation log variable
Simulation log workspace variable, or a node within this variable,
that contains the logged model simulation data, specified as a
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
lossesTable— Dissipated power losses for each block
Dissipated power losses for each block, returned as a table.
The first column lists logging nodes for all blocks that have at least
power_dissipated variable. The second column
lists the corresponding losses in watts.
Not recommended starting in R2019a
elec_getPowerLossSummary function will be removed in a
future release. Use the
instead. The only difference between these functions is the function name. To
prevent your code from generating an error when the function is removed, update to
the new function name.