Index Matrix-Based Modeling and Simulation of Buck Converter

: The approach described in this paper handles the parameters and characteristics (analog and discrete ones) of a Buck DC-DC converter (in its power and control parts) in a common manner. The usage of probably complicated di ﬀ erential equations for discrete dynamical systems is avoided by means of index matrix equations, which can be easily understood. Compared to classical matrix models, the proposed index matrix models are more descriptive and also smaller in size. Such functionality is widely applied by the authors, and a new operation is de ﬁ ned and used as well. The relevance of the proposed techniques in power electronics, because of switching topologies and a limited numbers of components, is argued. Respective examples of functioning modes of the considered converter, in which power circuits and controllers are modeled jointly, are given. Estima-tions of analog values are based on partly linear dependencies, which are shown to be adequate in ﬁ rst-order analyses. Speci ﬁ c expressions for a Buck DC-DC converter are presented. A model-solv-ing technique and an exhaustive search on a parameter space are considered in detail and automated via well-formalized algorithms. Nested parameter intervals and veri ﬁ cations with normal probability distributions are used in an optimization procedure. The full agreement of implementation via MATLAB source code with results obtained via Simulink is demonstrated. The short simulation times of this software (compared to Simulink and a .NET desktop application developed by the authors) justify the search for optimal variants in a wide multi-dimensional space. A max–min procedure with 10,000 simulations in each veri ﬁ cation step is presented.


Introduction
Due to the growing need to convert electricity with electronic means, pоwer electronics is a rapidly developing field.This fact requires new developments and an improvement in the tools used to obtain the optimal design of power electronic devices and systems.On the other hand, because of the presence of power and control parts (controllers), which are quite different and mutually influence and complement each other, in many approaches, electronic converters are not susceptible to modeling as a whole unified system.One of the main purposes of the authors' papers has been to present a joint technique based on the apparatus of index matrices [1,2].
First-order time-invariant dynamical systems are often used as modeling tools [3,4].Discrete dynamical systems are represented in [5] via equations with constant classical matrices, and this approach does not differ significantly from well-known control system engineering methods, in which derivatives of state variables are written as linear combi-nations of system states and inputs [4,6].Both of the aforementioned techniques determine a simple stability analysis of discrete or analog values in multi-input-multi-output systems, including in power electronic devices [7,8].
In [9], two ideal switches, which work synchronously in a Boost DC-DC converter, determine two functioning modes, and, therefore, two different constant matrices in a process of discrete dynamical modeling.In the present paper, each switch is considered to have two modes too, but the transistor and the diode work out of sync.Such a principle requires variants to be checked and, similarly, determines the exponential dependence of the number of variants on the number of switches [1].However, the latter is not large in power electronic devices; in the following sections, the transistor and the diode determine four modes.Generally, the switching topologies in power converters do not allow аn analysis based on constant matrices or constant differential equations.Therefore, computer simulations are widely used; for example, the graphical programming environment Simulink, which is shown in the present paper in a comparison, provides a set of solvers and has power electronic tools [10].
A feature that dynamical systems have in common is that they are all simulated by estimating states at consecutive model time moments.The obtainment of values on system states (which usually are presented by one-dimensional or multi-dimensional arrays) is known as model solving.No single solving method is optimal for all systems.For example, a typical power conversion system is constituted by subsystems, which have very different levels of detail [11,12].However, in the present paper, index matrix equations are used in the configuration of electronic components.The discretization step in the algorithm proposed in Section 4 is chosen to be constant; it is obvious that decreasing it increases the accuracy and vice versa (similar dependences are demonstrated in a figure in Section 4).Values on system states are estimated at regular model time intervals from the beginning to the end of the simulation; i.e., a fixed-step solver is constructed.Moreover, the index matrix describing system states can vary in size according to a new kind of multiplication, which is defined for the first time in the present article.
Index matrices (this concept was introduced in 1984) extend classical matrix functionality; their properties have been studied and summarized in [13,14]; basic notes are given in Section 2, too.The index matrices extend the concept of the classical matrices and provide clear correspondence between their elements and indices.Different types of their elements have been proposed; in the present paper, real numbers are used.The index matrices are mainly connected to generalized nets, in which index matrices are basic components [15,16].Applications of index matrices concern mathematical and real-life objects, for example, databases, but the usage of this apparatus in the modeling of electrical circuits is very rare.A full review of their applications is unpublished as of yet.Indeed, for a long time, they have been used with Boolean values and integers only as an auxiliary tool in generalized net transitions.
Data structures, which implement index matrices in the programming class In-dexMatrix, are demonstrated in [1].There are implementations of all operations from Section 2, except the new one, in this class too.The .NET application, which is presented in [1], concerns analog and digital electronic components and circuits, model solvers, graphics, etc.Its basic feature is the shorter simulation duration compared to Simulink; it has about a 20 times shorter runtime in the case of the considered buck converter and about a 10 times shorter runtime in the case of a three-phase converter.Generally, all model-based design techniques require many simulations [17,18]; the optimization algorithm from Section 5 uses a large number of simulations in a verification process.
The approach discussed In this paper is implemented via MATLAB source code [19].This choice is natural because classical matrices are presented in the algorithm from Section 4. The core functionality of MATLAB is closely related to matrix manipulation.The obtained runtimes ensure the model's ability to perform exhaustive searches; this fact is a prerequisite for the application of artificial intelligence techniques, too [2].The simulation durations of this implementation, as well as those in the cases of the discussed .NET application and Simulink, are given in Section 6.

