Features of modeling on the basis of O-circuits. - Modeling of systems

Features of modeling based on O-schemes.

The mathematical support and resource capabilities of modern computers allow us to efficiently simulate various systems formalized as 0 ~ schemes y using either software packages created on the basis of algorithmic languages general purpose, or specialized languages ​​of simulation. But before applying these modeling automation tools, it is necessary to delve deeper into the essence of the process of constructing and implementing modeling algorithms [4, 7, 17, 23, 32, 46].

Fig. 8.5. Classification of methods for constructing modeling algorithms

Example 8.5. For a more detailed acquaintance with the technology of computer simulation, let us consider the 0-scheme of a rather general form shown in Fig. 8.6. In particular, we will analyze in this example, what effect the principle, which is the basis of its machine realization, has on the features of constructing the scheme of the modeling algorithm. The figure shows a three-phase & pound;) - circuit (ь - 3) with blocking the channels for output in the 1st and 2nd phases of maintenance ('dotted lines in the figure). As the output streams of such a 0-scheme, the flow of lost orders from H, and the flow of served orders from Ku | (#, and I 3 in Figure 8.6.)

For the simulation model of the considered pound-scheme , the following variables and equations can be written: endogenous variable P - probability of losing orders; exogenous variables: - the appearance time of the next

applications from AND; I *./- time for end of service by channel K *, ] of the next order, d-1, 2, 2; auxiliary variables: n and r *,/- states

H/and K *. /; /-12; 1, 2, 3; y-1, 2; Parameters: -capacity of the/th Hg I * -channel of channels in the to -th phase; 1 * - 2, state variables: N r is the number of lost applications in Hn - pure orders, that is, those coming from the 3 rd phase; The equation of the model is: P ~ M 1 /(Ы 1 + АГ 3 ) * ЛГ |/АГ.

When simulating the process of functioning () - scheme on a computer, it is required to organize an array of states. In this array, a subarray K must be allocated to store the current values ​​of r *./of the corresponding channels K *, y and the end-of-service time of the next request/*. /, 7 = 1,1 *, the subarray H for writing the current value of r, corresponding to the storage rings Hi, i = 1, 2; subarray and, in which the time of receipt of the next order r t from the source (AND) is recorded.

The procedure for modeling the maintenance process by each elementary channel K *./reduces to the following. By referring to a random number generator with a distribution law corresponding to the data service K *. /, the length of the service time is obtained and the service end time/*/is calculated, and then the state 2 *,/= 1 is fixed; at the time of liberation 2 *./= 0; in the case of blocking K *., is written r to .) = 2. When the application is received, a unit is added to its contents, i.e. 2/= 2y + 1 , and when the application leaves H, a unit is subtracted for maintenance, i.e., 2 { = r - 1.1 = 1, 2.

Deterministic modeling algorithm. The enlarged schema of the deterministic modeling algorithm of the f-scheme, i.e., the algorithm constructed on the "Ag" principle, is shown in Fig.

8.7. The specificity of having a constant step A/allows you to create hours system time in the form of an autonomous unit 10. This block serves for counting the system time, i.e., for calculating + Ai. To determine the stopping time in the simulation of the Q-cxem <( by the number of realizations N or along the length of the simulation time interval T) , the corresponding

Fig. 8.6. Example schema of the general view

conditions (block 5). The work of auxiliary blocks - input of initial data 7, setting of initial conditions 2, processing 11 and output of simulation results 12 - does not differ in essence from analogous blocks used in algorithms of computations on COMPUTER. Therefore, we will dwell in more detail on the work of the part of the modeling algorithm that reflects the specificity of the deterministic approach (blocks 4 - 9). Detailed diagrams of the algorithms of these blocks are shown in Fig. 8.8, a - e. On these and the following diagrams of modeling algorithms () - schemes the following notation is adopted:

гм (1) = 2ь г (к 9 1) = г к . TM = and TN =/ i , T (K, 1) = r to . l , b0 ( T) = and PO = p, N01 = N ^ 1 N03 = N3,

NO = N.

The procedure for servicing applications by channels K *. ^ is framed in the form

Fig. 8.7. Enlarged diagram of the deterministic modeling algorithm of the Q-scheme

subroutines WORK [K (K, J )], which allows you to refer to the random number generator with the corresponding K *, j distribution law, which generates the duration of the next service interval t k j. The procedure for generating requests by the source (I) is organized as a subroutine D ( TM ), which determines the moment of receipt of the next t m in the Q-scheme.

The end of the service of the application in some channel K *, j at time/"can cause the process of propagation of changes in the states of the elements (" special state ") of the system in the direction opposite to the movement of applications in the system, therefore all H and K systems should be viewed in the simulation from the serving channel of the last phase towards the 1st phase accumulator (see Figure 8.6).

After starting, entering the initial data and setting the initial conditions (blocks 1 and 2 in Figure 8.7), the condition for completing the system simulation (block 3) is checked. Then they proceed to simulate the maintenance of requests by the channel Kr, 1 of the 3rd phase of the scheme (Figure 8.8, a). If the maintenance in K 3 , 1 (operators 4.1 and 4.2) is terminated, then the output from the system of the next served request (operator 4.3) is fixed and the channel K 3 1 is released 4.4).

