Main Content

ee_getNodeDvDtTimeSeries

Calculate rates-of-change of voltage variables

Description

example

seriesTable = ee_getNodeDvDtTimeSeries(node,tau) calculates rates-of-change of voltage variables for nodes that are based on the foundation.electrical.electrical domain, based on logged simulation data. The function returns the data for each terminal in a table. The data in the table appears in descending order according to the maximum absolute value of the rate-of-change of voltage variables with respect to the ground, over the whole simulation time. The table does not contain data for terminals that are held fixed.

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 the blocks in the model that have nodes based on the foundation.electrical.electrical domain. If node is the name of a node in the simulation data tree, then the table contains the data only for the children of that node.

Examining rates-of-change of voltage variables in power electronics circuits is useful for determining the potential for unwanted conducted or radiated emissions. The rate-of-change data also helps you to identify unwanted turn-on of switching devices. All nodes that are based on the foundation.electrical.electrical domain store the potential with respect to electrical ground as the variable v. When you log simulation data, the time-value series for this variable represents the trend of the potential over time. You can view and plot this data using the Simscape™ Results Explorer.

To evaluate the rates-of-change of voltage variables, the ee_getNodeDvDtTimeSeries function employs finite difference approximation of the first derivative with respect to time. It performs 1-D data linear interpolation of voltage variables using a uniform grid with the time step, tau. The function then applies the central differencing scheme to the interpolated data.

Tip

For small time steps, finite differencing may lead to inaccurate results. The time step tau should be small enough to capture waveforms, but not so small that the finite differencing error becomes large. For example, for power transistors with an expected limit of 50 V/ns for their voltage rate-of-change, a reasonable guess for tau is 1e-9 s.

example

seriesTable = ee_getNodeDvDtTimeSeries(node,tau,startTime,endTime) calculates rates-of-change of voltage variables within a time interval. startTime and endTime represent the start and end of the time interval for evaluating the derivatives of the voltage variables with respect to time. If you omit these two input arguments, the function evaluates rates-of-change of voltage variables over the whole simulation time.

Examples

collapse all

Open the Class E DC-DC Converter example model.

open_system('ClassEDCDCConverter')

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 rates-of-change of voltage variables for the whole model with a time step of 1e-9 seconds, and return the time series data in a table.