Basic Definitions of Index Matrices with Real Number Elements
All index matrices with real numbers as elements (R-IM) [13,14] have the form with index sets (called the first and second one, respectively) In the present paper (as well as in [1]), the following notations of K and L are used: The usual graphical representation of the above index matrix form is Lines divide indices from elements.All indices from the index set are used like lower indices, too.Each element is positioned in the same row with the index which is identical to its first lower index and in the same column with the index which is identical to its second lower index.The ordering of the indexes explicitly determines the ordering of the elements.Swaps of rows or columns (along with the indexes) of an index matrix do not change it.For comparison, in the classical matrices, row and column indexes are implicitly used, and any swap of elements must generally correspond to respective swaps in other objects in order dependencies (for example, in matrix equations) to be preserved.
Authors' notations of index and classical matrices are proposed here; they lead to clear expressions, those in algorithms (1), (2) and respectively (4) can be represented by a classical matrix (which is denoted by "CM" in the present paper) and ordered sets where U and V are permutations of ( ) ( )

2
I A , respectively.There are m !n !options for (5) according to all permutations in (6).It is important to note that these variants differ only by ordering.The inverse notation A is also used in the present paper.
Brief notes of basic operations (summation, multiplication, transposing and projecting of index matrices-see [12,13]) are given below in order of specific usages (for example, in summation with non-intersecting index sets) and a new definition of a multiplication to be argued.
An example of a transpose R-IM is  ( ) Here, all elements of A and B are presented in different parts of The product of A and B

(
) is an R-IM, too.Formally, all classical matrix products can be represented by a proper case of the upper R-IM product, for which ≡ L P (see the sum in its common form).
A new kind of an R-IM product is defined below by the authors: It reduces  A B according to its rows (the first index sets of A and ⊗ A B are identical): ( ) The following statements hold: Examples of the new R-IM multiplication are given in the next sections.

Models of Electronic Components
Models of basic electronic components are given below.Similar but simpler ones are described in [1], in which ideal components are used; additional resistances and potential barriers are taken into account below.
Let time set Θ with sampling step Δt and discretization frequency d F be given under the following restrictions:  indicate voltages (with "u") and amperages (with "i") in current ( ∈ Θ t , marked by "cu") and previous ( − t Δt , marked by "pr") time moments.This notation is used by the authors in [1] too; index matrix where о is a common index, contains all these four indexes.The R-IM equation ( O is a zero R-IM-its only element is equal to zero) determines equality which is an approximation of differential equation Equation ( 21) is based on the new R-IM multiplication (14).For comparison, Similarly, in case of a capacitor with capacitance C and additional resistance C R approximation can be presented by In the same manner, index matrix C X (t) with four elements (see (20)) and an analog of Equation ( 21) can be formed.
The presented approach can be extended to other power components from Figure 1, and common index matrices can be constructed: Abbreviation "PCs" means "power components" (all of the last ones, which are presented below, are two-terminal except the transistor).T out F (t) and T out X (t) concern the transistor in its emitter-collector junction.
The next R-IM models the diode functioning: It leads to the following statements: Here, 0 D U and D R denote a threshold voltage (a potential barrier) and a dynamic resistance, respectively.The next R-IM models the transistor emitter-collector junction functioning: (31) Similarly to the diode model, it determines the following statements: The following equations (see ( 27) and ( 28)) can be used with the upper R-IMs: The components of the considered control circuit (see Figure 1) can be modeled by R-IMs in a similar manner [1].The subtraction block with target voltage Target U , the proportional-integral (PI) controller and the pulse-width modulation (PWM) block are presented by Sub F , PI F and PWM F (t), respectively, below: where ( ] is a triangular function with period 1 and amplitude . The two cases of index matrix (40) determine digital signal (43)