Next, a transition is made to the simulation of the operation of the channels of the second phase of the 0, -circuit (Fig. 8.8, b). In this case, the channels of this phase are sequentially viewed (operators 5.1, 5.9 and 5.10). Then, it is determined whether there are any requests waiting for service in the K3 channel in the channels of the 2nd phase. 1 (operators 5.2 and 5.3). If at the time/"there are applications requiring maintenance in K3. ь and this channel is free (operator 5.4), then one of the applications is selected in accordance with the service discipline and its service is mimicked. 1 (operator

Fig. 8.8. Schemes of algorithms for the block 3 (a), of the block 5 (b), the block b (c), block 7 (d) , block 8 (e), of the block 9 ( e) (Figure 8.7)

Continuation of Fig. 8.8

5.6), the employment of the 3rd phase channel (operator 5.7) is fixed and the channel of the 2nd phase is released (operator 5.8). If the channel is Ks. I is busy (operator 5.4), then the blocking of the 2nd phase channel (operator 5.5) is fixed.

Continuation of Fig. 8.8.

Then, the interaction in the process of servicing the orders in the drive and the channels of the 2nd phase is simulated sequentially for each of the channels (operators 6.1, 6.7 and 6.8 in Figure 8.8, a). Next, N 2 there are applications (operator 6.2) and free channels of the 2nd phase (operator 6.3), then the application maintenance is simulated by one of the free channels (operators 6.4, 6.5) and freeing up the storage in the storage H 2 (operator 6.6).

Then, the interaction of a particular channel of the 1st phase and the second phase accumulator H 2 is simulated (7.1, 7.2, 7.13 - 7.16 in Figure 8.8, d). For K (, ; , the presence of orders requiring services in/"is checked in them (operators 7.3 and 7.4) .If there are no free channels of the 2nd phase (operator 7.5) but there are free spaces in the storage (operator 7.6), then the recording of the application in H 2 (operator 7.7) and release of the specific channel of the 1st phase (operator 7.8) are simulated.If free places in H 2 , then blocking of the 1st phase channel is fixed (operator 7.9) If there are free channels of the 2nd phase, the request is serviced (operator 7.10) and the employment of one of the channels of the 2nd phase is fixed (operator 7.11) and release of one of the channels of the 1-st phase

Continuation of Fig. 8.8

(operator 7.12). Then the operators 7.3 and 7.4 are repeated, because simultaneously two phases can move from the 1st phase to the second. At the third execution of operators 7.13 and 7.14, the control will be passed by the condition Yes to the next block 8 (see Figure 8.7).

Then, the interaction in the process of servicing the orders in the drive and the channels of the 1st phase is simulated (operators 8.1, 8.7 and 8.8 in Figure 8.8, e). The necessity and serviceability of the channels K , ) applications from drive H, (operators 8.2 and 8.3). If in H! there are applications and one of them is free, then the service of the application is simulated in the 1st phase (operator 8.4), the employment of a particular channel is fixed (operator 8.5) and the release of one place in H 2 (operator 8.6)

Next, the interaction of the source (I) and the store of the 1st phase of the NW is simulated, taking into account the occupancy of the channels of this phase (Figure 8.8, e). In block 9 (see Figure 8.7) The operators of cycles are the operators 9.2, 9.6 - 9.9 (Figure 8.8, e). If an application is received from the I (operator 9.1), then it can be served in the presence of a free channel (operator 9.3) (operators 9.4 and 9.5), in the presence of a place in H x is queued (operators 9.10 and 9.11) or if there is no place in H 1 (its overflow) is lost (operator 9.12). After that, the time of receipt of the next order from the source r t (operator 9.13) is determined and the control is transferred to the block 10, which determines the moment of the next step/"(see Fig. 8.7).

The control is then transferred back to the 3 block (Figure 8.7), which, when typing the necessary statistics, processes and outputs simulation results, and then stops modeling ( 11 and 12).

thematic pictures

Also We Can Offer!

Other services that we offer

If you don’t see the necessary subject, paper type, or topic in our list of available services and examples, don’t worry! We have a number of other academic disciplines to suit the needs of anyone who visits this website looking for help.

How to ...

We made your life easier with putting together a big number of articles and guidelines on how to plan and write different types of assignments (Essay, Research Paper, Dissertation etc)