seriesTable = ee_getNodeDvDtTimeSeries(simlog_ClassEDCDCConverter,1e-9)
seriesTable =

  19x4 table

                                 LoggingNode                                  Terminal                                      Voltage                                                                         dvdt                                    
    ______________________________________________________________________    ________    ___________________________________________________________________________    ___________________________________________________________________________

    "ClassEDCDCConverter.R_Trans"                                               "n"       {[   -0.6661 0.0539 5.5048e-04 -9.9566e-04 -0.0017 ... ] (1x125001 double)}    {[   7.2006e+08 3.3334e+08 -2.7458e+07 -1.1243e+06 ... ] (1x125001 double)}
    "ClassEDCDCConverter.Transformer"                                           "p1"      {[   -0.6661 0.0539 5.5048e-04 -9.9566e-04 -0.0017 ... ] (1x125001 double)}    {[   7.2006e+08 3.3334e+08 -2.7458e+07 -1.1243e+06 ... ] (1x125001 double)}
    "ClassEDCDCConverter.Cs"                                                    "n"       {[   -0.6661 0.0540 6.1203e-04 -9.1245e-04 -0.0016 ... ] (1x125001 double)}    {[   7.2010e+08 3.3337e+08 -2.7436e+07 -1.1027e+06 ... ] (1x125001 double)}
    "ClassEDCDCConverter.R_Trans"                                               "p"       {[   -0.6661 0.0540 6.1203e-04 -9.1245e-04 -0.0016 ... ] (1x125001 double)}    {[   7.2010e+08 3.3337e+08 -2.7436e+07 -1.1027e+06 ... ] (1x125001 double)}
    "ClassEDCDCConverter.Cs"                                                    "p"       {[     -0.6661 0.0542 0.0012 3.0486e-04 3.9579e-04 ... ] (1x125001 double)}    {[   7.2030e+08 3.3369e+08 -2.6931e+07 -4.1970e+05 ... ] (1x125001 double)}
    "ClassEDCDCConverter.LDMOS"                                                 "D"       {[     -0.6661 0.0542 0.0012 3.0486e-04 3.9579e-04 ... ] (1x125001 double)}    {[   7.2030e+08 3.3369e+08 -2.6931e+07 -4.1970e+05 ... ] (1x125001 double)}
    "ClassEDCDCConverter.Ls"                                                    "n"       {[     -0.6661 0.0542 0.0012 3.0486e-04 3.9579e-04 ... ] (1x125001 double)}    {[   7.2030e+08 3.3369e+08 -2.6931e+07 -4.1970e+05 ... ] (1x125001 double)}
    "ClassEDCDCConverter.Sense_Vds.Voltage_Stress_Sensor"                       "p"       {[     -0.6661 0.0542 0.0012 3.0486e-04 3.9579e-04 ... ] (1x125001 double)}    {[   7.2030e+08 3.3369e+08 -2.6931e+07 -4.1970e+05 ... ] (1x125001 double)}
    "ClassEDCDCConverter.D2"                                                    "p"       {[0.3745 0.2837 0.2665 0.2568 0.2502 0.2456 0.2422 ... ] (1x125001 double)}    {[ -9.0865e+07 -5.4005e+07 -1.3448e+07 -8.1351e+06 ... ] (1x125001 double)}
    "ClassEDCDCConverter.Transformer"                                           "n3"      {[0.3745 0.2837 0.2665 0.2568 0.2502 0.2456 0.2422 ... ] (1x125001 double)}    {[ -9.0865e+07 -5.4005e+07 -1.3448e+07 -8.1351e+06 ... ] (1x125001 double)}
    "ClassEDCDCConverter.D1"                                                    "p"       {[ -2.6027 -2.6021 -2.6004 -2.5978 -2.5942 -2.5897 ... ] (1x125001 double)}    {[     6.7195e+05 1.1681e+06 2.1426e+06 3.1004e+06 ... ] (1x125001 double)}
    "ClassEDCDCConverter.Transformer"                                           "p2"      {[ -2.6027 -2.6021 -2.6004 -2.5978 -2.5942 -2.5897 ... ] (1x125001 double)}    {[     6.7195e+05 1.1681e+06 2.1426e+06 3.1004e+06 ... ] (1x125001 double)}
    "ClassEDCDCConverter.Behavioral_Gate_Driver.Controlled_Voltage_Source"      "p"       {[ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ... ] (1x125001 double)}    {[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... ] (1x125001 double)}
    "ClassEDCDCConverter.LDMOS"                                                 "G"       {[ 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ... ] (1x125001 double)}    {[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... ] (1x125001 double)}
    "ClassEDCDCConverter.Cout"                                                  "p"       {[   0 3.9616e-07 1.0631e-06 2.0002e-06 3.2081e-06 ... ] (1x125001 double)}    {[396.1609 531.5715 802.0373 1.0725e+03 1.3420e+03 ... ] (1x125001 double)}
    "ClassEDCDCConverter.D1"                                                    "n"       {[   0 3.9616e-07 1.0631e-06 2.0002e-06 3.2081e-06 ... ] (1x125001 double)}    {[396.1609 531.5715 802.0373 1.0725e+03 1.3420e+03 ... ] (1x125001 double)}
    "ClassEDCDCConverter.D2"                                                    "n"       {[   0 3.9616e-07 1.0631e-06 2.0002e-06 3.2081e-06 ... ] (1x125001 double)}    {[396.1609 531.5715 802.0373 1.0725e+03 1.3420e+03 ... ] (1x125001 double)}
    "ClassEDCDCConverter.R_Load"                                                "p"       {[   0 3.9616e-07 1.0631e-06 2.0002e-06 3.2081e-06 ... ] (1x125001 double)}    {[396.1609 531.5715 802.0373 1.0725e+03 1.3420e+03 ... ] (1x125001 double)}
    "ClassEDCDCConverter.Sense_Vout.Voltage_Sensor"                             "p"       {[   0 3.9616e-07 1.0631e-06 2.0002e-06 3.2081e-06 ... ] (1x125001 double)}    {[396.1609 531.5715 802.0373 1.0725e+03 1.3420e+03 ... ] (1x125001 double)}

The table contains time series data of voltage variables and their first derivatives over the whole simulation time for all the blocks in the model that have nodes based on the foundation.electrical.electrical domain.

View the time series data. From the workspace, open the seriesTable table, then open the two 1x125001 double numeric arrays for the ClassEDCDCConverter.LDMOS.D.

The first array contains the voltage data. The second array contains the voltage derivative data.

Plot the data.

time = 0:1e-9:1.25e-4;
vOut = seriesTable.Voltage{6};
dvdtOut = seriesTable.dvdt{6};

ax1 = subplot(2,1,1);
plot(time,vOut),grid;
ylabel('Voltage (V)');
axis([0 1.25e-4 0 1000]);
ax1.XTickLabel = {};
ax1.Title.String = 'LDMOS Stress Voltage';