Models of Component Connections and Electronic Circuits
In [1], nodes and loops are modeled according to Kirchhoff's laws.The respective sums of R-IMs in case of the present paper are The first one models nodes according to Kirchhoff's current law, and the second one models loops according to Kirchhoff's voltage law.The upper R-IMs are constructed in order conditions ( ) ( ) to be satisfied, where N U , N V , P U and P V are permutations of the index sets of N F or P F (see ( 5) and ( 6)).Here and below, ( ) rank A denotes the rank of classical ma- trix A, and S denotes the cardinality of set S.
( ) represent the considered power circuit with its components and junctions.In order to create a more compact model, the following function of R-IM ( ) For example (see (19) and ( 20)), ( ) The upper index matrices, whose identifiers start with "F", together with the considered function uniquely define the presented power circuit.
Other common statements on analog values are ( ) ( ) ( ) The abbreviation "CCs" means "control components".Their connections (including ones with power components) which concern analog values are presented in represent the considered analog control circuit with its components and junctions in a proper manner.R-IMs and their equations can be aggregated in Dependencies on digital signals are presented in under conditions (41) and ( 42).An R-IM equation based on

( )
Digital All F t , similar to this one in (58), can be constructed: R-IMs and their equations can be aggregated in The upper statements form a clear mathematical model, which is solved in the next section.However, ( ) In the last equation, the following equivalencies are used: Six classical matrices based on { } ∈ h cu, pr, o can be defined (see (5) and ( 6)): where . are permutations of ( ) ( ) , respectively.Since ( ) is a unit matrix, (67) and (69) derive the following equation: In case of nonsingular square matrix ( ) According to (65) in the discussed example, B(t) has 17 rows and 5 columns, and J(t) has 17 rows and 1 column.They uniquely define all voltages and amperages of ana- log components.Index sub-matrices can be used, too: Such an approach is basic in one of the presented algorithms, in which I depend on ( ) ( ) A scheme according to the conditions is given below: (relation " ⊇ " on index matrices is presented in ( 9)).The upper variants of ( ) ( ) ( )

Model-Solving Algorithm
An algorithm (Algorithm 1), which is presented in case of the considered example, is given below.Its first three steps are implemented once, and its next three steps are performed cyclically until statement ≤ end t t holds.

Algorithm 1: Single simulation of device functioning
Step 1: Specifying a time interval and a time step Let the functioning of the model be simulated in time set (18) with a proper initial time 0 t (for a convenience, it is set to zero below) and a proper time step Δt .It is appropriate for the end model time end t to be used, too.The choice of Δt determines a proper accuracy; Figure 2 shows the results of simulations depending on this choice (relative to a switching interval).
Step I must be set.In case of zero values of voltages and amperages at 0 t for the power components of the considered DC-DC converter, the following R-IM can be used: holds.
Step 3: Specifying constant R-IMs Such R-IMs are calculated in advance and explored in the next steps.
Four variants of ( ) Analog All F t are described in (76)-(79).The following variants of index matrices from (73) can be presented: Step 4: Current time setting Add Δt to current time t.
Step 5: Calculation of digital values Generally, these values depend on analog and other digital values.All described analog values are continuous; small values of Δt determine near their values, which can be used like replaceable ones.An interrelation between digital values has been described in (81).For the considered converter, the signal at the input of the presented PWM block is continuous, and PWM in (ψ) u for current time t is modeled by either the inequalities in (76) hold, then the following assignments must be implemented: , all analog values can be investigated.On each iteration, elements of ′ I can be modified under constraints in (83) in order for proper sets of current voltages and amperages to be esti- mated.
Step 7: Time check

If
≤ end t + t Δt holds, then Steps 4, 5 and 6 must be performed; otherwise, the algorithm must be terminated.

Single Simulation Results
Figure 2 presents output voltage simulation results for the considered converter.Algorithm 1 is implemented through MATLAB source code (without Simulink to be used).In case of Figure 2b-d, the described model varies on a sampling frequency (relative to a switching frequency).А comparison with the MATLAB Simulink model (see Figure 2a) has been made.The simulations are performed with the following parameters: The full meaning of these parameters is given in ( 19), ( 26), ( 29), (32), ( 35) and ( 38 graphs in Figure 3) in order for the similarity between cases to be shown more clearly.Characteristics of the output signal are defined below.The maximum ( ) (s denotes the performed simulation) for the whole time interval and the deviation for an end part of this interval are estimated (notation is used here).Statements

Optimization
An iterative algorithm, which determines parameter intervals in order for the proper output voltage requirements to be met, is given below (Algorithms 2 and 3).

