Main Content

elec_getPowerLossTimeSeries

Calculate dissipated power losses and return time series data

Description

lossesCell = elec_getPowerLossTimeSeries(node) calculates dissipated power losses for blocks in a model, based on logged simulation data, and returns the time series data for each block.

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.

The elec_getPowerLossTimeSeries function calculates dissipated power losses for each block that has a power_dissipated variable. 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. 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 all of the blocks as functions of time.

If node is the name of the simulation log variable, then the table contains the data for all the blocks in the model that dissipate power (that is, contain at least one power_dissipated variable). 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.

lossesCell = elec_getPowerLossTimeSeries(node,startTime,endTime) calculates dissipated power losses and returns the time series data 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. If you omit these two input arguments, the function returns data over the whole simulation time.

lossesCell = elec_getPowerLossTimeSeries(node,startTime,...
endTime,intervalWidth)
calculates dissipated power losses and returns the time series data for time steps from startTime to endTime, averaged over the time intervalWidth. If you omit the intervalWidth, or set it to 0, the function returns the instantaneous data, without averaging. If you omit all three optional arguments, the function returns the instantaneous data 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.

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 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

Size of the time interval for calculating the average power dissipation, specified as a real number, in seconds. If specified, the function returns data for time steps from startTime to endTime, averaged over the intervalWidth. If you omit the intervalWidth argument, or set it to 0, the function returns the instantaneous data, without averaging. If all the optional arguments are omitted, the function returns the instantaneous data over the whole simulation time.

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.

Version History

Introduced in R2017a

expand all