ax2 = subplot(2,1,2);
plot(time,dvdtOut),grid;
ylabel('Voltage Derivative (V/s)');
xlabel('Time (s)');
axis([0 1.25e-4 0 4e10]);
ax2.Title.String = 'LDMOS Stress Voltage Derivative';

Open the Class E DC-DC Converter example model.

open_system('ClassEDCDCConverter')

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 rates-of-change of voltage variables for the LDMOS block with a time step of 1e-9 seconds, and return the time series data in a table.

mosfetTable = ee_getNodeDvDtTimeSeries(simlog_ClassEDCDCConverter.LDMOS,1e-9)
mosfetTable =

  2x4 table

    LoggingNode    Terminal                                     Voltage                                                                         dvdt                                   
    ___________    ________    __________________________________________________________________________    __________________________________________________________________________

      "LDMOS"        "D"       {[    -0.6661 0.0542 0.0012 3.0486e-04 3.9579e-04 ... ] (1x125001 double)}    {[  7.2030e+08 3.3369e+08 -2.6931e+07 -4.1970e+05 ... ] (1x125001 double)}
      "LDMOS"        "G"       {[10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ... ] (1x125001 double)}    {[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... ] (1x125001 double)}

The table contains time series data of voltage variables and their first derivatives over the whole simulation time for the LDMOS block. The table does not list the S terminal because it is held fixed to the ground.

Open the Class E DC-DC Converter example model.

open_system('ClassEDCDCConverter')

This example model has data logging enabled. Run the simulation to create the simulation log variable simlog_ClassEDCDCConverter in your current workspace.

sim('ClassEDCDCConverter');

The model simulation time is 1.25e-4 seconds. Calculate and display rates-of-change of voltage variables for the Transformer block during the last 0.25e-4 seconds of the simulation. Use a time step of 1e-9 seconds.

transformerTable = ee_getNodeDvDtTimeSeries(simlog_ClassEDCDCConverter.Transformer,1e-9,1e-4)
transformerTable =

  3x4 table

     LoggingNode     Terminal                                      Voltage                                                                        dvdt                                   
    _____________    ________    ___________________________________________________________________________    _________________________________________________________________________

    "Transformer"      "p1"      {[-463.9107 -457.3785 -450.7939 -444.1511 -437.4486 ... ] (1x25001 double)}    {[    6.5322e+09 6.5584e+09 6.6137e+09 6.6726e+09 ... ] (1x25001 double)}
    "Transformer"      "n3"      {[  23.1977 23.1991 23.2003 23.2016 23.2028 23.2040 ... ] (1x25001 double)}    {[    1.3063e+06 1.2918e+06 1.2610e+06 1.2274e+06 ... ] (1x25001 double)}
    "Transformer"      "p2"      {[  22.6981 22.6896 22.6796 22.6666 22.6472 22.6092 ... ] (1x25001 double)}    {[-8.5212e+06 -9.2677e+06 -1.1480e+07 -1.6183e+07 ... ] (1x25001 double)}

The table contains time series data of voltage variables, and their first derivatives, for the Transformer block over the last 0.25e-4 seconds of the simulation. The table does not list terminals that are held fixed to the ground.

View the time series data. From the workspace, open the transformerTable table, then open the two 1x25001 double numeric arrays for the Transformer.p1.

The first array contains the voltage data. The second array contains the voltage derivative data.

Plot the data.

time = 1e-4:1e-9:1.25e-4;
vOut = transformerTable.Voltage{1};
dvdtOut = transformerTable.dvdt{1};

ax1 = subplot(2,1,1);
plot(time,vOut),grid;
ylabel('Voltage (V)');
ax1.YLim = [-1000 1500];
ax1.XTickLabel = {};
ax1.Title.String = 'Transformer Primary Voltage';

ax2 = subplot(2,1,2);
plot(time,dvdtOut),grid;
ylabel('Voltage Derivative (V/s)');
xlabel('Time (s)');
ax2.Title.String = 'Transformer Primary Voltage Derivative';

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_ee_converter_dcdc_class_e.LDMOS

Time step for numerical differentiation, specified as a real number, in seconds. tau determines the interpolation grid as startTime:tau:endTime.

Example: 1e-9

Data Types: double

Start of the time interval for evaluating rates-of-change of voltage variables, 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 evaluating rates-of-change of voltage variables, 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

Time series of the voltage rates-of-change for each block, returned as a table. The first column lists all the logging nodes in node that are based on the foundation.electrical.electrical domain. The second column lists the terminal names. The third column lists the corresponding interpolated voltage values, in volts. The fourth column lists the corresponding numerically differentiated values of voltage rates-of-change, in volts per second. The table does not contain data for terminals that are held fixed.

Version History

Introduced in R2018b