Algorithm 2: Determining final parameter intervals at once
Step 1: Specifying fixed parameters Let the input voltage, the target voltage, the output resistance, the switching frequency and the simulation duration be fixed through (in this case, ≈ end 0.1 ms 0.9 t ), and let the additional parameters in (91) and (92) have the same constant values.
Step 2: Specifying output voltage requirements For the described DC-DC converter, the following requirements are taken (see ( 94)-( 96)): Step 3: Specifying initial parameter intervals Let the parameters from (93) vary in order for minimal values of s R, max U and Δ s R end U to be obtained, and let their initial values be in the following ranges: Step 4: Simulations with constant parameter intervals Simulations, which use random uniformly distributed values according to (100), must be implemented.They are performed until the number of "successful" ones (in this context, the requirements from (99)) is lower than Successful n .In the present paper, (see Figure 3).In case of the initial intervals, the number of all simulations is 939 (the results are presented in Figure 3a).Nested parameter intervals have been used in this algorithm, and the number of simulations presented in Figure 3b is 214 (the number of "successful" ones is equal to Successful n , too).The next respective numbers of simulations are 185, 178 and 113.The 23rd simulation has 50; i.e., it is equal to Successful n .However, 38 variants of parameter intervals are used in order for 10 % parameter tolerances to be obtained (see ( 108)-( 110)).Distributions for "successful" simulations are presented in the second and third columns in Figure 3.
Step 5: Determining nested intervals The following intervals can be defined: The intervals are updated according to "successful" simulations only.Let present the values of parameter ω in such simulations in an ordered manner.
In case of the initial ranges, which are presented in (100) and Figure 3a, new intervals are formed by They are shown with red lines in Figure 3a and are used in the next iteration (see the ranges of the parameters in Figure 3b).
In case of the next (non-initial) intervals, a single element μ from Ω is selected in order for the new interval .A pair containing an interval and a ratio is defined for each ω ∈ Ω : ( ) (105) where x denotes the integer part of x.Parameter μ is selected in order for the following equality to be satisfied: is updated at the second iteration to 1.405 μΗ (since = 10 % λ of 50 is equal to 5, the parameter range is reduced on the base of the highest 5 values on induction-see the second graph on Figure 3b).
Step 6: Termination check In practice, the parameters can be realized with given tolerances.In the present paper, in order for sufficiently distinguishable graphics to be obtained (see Figure 4b,c).The current simulation series index is initialized by i = 1 (111) Step 2: Applying an algorithm with a fixed input voltage and a fixed output resistance Algorithm 2 must be applied. Step The magenta dotted line on Figure 4a presents the resulting curve from (114).
Step 4: Increasing the current number of simulation series Increment the current simulation series index by 1.
Step 5: A check on the current number of simulation series If ≤ i m holds, then Steps 2, 3 and 4 must be performed; otherwise, the execution of these steps must be terminated.
Step 6: Choosing an optimal parameter intervals It is obvious that m simulation series have been performed in the previous steps.Different levels (114) have been obtained.Optimal final parameter intervals, which correspond to a proper based on the simulation series with the lowest level (116) must be chosen; here In the present paper This process is shown in Figure 4b,c, where 10 lines (one continuous and nine dotted ones) present variants of the dotted curve from Figure 4a.The red ones represent simulations, for which the following statement holds: The blue ones represent simulations, for which and the line, which corresponds to the simulations with an optimal parameter intervals (see (117)), is continuous.Generally, the discussed example gives the following constraints:  depending on the last two parameters (with one constant parameter) are given in Figure 5. Algorithm 3 can be modified in order for various input voltages and output resistances to be used simultaneously, too.In this case, random normally distributions on these parameters with means and standard deviations can be used in Step 3 of the algorithm.The respective results are presented in Figure 6.The notations in Figure 6a are the same as the ones in Figure 4b where 10 lines (one continuous and nine dotted ones) present 10 variants.Since three graphs in Figure 6a  In [20], conventional methods estimate the inductance L and the minimal capacitance min C in a similar Buck DC-DC converter in the following manner: ( ) ( )  The main advantage of PI controllers is that they can be implemented without detailed knowledge of systems.Algorithms of tuning PI controllers are presented in [21].They consider devices that are regulated as black boxes.Therefore, they cannot change parameters L and C. Generally, estimations of p K and i K are empirically based on the simulation of a large number of simulations in these conventional algorithms.There exist well-established approaches to derive initial coefficients.The Ziegler-Nichols method is used below in order for a PI controller to be tuned [21,22].The parameters obtained in Algorithm 3 are used (see Figure 3c):

