Documentation

pe_getPowerLossTimeSeries

Calculate dissipated power losses and return the time series data

Syntax

lossesCell = pe_getPowerLossTimeSeries(node)
lossesCell = pe_getPowerLossTimeSeries(node,startTime,endTime)
lossesCell = pe_getPowerLossTimeSeries(node,startTime,endTime,intervalWidth)

Description

example

lossesCell = pe_getPowerLossTimeSeries(node) calculates dissipated power losses for blocks, based on logged Simscape™ simulation data, and returns the time series data for each block.

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_getPowerLossTimeSeries function calculates 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.

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

lossesCell = pe_getPowerLossTimeSeries(node,startTime,endTime) calculates dissipated power losses for blocks in a model, based on logged Simscape simulation data, and returns the time series data for each block for time steps from startTime to endTime. If startTime is equal to endTime, the interval is effectively zero and the function returns the instantaneous power for the time step that occurs at that moment.

example

lossesCell = pe_getPowerLossTimeSeries(node,startTime,endTime,intervalWidth) calculates dissipated power losses for blocks in a model, based on logged Simscape simulation data, and returns the time series data for each block for time steps from startTime to endTime, with averaging applied over intervals equal to intervalWidth. If intervalWidth is 0, the function returns the instantaneous power dissipation.

Examples

collapse all

This example shows how to calculate instantaneous losses based on the power dissipated and return the time series data for all time steps in the entire simulation time using the pe_getPowerLossTimeSeries function. Data logging is enabled for the whole example model, and the option to limit data points is off.

Open the model. At the MATLAB® command prompt, enter:

model = 'pe_push_pull_converter_ccm'; 
open_system(model) 

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.

Calculate dissipated power losses and return the time series data in a cell array.

lossesCell = pe_getPowerLossTimeSeries(simlog_pe_push_pull_converter_ccm)
lossesCell =

  4×2 cell array

    'pe_push_pull_converter_ccm.N_Chann…'     [400001×3 double]
    'pe_push_pull_converter_ccm.N_Chann…'     [400001×3 double]
    'pe_push_pull_converter_ccm.Diode'        [400001×3 double]
    'pe_push_pull_converter_ccm.Diode1'       [400001×3 double]

View the time series data. From the workspace, open the lossesCell cell array, then open the 400001x3 double numeric array for the pe_push_pull_converter_ccm.N_Channel_MOSFET_1.mosfet_equation.

The first two columns contain the interval start and end time. The third column contains the power loss data.

Plot the data.

plot(lossesCell{1, 2}(:,end))
title('Dissipated Power')
xlabel('Time Interval')
ylabel('Power (W)')

This example shows how to calculate instantaneous losses based on the power dissipated and return the time series data for all time steps in a specific time period using the pe_getPowerLossTimeSeries function. Data logging is enabled for the whole example model, and the option to limit data points is off.

Open the model. At the MATLAB® command prompt, enter:

model = 'pe_push_pull_converter_ccm'; 
open_system(model) 

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.

The model simulation time (t) is 0.04 seconds. Calculate dissipated power losses and return the time series data in a cell array for the interval when t is 0.010–0.025 seconds.

lossesCell = pe_getPowerLossTimeSeries(simlog_pe_push_pull_converter_ccm,0.010,0.025)
lossesCell =

  4×2 cell array

    'pe_push_pull_converter_ccm.N_Chann…'     [150002×3 double]
    'pe_push_pull_converter_ccm.N_Chann…'     [150002×3 double]
    'pe_push_pull_converter_ccm.Diode'        [150002×3 double]
    'pe_push_pull_converter_ccm.Diode1'       [150002×3 double]

View the time series data. From the workspace, open the lossesCell cell array, then open the 150002x3 double numeric array for the pe_push_pull_converter_ccm.N_Channel_MOSFET_1.mosfet_equation.

The first two columns contain the interval start and end time. The third column contains the power loss data.

Plot the data.

plot(lossesCell{1, 2}(:,end))
title('Dissipated Power')
xlabel('Time Interval')
ylabel('Power (W)')

This example shows how to calculate losses based on the power dissipated and return the time series data for a specific time period with averaging applied over intervals of a specified width. Data logging is enabled for the whole example model, and the option to limit data points is off.

Open the model. At the MATLAB® command prompt, enter:

model = 'pe_push_pull_converter_ccm'; 
open_system(model) 

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.

The model simulation time, t, is 0.04 seconds. Calculate the average dissipated power losses for 1.1e-4 s intervals and return the time series data in a cell array for the period when simulation time, t, is 0.010–0.025 seconds.

lossesCell = pe_getPowerLossTimeSeries(simlog_pe_push_pull_converter_ccm,0.010,0.025,1.1e-4)
lossesCell =

  4×2 cell array

    'pe_push_pull_converter_ccm.N_…'    [136×3 double]
    'pe_push_pull_converter_ccm.N_…'    [136×3 double]
    'pe_push_pull_converter_ccm.Di…'    [136×3 double]
    'pe_push_pull_converter_ccm.Di…'    [136×3 double]

View the time series data. From the workspace, open the lossesCell cell array, then open the 136x3 double numeric array for the pe_push_pull_converter_ccm.N_Channel_MOSFET_1.mosfet_equation.

The first two columns contain the interval start and end time. The third column contains the power loss data. In this case, to use averaging intervals that are equal in width to 1.1e-4 seconds, the function adjusts the start time for the first interval from the specified value of 0.010 seconds to a value of 0.01004 seconds. There are 136 intervals of 1.1e-4 seconds.

Plot the data.

plot(lossesCell{1, 2}(:,end))
title('Dissipated Power')
xlabel('Time Interval')
ylabel('Power (W)')

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_pe_push_pull_converter_ccm

Start of the time interval for calculating the power loss time series, 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 calculating the power loss time series, 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

If the time between the specified startTime and endTime is not an integer multiple of intervalWidth, the function adjusts the start time. The figure shows how the function adjusts the start time to ensure that width of each time interval that the dissipated power is averaged over is equal to the specified intervalWidth.

The black line is an example of the instantaneous power_dissipated variables summed over all elements in an individual block. The simulation runs for 6 seconds. The startTime and endTime are indicated by the solid blue lines. The intervalWidth is set to 1 second. There are five intervals as indicated by the red dashed lines. The right-most edge of the last interval coincides with endTime. The left-most edge of the first interval is always greater than or equal to startTime. The edge is equal to startTime only if (endTime -startTime)/intervalWidth is an integer. The output in this case consists of five values for the averaged power dissipation, one point for each time period. The function outputs the actual start and stop times in the tabulated output data.

Example: 1.1e-3

Data Types: double

Output Arguments

collapse all

Cell array that contains the names of the blocks in the nodes that contain power_dissipated variables and, for each block, a three-column array:

  • Column one contains the interval start time.

  • Column two contains the interval end time.

  • Column three contains the dissipated power for the time interval.

If the interval width is 0 seconds, that is, the start time is equal to the end time, then the dissipated power is the instantaneous power loss. If the interval is greater than 0 seconds, the dissipated power is the average power loss for the time of the interval.

Introduced in R2017a

Was this topic helpful?