Simulation Duration
Three software applications modeling the discussed power converter are as follows: the Simulink model from Figure 1 and two index matrix-based models: the .NET one (which is described in [1]) and MATLAB one (which implements the algorithms from the previous two sections using MATLAB source code without using Simulink).Their runtimes are shown in Table 1.There is a slight difference in the .NET model: ideal switches have been used; all programming methods defined in the .NET software are presented in [1].A single simulation of the converter operation is taken into account when calculating the durations.Each runtime considers both the time to run the simulation and the time to configure the model.For example, the Simulink model runtime is formed as a sum of execution times of two functions: set_params() and sim().

Conclusions
The proposed new definition of an R-IM product guarantees convenient index matrix equations with zero R-IM on the right-hand side.Index sets can determine which analog values should be calculated at any time in the model; additional values do not affect the calculation procedure.
The simulations produce results that are virtually identical to those from Simulink.At the same time, large changes in the ratio between the sampling rate and switching frequency keep the output characteristics almost unchanged.Threshold voltages (potential barriers) and dynamic resistances have been successfully included in the models.
The performed optimization procedures based on exhaustive searches with nested intervals give very good results-small peaks and small deviations after settling.It is shown that when the choice of inductance and capacity is made, the tuning of the PID controller by means of the proposed algorithm is close to that which has been achieved with conventional methods.
The discussed MATLAB implementation based on the pre-computation of indexed matrices and the selection of variants results in small computation times.

Figure 1 .
Figure 1.Simulink model of buck DC-DC converter with PI controller.

Figure 2 .
Figure 2. Output voltage simulation results for Simulink and the proposed R-IM-based software.Modeling with (a) Simulink; (b) R-IM-based software with ratio / 600 = s d F F ; (c) R-IM-based )-(40); the uncommented ones are as follows: Target U -the output target voltage; p K and i K -the coefficients for proportional and integral terms in a PI controller.A step response on the output is presented on Figure 2. The last one displays the fact that large changes in the / s d F F ratio keep this step response almost unchanged.Initial values from (82) and time = end t 0.9 ms are used.The graphs are zoomed (see whole

Figure 3 .
Figure 3. Simulation results for an output voltage, parameter distributions (for "successful" cases) and nested parameters.Intervals in an optimization procedure: (a) at the first iteration; (b) at the second iteration; (c) at the 39th iteration.
10,000 simulations for normally distributed parameters from intervals with at least 10% tolerance for L,

Figure 4 .
Figure 4. Tolerance simulation results according to Algorithm 3: (a) on Step 3; (b) on Step 6; (c) on Step 6 in a zoom mode.The final parameter intervals have been obtained with a fixed input voltage of 20 V and a fixed output resistance of 100 Ω.Such intervals (based on these two values) are used below, but different input voltages and output resistances are used in Algorithm 3. Graphs of characteristic
018 V , only seven graphs are presented in Figure6b.The discussed example gives the following constraints: of 10,000 simulations.Normal distributions of the input voltage and the output resistance under conditions (123) with parameters defined by used in these calculations.fora Buck DC-DC converter without a PI controller ( ) from the values given in Figure3c.Indeed, p K and i K have not been taken into account here (there is not a PI controller in the Buck DC-DC converter presented in[20]).Output voltage simulation results for the scheme, which is considered in the present paper, are shown on Figure7.They are based on (126) and (127) with Δ = fixed values of L and C has been performed in the calculation of optimal values of the coefficients for the proportional and the integral terms in the PI controller.

Figure 7 .
Figure 7. Output voltage based on an inductance and a minimal capacitance both determined.
at first; the value of P starts from 0 and increases until the system starts to show consistent and stable oscilclose to these ones in Figure3c.The results are presented in Figure8.

Figure 8 .
Figure 8. Tuning PI controller according to Ziegler-Nichols method.Graphics with: = p K 32 , is not applied explicitly, whereas variants of Ft can be divided by columns to three R-IMs in the following way: Are applied.Otherwise, if inequality (109) does not hold for any new interval in Step 4, the algorithm is terminated.For the presented example, after the last allowed parameter changes, the ranges of the parameters (see Figure3c) are

Table 1 .
Runtimes of software applications modeling Buck DC-DC converter.Runtimes for Simulink and .NET models determine the following linear regressions: are measured in milliseconds.These expressions indicate the presence of a significant configuration time in these two models, especially for the first one.Here and below, model time t denotes a duration of model time.For the third model: i.e., the runtime is proportional to the model time duration (this fact is conditioned by the pre-calculation of matrices-see Sections 4.1 and 4.2).There are commensurate coefficients (48 and 33 approximately) in the .NET and MATLAB models.