Setting up hardware and software

Algorithmization of systems functioning processes. Formalization and algorithmization of systems functioning processes - document Description of the mathematical model

FORMALIZATION AND ALGORITHMIZATION OF THE SYSTEMS OPERATION PROCESS

SEQUENCE OF DEVELOPMENT AND MACHINE IMPLEMENTATION OF SYSTEM MODELS

With development computer technology the most effective research method large systems machine modeling has become, without which it is impossible to solve many major national economic problems. Therefore, one of the urgent tasks of training engineers is to master the theory and methods of mathematical modeling, taking into account the requirements of systematicity, allowing not only to build models of the objects under study, analyze their dynamics and the ability to control machine experiments with the model, but also to judge, to a certain extent, the adequacy of the created models for the systems under study , about the limits of applicability and correctly organize the modeling of systems using modern computer technology.

Methodological aspects of modeling. Before considering the mathematical, algorithmic, software and applied aspects of machine modeling, it is necessary to study general methodological aspects for a wide class of mathematical models of objects implemented on computer technology. Simulation using computer technology allows one to study the mechanism of phenomena occurring in a real object at high or low speeds, when in full-scale experiments with an object it is difficult (or impossible) to monitor changes occurring over a short time, or when obtaining reliable results involves a long period of time. experiment. If necessary, the machine model makes it possible to “stretch” or “compress” real time, since machine modeling is associated with the concept of system time that is different from real time. In addition, using machine modeling in an interactive system, it is possible to train personnel working with the system to make decisions in managing an object, for example, when organizing a business game, which allows them to develop the necessary practical skills for implementing the management process.

The essence of machine modeling of a system is to conduct an experiment on a computer with a model, which is a certain software complex that formally and (or) algorithmically describes the behavior of system elements S in the process of its functioning, i.e. in their interaction with each other and the external environment E. Machine modeling is successfully used in cases where it is difficult to clearly formulate a criterion for assessing the quality of a system’s functioning and its purpose cannot be fully formalized, since it allows one to combine the software and hardware capabilities of a computer with a person’s ability to think in informal categories. In the future, the main attention will be paid to modeling systems on mainframe computers as the most effective tool for research and development of systems at various levels.

User requirements for the model. Let us formulate the basic requirements for the model M process of system functioning S.

    The completeness of the model should provide the user with the opportunity to obtain the required set of estimates of the system characteristics with the required accuracy and reliability.

    The flexibility of the model should make it possible to reproduce various situations when varying the structure, algorithms and parameters of the system.

    The duration of development and implementation of a large system model should be as minimal as possible, taking into account the limitations on available resources.

    The structure of the model should be block-based, i.e., allow the possibility of replacing, adding and excluding some parts without redoing the entire model.

    Information support should provide an opportunity efficient work models with a database of systems of a certain class.

    Software and technical means should provide efficient (in terms of speed and memory) machine implementation of the model and convenient communication with it for the user.

    It should be possible to carry out targeted (planned) machine experiments with a system model using an analytical-simulation approach in the presence of limited computing resources.

Taking these requirements into account, let us consider the main provisions that are valid when modeling systems on a computer S, as well as their subsystems and elements. When simulating a system S the characteristics of its functioning process are determined based on the model M, constructed based on the available initial information about the modeling object. Upon receipt new information about an object, its model is revised and refined taking into account new information, i.e. the modeling process, including the development and machine implementation of the model, is iterative. This iterative process continues until the model is obtained M, which can be considered adequate within the framework of solving the stated problem of research and design of the system S.

Computer modeling of systems can be used in the following cases:

a) to study the system S before it is designed, in order to determine the sensitivity of characteristics to changes in the structure, algorithms and parameters of the modeling object and the external environment;

b) at the system design stage S for analysis and synthesis of various system options and selection among competing options that would satisfy a given criterion for assessing the effectiveness of the system under accepted restrictions;

c) after completion of the design and implementation of the system, i.e. during its operation, to obtain information that complements the results of full-scale tests (operation) of the real system, and to obtain forecasts of the evolution (development) of the system over time.

There are general principles that apply to all of the above cases of machine modeling. Even in cases where specific modeling methods differ from each other and there are various modifications of models, for example in the field of machine implementation of modeling algorithms using specific software and hardware, in the practice of modeling systems, general principles can be formulated that can form the basis of the methodology machine modeling.

Stages of system modeling. Let's consider the main stages of system modeling S, which include: construction conceptual model systems and its formalization; algorithmization of the system model and its machine implementation; obtaining and interpreting system simulation results.

Rice. 1. Interrelation of stages of system modeling

The relationship between the listed stages of system modeling and their components (substages) can be presented in the form of a network diagram shown in Fig. 1. Let us list these substages: 1.1 - formulation of the problem of machine modeling of the system; 1.2 - analysis of the system modeling problem; 1.3 - determination of requirements for initial information about the modeling object and organization of its collection; 1.4 - putting forward hypotheses and making assumptions; 1.5 - determination of model parameters and variables; 1.6 - establishing the main content of the model; 1.7 - justification of criteria for assessing the effectiveness of the system; 1.8 - definition of approximation procedures; 1.9 - description of the conceptual model of the system; 1.10 - checking the reliability of the conceptual model; 1.11 - preparation of technical documentation for the first stage; 2.1 - construction logic circuit models; 2.2 - obtaining mathematical relationships; 2.3 - checking the reliability of the system model; 2.4 - selection of computing tools for modeling; 2.5 - drawing up a plan for performing programming work; 2.6 - building a program diagram; 2.7 - checking the reliability of the program diagram; 2.8 - programming the model; 2.9 - checking the reliability of the program; 2.10 - preparation of technical documentation for the second stage; 3.1 - planning a machine experiment with a system model; 3.2 - determination of requirements for computing facilities; 3.3 - carrying out working calculations; 3.4 - analysis of system modeling results; 3.5 - presentation of simulation results; 3.6 - interpretation of simulation results; 3.7 - summing up the simulation results and issuing recommendations; 3.8 - preparation of technical documentation for the third stage.

Thus, the system modeling process S boils down to the implementation of the listed sub-stages, grouped in the form of three stages. At the stage of constructing a conceptual model
and its formalization, a study of the modeled object is carried out from the point of view of identifying the main components of the process of its functioning, the necessary approximations are determined and a generalized diagram of the system model is obtained S, which is converted into a machine model
at the second stage of modeling by sequential algorithmization and programming of the model. The last third stage of system modeling comes down to carrying out working calculations on a computer according to the received plan using selected software and hardware, obtaining and interpreting the results of system modeling S taking into account the influence of the external environment E. It is obvious that when constructing a model and its computer implementation, upon receipt of new information, it is possible to revise previously made decisions, i.e. the modeling process is iterative. Let us consider the content of each stage in more detail.

BUILDING A CONCEPTUAL MODEL OF THE SYSTEM AND ITS FORMALIZATION

At the first stage of machine modeling - construction conceptual model
systems S and its formalization - the model is formulated and its formal scheme is built, i.e. the main purpose of this stage is the transition from a meaningful description of the object to its mathematical model, in other words, the formalization process. Simulation of systems on a computer is currently the most universal and effective method for assessing the characteristics of large systems. The most important and least formalized moments in this work are drawing the boundary between the system S and the external environment E, simplifying the description of the system and building first a conceptual and then a formal model of the system. The model must be adequate, otherwise it is impossible to obtain positive modeling results, i.e., studying the process of system functioning on an inadequate model generally loses its meaning. Under adequate model we will understand a model that, with a certain degree of approximation, is at the level of understanding the system being modeled S by the model developer reflects the process of its functioning in the external environment E.

Transition from description to block model. It is most rational to build a model of the system’s functioning according to the block principle. In this case, three autonomous groups of blocks of such a model can be distinguished. Blocks of the first group represent a simulator of environmental influences E per system S; blocks of the second group are actually a model of the process of functioning of the system under study S; blocks of the third group- auxiliary and serve for machine implementation of blocks of the first two groups, as well as for recording and processing simulation results.

Let us consider the mechanism of transition from a description of the process of functioning of some hypothetical system to a model of this process. For clarity, we introduce the idea of ​​describing the properties of the system functioning process S, i.e. about its conceptual model
How a collection of some elements, conventionally depicted by squares as shown in Fig. 2, A. These squares represent a description of some subprocesses of the studied process of system functioning S, environmental influences E etc. The transition from a description of a system to its model in this interpretation comes down to excluding from consideration some minor elements of the description (elements 5-8, 39-41, 43-47 ). It is assumed that they do not have a significant impact on the course of the processes studied using the model. Part of the elements ( 14, 15, 28, 29, 42 ) replaced by passive connections , reflecting the internal properties of the system (Fig. 2, b). Some of the elements 1-4, 10, 11, 24, 25 replaced by input factors X and environmental influences . Combined replacements are also possible: elements 9, 18, 19, 32, 33 replaced by passive communication and environmental influences E . Elements 22, 23, 36, 37 reflect the impact of the system on the external environment u.

Rice. 2. System model: A - conceptual; b - block

Remaining elements of the system S grouped into blocks
, reflecting the process of functioning of the system under study. Each of these blocks is quite autonomous, which is expressed in the minimum number of connections between them: The behavior of these blocks must be well studied and for each of them a mathematical model has been built, which in turn can contain a number of subblocks. Built block model process of functioning of the system under study S is intended to analyze the characteristics of this process, which can be carried out during the machine implementation of the resulting model.

Mathematical models of processes. After moving from the description of the modeled system S to her model
, built on the block principle, it is necessary to build mathematical models of the processes occurring in various blocks. A mathematical model is a set of relationships (for example, equations, logical conditions, operators) that determine the characteristics of the system’s functioning process S depending on the structure of the system, behavior algorithms, system parameters, environmental influences E, initial conditions and time. The mathematical model is the result of formalizing the process of functioning of the system under study, i.e. constructing a formal (mathematical) description of the process with the degree of approximation to reality necessary within the framework of the research being conducted.

To illustrate the possibilities of formalization, let us consider the process of functioning of a certain hypothetical system S, which can be divided into T subsystems with characteristics, with parameters, in the presence of input influences and environmental influences. Then a system of relations of the form can serve as a mathematical model of the process

(1)

If functions
were known, then relations (1) would turn out to be an ideal mathematical model of the process of system functioning S. However, in practice, obtaining a model is sufficient simple type for large systems it is most often impossible, therefore the process of system operation is usually S are broken down into a number of elementary subprocesses. In this case, it is necessary to divide it into subprocesses in such a way that the construction of models of individual subprocesses is elementary and does not cause difficulties during formalization. Thus, at this stage, the essence of formalization of subprocesses will consist in the selection of standard mathematical schemes. For example, for stochastic processes these can be schemes of probabilistic automata (P-schemes), queuing schemes (Q-scheme) etc., which quite accurately describe the main features of real phenomena that make up the subprocesses, from the point of view of the applied problems being solved.

Thus, formalizing the process of functioning of any system S must be preceded by the study of its constituent phenomena. As a result, a meaningful description of the process appears, which represents the first attempt to clearly outline the patterns characteristic of the process under study and the formulation of the applied problem. A meaningful description is the source material for subsequent stages of formalization: constructing a formalized diagram of the process of system functioning and mathematical model this process. To model the process of system functioning on a computer, it is necessary to transform the mathematical model of the process into an appropriate modeling algorithm and computer program.

Sub-stages of the first modeling stage. Let us consider in more detail the main substages of constructing a conceptual model
system and its formalization (see Fig. 1).

1.1. Statement of the problem of machine modeling of the system. A clear formulation of the problem of studying a specific system is given S and the focus is on issues such as: a) recognizing the existence of the problem and the need for machine modeling; b) choosing a method for solving a problem, taking into account available resources; c) determining the scale of the task and the possibility of dividing it into subtasks.

It is also necessary to answer the question about the priority of solving various subtasks, to evaluate the effectiveness of possible mathematical methods and software and hardware for solving them. Careful consideration of these questions allows us to formulate the research problem and begin to implement it. In this case, it is possible to revise the initial formulation of the problem during the modeling process.

1.2. Analysis of the system modeling problem. Carrying out an analysis of a problem helps to overcome difficulties that arise in the future when solving it using the modeling method. At the second stage under consideration, the main work comes down to conducting an analysis, including: a) choosing criteria for assessing the effectiveness of the system’s functioning process S; b) determination of endogenous and exogenous variables of the model M; c) selection of possible identification methods; G) performing a preliminary analysis of the content of the second stage of algorithmization of the system model and its machine implementation; e) performing a preliminary analysis of the content of the third stage of obtaining and interpreting the results of system modeling.

1.3. Determining the requirements for initial information about the modeling object and organizing its collection. After setting the problem of system modeling S the requirements for information are determined, from which the qualitative and quantitative initial data necessary to solve this problem are obtained. This data helps to deeply understand the essence of the problem and methods for solving it. Thus, at this substage the following is carried out: a) selection of the necessary information about the system S and external environment E; b) preparation of a priori data; c) analysis of available experimental data; d) selection of methods and means of preliminary processing of information about the system.

At the same time, it is necessary to remember that both the adequacy of the model and the reliability of the modeling results significantly depend on the quality of the initial information about the modeling object.

1.4. Making hypotheses and making assumptions. Hypotheses when constructing a system model S serve to fill the “gaps” in the researcher’s understanding of the problem. Hypotheses are also put forward regarding the possible results of system modeling S, the validity of which is verified during a machine experiment. Assumptions include that some data is unknown or cannot be obtained. Assumptions can be made regarding known data that do not meet the requirements for solving the problem. Assumptions make it possible to simplify the model in accordance with the selected level of modeling. When putting forward hypotheses and making assumptions, the following factors are taken into account: a) the amount of available information to solve problems; b) subtasks for which information is insufficient; c) restrictions on time resources to solve the problem; d) expected simulation results.

Thus, in the process of working with the system model S It is possible to return to this substage multiple times depending on the obtained modeling results and new information about the object.

1.5. Definition of model parameters and variables. Before moving on to the description of the mathematical model, it is necessary to determine the parameters of the system
, input and output variables
,
, environmental influences
. The ultimate goal of this substage is to prepare for building a mathematical model of the system S, functioning in the external environment E, for which it is necessary to consider all the parameters and variables of the model and assess the degree of their influence on the process of functioning of the system as a whole. The description of each parameter and variable must be given in the following form: a) definition and a brief description of; b) designation symbol and unit of measurement; c) range of change; d) place of application in the model.

1.6. Establishing the main content of the model. At this substage, the main content of the model is determined and a method for constructing a system model is selected, which are developed on the basis of accepted hypotheses and assumptions. In this case, the following features are taken into account: a) formulation of the system modeling problem; b) system structure S and algorithms of its behavior, influence of the external environment E; c) possible methods and means for solving the modeling problem.

1.7. Justification of criteria for assessing the effectiveness of the system. To assess the quality of the process of functioning of the simulated system S it is necessary to select a certain set of criteria for assessing efficiency, i.e., in a mathematical formulation, the problem is reduced to obtaining a relationship for assessing efficiency as a function of the parameters and variables of the system. This function represents the response surface in the studied region of changes in parameters and variables and allows you to determine the response of the system. System efficiency S can be assessed using integral or partial criteria, the choice of which depends on the problem under consideration.

1.8. Definition of approximation procedures. To approximate real processes occurring in the system S, Three types of procedures are usually used: a) deterministic; b) probabilistic; c) determining average values.

At deterministic procedure the simulation results are uniquely determined from a given set of input influences, parameters and system variables S. In this case, there are no random elements influencing the simulation results. Probabilistic(randomized) procedure used when random elements, including environmental influences E, influence the characteristics of the system functioning process S and when it is necessary to obtain information about the laws of distribution of output variables. Procedure for determining average values is used when, when modeling a system, the average values ​​of output variables in the presence of random elements are of interest.

1.9. Description of the conceptual system model. At this substage of building a system model: a) the conceptual model is described
in abstract terms and concepts; b) a description of the model is given using standard mathematical schemes; c) hypotheses and assumptions are finally accepted; d) the choice of procedure for approximating real processes when constructing a model is justified. Thus, at this substage, a detailed analysis of the problem is carried out, possible methods for solving it are considered, and a detailed description of the conceptual model is given.
, which is then used in the second stage of modeling.

1.10. Testing the validity of the conceptual model. After the conceptual model
described, it is necessary to verify the validity of some model concepts before moving on to the next stage of system modeling S. It is quite difficult to check the reliability of a conceptual model, since the process of its construction is heuristic and such a model is described in abstract terms and concepts. One of the model checking methods
- the use of reverse transition operations, which allows you to analyze the model, return to the accepted approximations and, finally, consider again the real processes occurring in the simulated system S. Validation of the conceptual model
should include: a) verification of the model's intent; b) assessment of the reliability of the initial information; c) consideration of the formulation of the modeling problem; d) analysis of accepted approximations; e) research of hypotheses and assumptions.

Only after thorough verification of the conceptual model
should proceed to the stage of machine implementation of the model, since errors in the model
do not allow obtaining reliable modeling results.

1.11. Drawing up technical documentation for the first stage. IN end of the conceptual model building stage
and its formalization, a technical report is drawn up for the stage, which includes: a) a detailed statement of the problem of system modeling S; b) analysis of the system modeling problem; c) criteria for assessing the effectiveness of the system; d) parameters and variables of the system model; e) hypotheses and assumptions adopted when constructing the model; f) description of the model in abstract terms and concepts; g) description of expected simulation results.

Sub-stages of the first modeling stage. Algorithmization of system models and their machine implementation

Computer science, cybernetics and programming

Forms of presentation of modeling algorithms Substages of the first stage of modeling Let us consider in more detail the main substages of constructing a conceptual model of the MC system and its formalization, see the formulation of the goal and statement of the problem of machine modeling of the system. A clear formulation of the goal and the formulation of the study of a specific system S are given and the main attention is paid to such issues as: a recognition of the existence of the goal and the need for machine modeling; b choosing a method for solving a problem, taking into account available resources; in definition...

Lecture 12. Substages of the first stage of modeling. Algorithmization of system models and their machine implementation. Principles of constructing modeling algorithms. Forms of representation of modeling algorithms

Sub-stages of the first modeling stage

Let us consider in more detail the main substages of constructing a conceptual model M K system and its formalization (see Fig. 3.1)

1.1. formulation of the goal and formulation of the problem of machine modeling of the system.A clear formulation of the goal and the formulation of the study of a specific system are given. S and focuses on issues such as: a) recognition of the existence of purpose and the need for machine modeling; b) choosing a method for solving a problem, taking into account available resources; c) determining the scale of the task and the possibility of dividing it into subtasks. During the modeling process, it is possible to revise the initial formulation of the problem depending on the purpose of the modeling and the purpose of the system’s functioning.

1.2. Analysis of the system modeling problem.The analysis includes the following questions: a) selection of criteria for assessing the effectiveness of the system functioning process S ; b) determination of endogenous and exogenous variables of the model M ; c) selection of possible identification methods;
d) performing a preliminary analysis of the content of the second stage of algorithmization of the system model and its machine implementation; e) performing a preliminary analysis of the content of the third stage of obtaining and interpreting the results of system modeling.

1.3. Determining the requirements for initial information about the modeling object and organizing its collection.After setting the problem of system modeling S the requirements for information are determined, from which the qualitative and quantitative initial data necessary to solve this problem are obtained. At this substage the following is carried out:
a) selection of necessary information about the system
S and external environment E ;
b) preparation of a priori data; c) analysis of available experimental data; d) selection of methods and means of preliminary processing of information about the system.

1.4. Making hypotheses and making assumptions.Hypotheses when constructing a system model S serve to fill the “gaps” in the researcher’s understanding of the problem. Hypotheses are also put forward regarding the possible results of system modeling S, the validity of which is verified during a machine experiment. Assumptions include that some data is unknown or cannot be obtained. Assumptions can be made regarding known data that do not meet the requirements for solving the problem. Assumptions make it possible to simplify the model in accordance with the selected level of modeling. When putting forward hypotheses and making assumptions, the following factors are taken into account: a) the amount of available information to solve problems; b) subtasks for which information is insufficient; c) restrictions on time resources for solving problems; d) expected simulation results.

1.5. Definition of model parameters and variables.Before moving on to the description of the mathematical model, it is necessary to determine the parameters of the system, input and output variables, influences of the external environment and assess the degree of their influence on the functioning of the system as a whole. The description of each parameter and variable must be given in the following form: a) definition and brief description; b) designation symbol and unit of measurement; c) range of changes; d) place of application in the model.

1.6. Establishing the main content of the model.At this substage, the main content of the model is determined and a method for constructing a system model is selected, which are developed on the basis of accepted hypotheses and assumptions. The following features are taken into account:
a) formulation of the goal and formulation of the problem of modeling the system;
b) system structure
S and algorithms of its behavior, influence of the external environment E; c) possible methods and means for solving the modeling problem.

1.7. Justification of criteria for assessing the effectiveness of the system.To assess the quality of the process of functioning of the modeled system, it is necessary to determine a set of criteria for assessing efficiency as a function of the parameters and variables of the system. This function represents the response surface in the studied region of changes in parameters and variables and allows you to determine the response of the system.

1.8. Definition of approximation procedures.To approximate real processes occurring in the system S, Three types of procedures are usually used: a) deterministic; b) probabilistic; c) determination of average values.

With a deterministic procedure, the simulation results are uniquely determined from a given set of input influences, parameters and system variables S. In this case, there are no random elements influencing the simulation results. A probabilistic (randomized) procedure is used when random elements, including environmental influences E, influence the characteristics of the system functioning process S and when it is necessary to obtain information about the laws of distribution of output variables. The procedure for determining average values ​​is used when, when modeling a system, the average values ​​of output variables in the presence of random elements are of interest.

1.9. Description of the conceptual model of the system.At this substage of building a system model: a) the conceptual model is described M K in abstract terms and concepts; b) the objective function is specified; c) a description of the model is given using standard mathematical schemes;
d) hypotheses and assumptions are finally accepted; e) the choice of procedure for approximating real processes when constructing a model is justified.

1.10. Testing the validity of the conceptual model.After the conceptual model M K described, it is necessary to verify the validity of some model concepts before moving on to the next stage of system modeling S. One of the model checking methods M K: the use of reverse transition operations, which allow one to analyze the model, return to the accepted approximations, and finally, consider again the real processes occurring in the simulated system. Validation of the conceptual model M K should include: a) verification of the model's intent; b) assessment of the reliability of the initial information; c) consideration of the formulation of the modeling problem; d) analysis of accepted approximations; e) research of hypotheses and assumptions.

1.11. Drawing up technical documentation for the first stage.At the end of the conceptual model building phase M K and its formalization, a technical report is drawn up for the stage, which includes:
a) detailed statement of the problem of system modeling
S; b) analysis of the system modeling problem; c) criteria for assessing the effectiveness of the system;
d) parameters and variables of the system model; e) hypotheses and assumptions adopted when constructing the model; f) description of the model in abstract terms and concepts; g) description of the expected results of system modeling
S.

3.3. Algorithmization of system models and their machine implementation

At the second stage of modeling, the stage of algorithmization of the model and its machine implementation, the mathematical model formed at the first stage is embodied in a specific machine model.

Principles of constructing modeling algorithms

System operation process S can be considered as a sequential change of its states in -dimensional space. Obviously, the task of modeling the process of functioning of the system under study S is the construction of functions z , on the basis of which it is possible to calculate the characteristics of interest in the process of system functioning. To do this, there must be relations connecting the functions z with variables, parameters and time, as well as initial conditions at the moment of time.

For a deterministic system, in which there are no random factors, the state of the process at a moment in time can be unambiguously determined from the relations of the mathematical model based on known initial conditions. If the step is small enough, then in this way it is possible to obtain approximate values z.

For a stochastic system, those. system influenced by random factors, a function of process states z at the moment of time and the relations of the model, determine only the probability distribution for at the moment of time. In the general case, the initial conditions can be random, specified by the corresponding probability distribution. In this case, the structure of the modeling algorithm for stochastic systems corresponds to a deterministic system. Only instead of a state, it is necessary to calculate the probability distribution for possible states.

This principle of constructing modeling algorithms is called principle. This is the most universal principle that allows us to determine the sequential states of the system functioning process S at specified intervals. But from the point of view of computer time costs, it sometimes turns out to be uneconomical.

When considering the processes of functioning of some systems, one can find that they are characterized by two types of states: 1) special ones, inherent in the process of functioning of the system only at certain points in time (moments of input or control influences, environmental disturbances, etc.); 2) not special, in which the process is located the rest of the time. Special states are also characterized by the fact that the functions of the states at these moments of time change abruptly, and between special states the change in coordinates occurs smoothly and continuously or does not occur at all. Thus, following when modeling the system S only from its special states at those moments in time when these states occur can one obtain the information necessary to construct the function. Obviously, for the type of systems described, modeling algorithms can be constructed using the “principle of special states.” Let us denote the jump-like (relay) change of state z like , and the “principle of special states” as principle .

The “principle” makes it possible for a number of systems to significantly reduce the cost of computer time for the implementation of modeling algorithms compared to the “principle”. The logic for constructing a modeling algorithm that implements the “principle” differs from that considered for the “principle” only in that it includes a procedure for determining the moment of time corresponding to the next special state of the system S. To study the process of functioning of large systems, it is rational to use the combined principle of constructing modeling algorithms that combine the advantages of each of the principles considered.

Forms of representation of modeling algorithms

A convenient form of representing the logical structure of models is a diagram. At various stages of modeling, generalized and detailed logical diagrams of modeling algorithms, as well as program diagrams, are compiled.

Generalized (enlarged) modeling algorithm diagramsets general order actions when modeling systems without any clarifying details. The generalized diagram shows what needs to be done at the next modeling step.

Detailed diagram of the modeling algorithmcontains clarifications that are missing in the generalized scheme. A detailed diagram shows not only what should be done at the next step of system modeling, but also how to do it.

Logical diagram of the modeling algorithmrepresents the logical structure of the system functioning process model S. A logic diagram specifies a time-ordered sequence of logical operations associated with solving a modeling problem.

Program outline displays the order software implementation modeling algorithm using specific software and algorithmic language.

The logical diagram of the algorithm and the program diagram can be implemented in both enlarged and detailed form. The most commonly used symbols in computer modeling practice are shown in Fig. 3.3, which shows the basic, specific and special symbols of the process. These include: the main symbol: a process; process specific symbols: b decision; c preparation; g predefined process; d manual operation; Special symbols: e connector; g terminator.

An example image of the modeling algorithm diagram is shown in Fig. 3.3, z.

Typically, a diagram is the most convenient form of representing the structure of modeling algorithms, for example in the form graph diagrams (Fig. 3.3, i). Here beginning, end, calculation, formation, condition checking, counter, issuing the result,, where g the total number of operators of the modeling algorithm. As an explanation of the graph diagram of the algorithm, the text provides a disclosure of the content of the operators, which simplifies the presentation of the algorithm, but complicates working with it.

a b h i

in g

d f

Rice. 3.3. Symbols and diagrams of modeling algorithms

BIBLIOGRAPHICAL LIST

1. Sovetov B.Ya. Modeling of systems: textbook. for universities / B.Ya. Sovetov, S.A. Yakovlev. M.: Higher. school, 2001. 343 p.

2. Sovetov B.Ya. Modeling of systems: textbook. for universities / B.Ya. Sovetov, S.A. Yakovlev. 2nd ed. M.: Higher School, 1998. 319 p.

3. Tarasik V.P. Math modeling technical systems: textbook for universities / V.P. Tarasik. M.: Nauka, 1997. 600 p.

4. Introduction to mathematical modeling: textbook. manual for universities / ed. P.V. Tarasova. M.: Intermet Engineering, 2000. 200 p.

5. Ivchenko G.I. Math statistics: tutorial for colleges / G.I. Ivchenko, Yu.I. Medvedev. M.: Higher. school, 1984. 248 p.

6. Alyanakh I.N. Modeling computing systems/ I.N. Alyanakh. L.: Mechanical Engineering, 1988. 233 p.

7. Shannon R. Simulation modeling of systems art and science / R. Shannon. M.: Mir, 1978. 308 p.

P 3

P 4

F 5

R 6

K 7


As well as other works that may interest you

15330. Creating a pool interior in 3Ds Max 1.96 MB
Topic 6: Creating a pool interior As a result of completing this work, you should receive the visualized scene shown in the figure. 1. Two-dimensional shapes. Modifiers of two-dimensional shapes Goal: to master the technology of creating shapes
15332. Basics of working with static images in the 3D graphics program 3ds max 4.96 MB
Topic 5: Basics of working with static images in the program 3D graphics 3ds max. Stages of creating three-dimensional scenes Project Let's create a corner of the part of the room in which the table is located. There is a glass with ice on the table. For specified...
15333. Processes of turning on and off a circuit with a capacitor 1.71 MB
Calculate pre-switching t = 0 initial t = 0 and steady-state t → ∞ values ​​of currents and voltage on the capacitor in the circuit Fig. 1. in two cases: 1. the key opens; 2. the key is closed. R1= 330 Ohm; R2=220 Ohm; U= 15 V; C= 10 µF Fig...
15334. Processes of turning on and off a circuit with an inductor 75 KB
General information A circuit with one inductor, just like a circuit with one capacitor, is described by a first-order differential equation. Therefore, all currents and voltages in the transient mode change according to an exponential law with the same time constant
15335. Study of transient processes in linear electrical circuits 94 KB
Preparation for work In the closed circuit of Fig. 1, after disconnecting it from the source of direct or alternating voltage, damped sinusoidal oscillations may occur due to the initial energy reserve in the electric field of the capacitor and in the magnetic field
15336. Studying Dijkstra's algorithm and implementing it for a given graph in the C++ programming language 344.5 KB
Laboratory work No. 1 in the discipline Structures and algorithms for data processing Purpose of work: Study of Dijkstra's algorithm and its implementation for a given graph in the programming language C. Dijkstra's algorithm in English. Dijkstras algorithm algorithm on graphs invented by
15337. Studying the heapsort algorithm and implementing it in the C++ programming language 49 KB
Laboratory work No. 2 in the discipline Structures and algorithms for data processing Purpose of the work: Study the pyramid sorting algorithm and implement it in the programming language C. Work assignment Write a generating program numeric array ra
15338. Studying the depth-first search algorithm and implementing it in the C++ programming language 150 KB
Laboratory work No. 3 in the discipline Structures and algorithms for data processing Purpose of the work: Study the depth-first search algorithm and implement it in the programming language C. Work assignment Implement the depth-first search algorithm. Rate time...

The second stage of modeling is the stage of model algorithmization and its machine implementation. This stage is a stage aimed at implementing ideas and mathematical schemes in the form of a machine model M system functioning process S.

System operation process S can be considered as a sequential change of its states in k-dimensional space. The task of modeling the process of functioning of the system under study S is the construction of functions z, on the basis of which it is possible to calculate the characteristics of interest in the process of system functioning. This requires relationships connecting the functions z with variables, parameters and time, as well as initial conditions at the moment of time t=t 0 .

There are two types of system states:

  • 1) special, inherent in the process of functioning of the system only at certain points in time;
  • 2) non-singular, in which the process is located the rest of the time. In this case the state function z i (t) can change abruptly, and between special ones - smoothly.

Modeling algorithms can be built according to the “principle of special states”. Let us denote the jump-like (relay) change of state z How z, and the “principle of special states” - as principle z.

« Principle z" makes it possible for a number of systems to significantly reduce the cost of computer time for the implementation of modeling algorithms. mathematical modeling model statistical

A convenient form of representing the logical structure of models of processes of functioning of systems and computer programs is a diagram. At various stages of modeling, the following schemes of modeling algorithms and programs are compiled:

Generalized (enlarged) diagram of the modeling algorithm specifies the general procedure for modeling a system without any further details.

Detailed diagram of the modeling algorithm contains clarifications that are missing in the generalized scheme.

Logical diagram of the modeling algorithm represents the logical structure of the system functioning process model S.

Program outline displays the order of software implementation of the modeling algorithm using specific mathematical software. A program diagram is an interpretation of the logical diagram of a modeling algorithm by a program developer based on a specific algorithmic language.

Stages of algorithmization of the model and its machine implementation:

  • 1. Construction of a logical diagram of the model.
  • 2. Obtaining mathematical relationships.
  • 3. Checking the reliability of the system model.
  • 4. Choice tools for modeling.
  • 5. Drawing up a plan for performing programming work.
  • 6. Specification and construction of the program diagram.
  • 7. Verification and verification of the reliability of the program scheme.
  • 8. Carrying out model programming.
  • 9. Checking the reliability of the program.
  • 10. Drawing up technical documentation for the second stage.

Modeling, algorithmization and programming

Currently, the share of mental labor in the activities of every person is increasing; it is necessary to solve practical problems related to the processing, storage, and transmission of information. At the same time, the number of people professionally employed is growing information work. To automate it, a computer is used as a universal tool for working with information.

Solving the problem using a computer involves the following: stages:

Let's take a closer look at each of the listed stages.

1. Statement of the problem. Construction information model

As a rule, practical problems are formulated quite clearly from the user’s point of view, but such a formulation does not have sufficient clarity and rigor.

In order for such a problem to be solved using a computer, it is necessary to complete the problem statement:

For this it is important to determine essential properties of objects and phenomena, which are discussed in the problem, and neglect the unimportant ones.

Sometimes this is forgotten. For example, if a problem requires determining the area of ​​the upper surface of a table (tabletop), without hesitation they say that it is necessary to measure the length and width. However, an essential property of the table may be that it is round, then it is difficult to talk about length and width. In addition, even if it is determined that the countertop has a rectangular shape, it should be agreed that small irregularities do not have a significant effect on the size of the area.

In the rectangular table example, the length and width cannot be negative numbers, nor can they be unrealistically large or small.

All this information forms task information model .

The main property of the model is to simplify the phenomenon being studied while preserving its essential properties. An information model of a task can be called information about objects and phenomena appearing in the task, significant from the point of view of the task and recorded in text, numerical or other signal form.

Steps to build an information model:

Let us define the concept of “model” and possible classifications.

A model is a formalized description of an object, a system of objects, a process or a phenomenon, expressed by mathematical relationships, a set of numbers and (or) texts, graphs, tables, verbal formulas, etc.

The process of creating (and sometimes researching) a model is called modeling.

The method of cognition, which consists in studying an object according to its properties, is called modeling.

Model classification

By area of ​​use

Classification taking into account the time factor

By presentation method

According to presentation form the following types can be distinguished information models:

2. Formalization of the task

At this stage it happens fixing the information model, is selected form representation data that forms an information model that is most convenient for computer processing. Often the first two stages do not have a clear boundary and can be considered as a single whole.

Having completed the problem statement, a formalized model is created, i.e., a descriptive information model is written using some formal language, for example mathematical.

3. Construction of the algorithm

The concept of an algorithm is one of the fundamental concepts of computer science. Algorithmization, along with modeling, acts as a general method of computer science.

Algorithms are the object of a systematic study of the scientific discipline bordering between mathematics and computer science, adjacent to mathematical logic - theory of algorithms.

The word “algorithm” itself comes from algorithmi, the Latin spelling of the name of the great 9th-century mathematician al-Khwarizmi, who formulated the rules for performing arithmetic operations. Initially, algorithms meant only the rules for performing four arithmetic operations on multi-digit numbers.

An algorithm is a clear and precise instruction to the performer to perform a sequence of actions aimed at achieving a goal or solving a problem.

According to this definition, recipes for making any medicine or cookies are algorithms. And the rule for a pedestrian to safely cross the roadway is also an algorithm. According to their purpose, algorithms can be both “household” and computational.

Executor - this is someone or something that can perform some very specific set of actions. It has the following properties:

The entire set of commands that a given executor can execute is called the executor's command system (SCS).

Formal performance algorithms underlie control automatic devices. Indeed, the simplest operations into which the process of solving a problem is divided when creating an algorithm can be implemented by a machine specially created to execute individual commands of the algorithm and execute them in the sequence specified in the algorithm.

However, a person can also be a formal performer. If he does not know the purpose of the work he is doing, he will have to strictly follow the instructions.

The computer is the formal executor of algorithms. In order for him to solve the problem in strict accordance with the instructions, he must receive a solution algorithm. Thus, the algorithm is control information.

Properties of algorithms

Algorithm discreteness

The execution of the algorithm is divided into a sequence of individual steps. Perform each step instructs team. Thus, the algorithm is a sequence of commands that determine the actions of the performer. The algorithm has an intermittent (discrete) structure: only after executing one command, the executor can begin executing the next one. This property is called discreteness.

Algorithm clarity

A correctly composed algorithm contains only those commands that are included in the command system of the performer for whom it was written. This property is called understandability .

Those commands that the performer can execute are considered understandable to the performer.

For example, a person who does not know how to add single-digit numbers (who does not know the addition table) will not be able to use the procedure for adding multi-digit numbers described by al-Khwarizmi.

Algorithm accuracy

An important property of the algorithm is accuracy (certainty, unambiguity).Each command of the algorithm must be clearly perceived by the performer and imply a certain action. Having completed a step of the algorithm, the performer must know exactly which step to perform next. An example of an inaccurate algorithm is the phrase from a recipe “add 2-4 tablespoons of sugar” or the classic saying “execute cannot be pardoned.”

Efficiency and finiteness of the algorithm

Execution of the algorithm must lead to obtaining a result (property effectiveness) in a finite number of steps (finitude property).

Massiveness of the algorithm

It is desirable that the algorithm satisfies the mass property , those. could be used to solve not only one specific problem, but also a certain class of similar problems.

For example, the rule for adding multi-digit numbers does not depend on the number of digits in the terms or their digital composition. It works even if the number is not represented in the decimal number system, but in positional system Numbers with any integer base.

Ways to write algorithms

In practice, the most common forms of fixing algorithms are:

Verbal method

For a person, the main method is verbal.

For example. Write down an algorithm for finding the greatest common divisor (GCD) of two natural numbers.

The algorithm could be as follows:

set two numbers;

if the numbers are equal, then take any of them as the answer and stop at otherwise continue executing the algorithm;

determine the largest of the numbers;

replace the larger number with the difference between the larger and smaller numbers;

repeat the algorithm from step 2.

The described algorithm is applicable to any natural numbers and should lead to a solution to the problem. Convince yourself of this by using this algorithm to determine the greatest common divisor of the numbers 125 and 75.

The verbal method is not widespread for the following reasons:

Pseudocode

Pseudocode is a system of notation and rules for uniform and accurate recording of algorithms.

Pseudocode is human-oriented, but makes it easier to translate into a programming language because it requires certain writing rules to be followed. An example of pseudocode is a school algorithmic language.

Note that there is a difference between the concepts of “algorithmic language” and “programming languages”; First of all, in algorithmic language a performer can mean not only a computer, but also a device for working “in the environment.” A program written in an algorithmic language is not necessarily intended for a computer. The practical implementation of an algorithmic language is a separate issue in each specific case.

Like every language, an algorithmic language has its own vocabulary. The basis of this dictionary is made up of words used to write commands included in the command system of the executor of a particular algorithm. Such commands are called simple commands. In an algorithmic language, words are used, the meaning and method of use of which is specified once and for all. These words are called service words. The use of function words makes the recording of the algorithm more visual, and the form of presentation of various algorithms makes it more uniform.

An algorithm written in an algorithmic language must have a name. It is advisable to choose the name so that it is clear what problem this algorithm describes. To highlight the name of the algorithm, write the service word ALG (ALGORITHM) in front of it. Behind the name of the algorithm (usually with new line) record his commands. To indicate the beginning and end of the algorithm, its commands are enclosed in a pair of service words START (START) and CON (END). Commands are written sequentially.

Algorithm recording sequence:

ALG name of the algorithm

series of algorithm commands

Graphical representation of algorithms

An algorithm compiled for a certain performer can be represented different ways: using a graphic or verbal description, in the form of a table, a sequence of formulas written in an algorithmic language (programming language). Let's dwell on graphic description algorithm called a block diagram . This method has a number of advantages due to its clarity, which ensures, in particular, high “readability” of the algorithm and explicit display of control in it.

First of all, let's define the concept of a flowchart.

A flowchart is a directed graph indicating the order in which the commands of an algorithm are executed.

A block diagram is graphical representation algorithm.

In the flowchart, each type of action (entering initial data, calculating the values ​​of expressions, checking conditions, controlling the repetition of actions, completing processing, etc.) corresponds geometric figure , represented as a block symbol. Block characters connect transition lines , determining the order of execution of actions.

In the block diagram, the actions of the algorithm (blocks) are depicted as follows: geometric shapes:

To organize actions in an algorithm, various forms are used, called algorithmic structures. There are three main algorithmic structures: following, branching, and looping. In mathematics, a theorem has been proven that any algorithm can be compiled using only these three algorithmic constructions, although there are other constructions that shorten the notation of the algorithm, simplify working with it, and make it easier to understand.

Following construction (linear algorithm)

Follow design – this is a form of organizing actions when actions are performed sequentially, one after another.

Here the series of commands can be:

In fact, each algorithm can be divided into fairly large blocks, which will include: in different order all the objects listed above, and from such blocks create a linear algorithm.

Example

Task: calculate the area of ​​a circle if the radius is known.

Given: R - radius of the circle.

Find: S is the area of ​​the circle.

Solution: S=3.14 R2

Let's choose the Russian language to write the algorithm in this form and write down a sequence of commands, the execution of which at a given radius value will allow us to find the area:

Read the R value.

Multiply the R value by 3.14.

Multiply the result of the second action by the value of R.

Record the result as the S value.

In the language of flowcharts

This form of notation is based on replacing typical algorithmic commands with certain geometric figures. The algorithm for solving this problem is as follows (see figure).

Branching design

Branching design is a form of organizing actions in which, depending on the fulfillment (non-fulfillment) of a certain condition, one of two series of commands is executed.

If< condition >

That< team series 1 >

otherwise< team series 2 >

end of branch

Example

Task: calculate

Given: x – argument value.

Find: y – function value.

Solution:

X if x<0

The appearance of the resulting graphical diagram (see figure) explains why the algorithm corresponding to it was called branching.

Let's do it verbal presentation of this algorithm.

Start

If x>0, then

y: = x

otherwise

Start

Y: = -x

End of branch

Write down the value

End

Highlight complete and incomplete conditional construction.

Let us introduce the notation:

Q – condition;

P 1 , P 2 , … P N – actions that are performed if the condition is true;

T 1 , T 2 , … T N - actions that are performed if the condition is false.

The block diagram and algorithm look like this (see table):

Conditionals

Full

Incomplete

P 1

R 2

P N

otherwise

T 1

T 2

T N

End of branch

P 1

R 2

P N

End of branching.

Loop Design

Loop Design is a form of organizing actions in which the same sequence of actions is repeated several times.

Actions that must be repeated several times are called body of the loop . The body of the loop is a series of commands. The algorithm must always contain a pointer separating the body of the loop from the main part of the algorithm.

There are two main types of loops: a loop with a parameter and a loop with a condition.

Loop with parameter

It is used when the number of repetitions is known in advance.

Wherein parameter (loop variable) changes from its initial value to the final value with a given step and determines the number of repetitions.

Writing a loop with a parameter in algorithmic language looks like this:

initial final step

For <имя параметра> from < значение > before < значение > step <изменения>

parameter parameter parameter

<тело цикла>

Loop with condition

It is used when the number of repetitions is unknown in advance and depends on the fulfillment of some condition.

There are cycles with precondition and with postcondition .

Loop with precondition("bye" cycle)

The condition is checked before the next execution of the loop body.

Recorded in algorithmic language and in the form of a block diagram:


Bye<условие>

< тело цикла >

As long as the condition is met (corresponding logical expression has the meaning "true") execution of the loop body is repeated . As soon as the condition is no longer met, the execution of the loop stops (false exit).

If the condition is not initially met, the body of the loop may not be executed even once.

Loop with postcondition(cycle "before")

The condition is checked after the next execution of the loop body, i.e. The body of the loop will definitely be executed at least once.


repeat

< тело цикла >

before< условие >



The body of the loop is executed if the condition is not met(the corresponding logical expression evaluates to “false”). As soon as the condition is met, execution of the loop body stops (exit true).



4. Programming

For an algorithm to be executed by a computer, it must be written in a language it understands. However, the computer perceives and can only process binary codes (sequences of zeros and ones). Therefore, the initial data and commands of the algorithm must be represented in binary codes. However, this is very inconvenient for humans, so languages ​​have been developed designed to write algorithms that, on the one hand, are close to natural languages, and on the other hand, are built according to fairly strict rules so that the algorithms written in them can be automatically translated according to formal rules into binary codes. Such languages ​​are called programming languages, and an algorithm written in such a language (the same as an algorithm written in binary codes) is called program.

With the advent personal computers The stage of compiling an algorithm is in many ways connected to the programming stage as well as to the next stage.

Programming technologies

Algorithmic (modular) programming

The main idea of ​​algorithmic programming is to divide the program into sequence of modules, each of which performs one or more actions. The only requirement for a module is that its execution always begins with the first command and always ends with the very last one (that is, so that it is impossible to access module commands from the outside and transfer control from the module to other commands, bypassing the final one).

The algorithm in the selected programming language is written with using data description commands, calculations of values And program sequence control.

The program text is a linear sequence of assignment, loop, and conditional statements. In this way, you can solve not very complex problems and create programs containing several hundred lines of code.

This type of programming uses the following: elements:

Structured programming

When creating medium-sized applications (several thousand lines of source code), we use structured programming, the idea of ​​which is that the structure of the program should reflect the structure of the problem being solved so that the solution algorithm is clearly visible from the source text. To do this, you need to have the means to create a program not only using three simple statements, but also using tools that more accurately reflect the specific structure of the algorithm. For this purpose, the concept was introduced into programming subroutines - a set of operators that perform the desired action and are independent of other parts of the source code. The program is broken down into many small subroutines (taking up to 50 statements - a critical threshold for quickly understanding the purpose of the subroutine), each of which performs one of the actions specified in the original task. By combining these subroutines, it is possible to form the final algorithm not from simple operators, but from complete blocks of code that have a certain semantic meaning, and such blocks can be referred to by name. It turns out that subroutines are new operators or language operations defined by the programmer.

The ability to use subroutines classifies a programming language as a class procedural languages.

The presence of subroutines allows you to design and develop the application top down - this approach is called top-down design . First, several subroutines are identified that solve the most global tasks (for example, data initialization, the main part and completion), then each of these modules is detailed at a lower level, breaking down in turn into a small number of other subroutines, and this happens until the whole task will not be realized.

This approach is convenient because it allows a person to constantly think at the subject level, without descending to specific operators and variables. In addition, it becomes possible not to implement some subroutines immediately, but to temporarily postpone them until other parts are completed. For example, if there is a need to calculate a complex mathematical function, then a separate subroutine for such a calculation, but it is implemented temporarily by one operator, which simply assigns a pre-selected value. Once the entire application is written and debugged, then you can begin to implement this function.

It is also important that small subroutines are much easier to debug, which significantly increases the overall reliability of the entire program.

A very important characteristic of subroutines is the ability to reuse . Integrated programming systems come with large libraries of standard routines that can significantly increase productivity by leveraging someone else's work to create commonly used routines.

Event-Driven Programming

With active distribution of the system Windows and the emergence of visual RAD - environments, the event-based approach to creating programs has gained wide popularity - event-oriented programming.

Ideology of the system Windows based on events. A person clicked a button, selected a menu item, pressed a key or mouse button - in Windows a suitable message is generated , which is sent to the window of the corresponding program. The structure of a program created using event programming is as follows. The main part is one endless loop, which polls Windows , watching to see if a new message has appeared. When it is detected, the subroutine responsible for processing is called the corresponding event (not all events are processed, there are hundreds of them, but only the necessary ones), and a similar polling cycle continues until the “Shut down” message is received.

Events may be custom , arising as a result of user actions, systemic , occurring in the operating system (for example, messages from a timer), and software , generated by the program itself (for example, an error has been detected and needs to be processed).

Event-based programming is a development of the ideas of top-down design, when the program's reactions to various events are gradually determined and detailed.

The development of the ideas of structured and event programming significantly increased the productivity of programmers and made it possible to create applications containing hundreds of thousands of lines in a reasonable time (several months). However, this volume has already approached the limit of human capabilities, and new software development technologies were required.

Object-oriented programming based on concepts object , class and on three key concepts - encapsulation , inheritance And polymorphism .

The concept is implemented in programming languages object as a set of properties (data structures specific to this object), and methods their processing (routines for changing properties) and events, to which a given object can react and which, as a rule, lead to a change in the properties of the object.

Objects can have identical structure and differ only in property values. In such cases, the program creates a new type based on a single object structure (similar to how new types are created for data structures). It is called class, and each specific object having the structure of this class is called an instance of the class .

Data merging c methods in one type (class) is called encapsulation. In addition to concatenation, encapsulation allows you to restrict access to object data and the implementation of class methods. As a result, programmers have the opportunity to use ready-made classes in their applications based only on the description of these classes.

The most important characteristic of a class is the ability to create new classes based on it inheritance all its properties and methods and adding your own. A class that has no predecessor is called a base class .

For example , the class “student” has the properties “full name”, “year of admission”, methods “attend classes” and “pass exams”. The “part-time student” class created on its basis inherits all these properties and methods, to which the “place of work” property and the “come to session” method are additionally added. Inheritance allows you to create new classes by reusing an existing one source and without wasting time on rewriting it.

In most cases, methods of the base class of descendant classes have to be redefined - an object of the “part-time student” class performs the “attend classes” method in a completely different way than an object of the “full-time student” class. All overridden methods will have the same spelling (name) as the methods of the base object, but the compiler will recognize by the type of the object (its class) which specific method should be used and will not call the “attend classes” method of the class “for an object of the “part-time student” class. student". This property of objects to override methods of an inherited class and use them correctly is called polymorphism.

  1. Encapsulation– a combination of an object’s properties and possible operations (methods) on it. The combination of data with permissible actions on this data leads to the “birth” of a new element in the design of programs - an object, and the object acts as it is inherent in it, and only on what is described in it. Accessing an object's data other than through its actions is unacceptable. Objects that encapsulate the same list of properties and operations are combined into classes . Each individual object is instance of the class . Instances of a class can have different property values.

For example, a computer's file system may contain hundreds or thousands of files. All files have the same set of properties (name, position in the file system) and operations (renaming, moving or copying) and form the FILES object class. Every separate file is an instance of this class and has specific property values ​​(name, location, etc.).

  1. Inheritance– defines the relationship between classes: objects child class have all the properties of objects class-parent . That is, each subsequent derived object inherits the properties and actions of its predecessors. The inheritance mechanism allows you to redefine or add new data and methods for processing it, and create a class hierarchy.

For example. In vector graphic editors the image is constructed from graphic primitives - point, line, circle, etc.

One of the graphic primitives is the POINT object class. In this class, each object has certain properties (Coordinates, Color), on which corresponding operations (Move, Change color) are possible. The POINT object class can be specified by a table

Properties

Coordinates (x,y)

Moving

Color change

From the POINT object class, you can get a new CIRCLE class by adding a new Radius property and the Change Radius operation. The CIRCLE object class can be specified as a table.

Properties

Coordinates (x,y)

Moving

Color change

Radius (R)

Changing the radius

All objects of the CIRCLE class inherit the properties and operations of the POINT class. The POINT class is called the parent class, the CIRCLE class is the child class. Graphically it looks like this:


inheritance

  1. Polymorphism– the ability to carry out the same operations on objects belonging to different classes, while maintaining individual methods for their implementation for each class. That is, the same operation on objects of different classes can be performed by different methods.

For example. Most classes of objects in the WINDOWS/OFFICE environment are characterized by a set of the same operations - renaming, moving, copying, deleting, etc. The mechanisms for implementing these actions are different for different classes. So, to copy a folder, you need to perform a sequence of actions to change file system, and to copy a symbol make changes to the document. These operations will be performed by various programs.

Visual programming

Technologies of object, event and structured programming today merged intoRAD systems, which contain many ready-made classes presented in the form visual components , which are added to the program with one click. The programmer only needs to design appearance windows of your application and determine the processing of main events - which operators will be executed when buttons are pressed, when menu items are selected or mouse clicks. The environment will generate all the auxiliary source code itself, allowing the programmer to fully concentrate only on the implementation of the algorithm.

The development of this technology is associated with the emergence GUI. This is an application development technology in the form graphic objects, followed by their translation into program code. In the 90s, RAD technology appeared - Rapid Application Development - rapid application development. All necessary design and control elements are created and maintained not through manual programming, but using ready-made visual components that are dragged into the designed window using the mouse. The properties and behavior of components are configured using simple editors, visually showing the characteristics of the corresponding elements. In this case, the source text of the program is generated automatically by the RAD environment.

RAD environments are designed to be developed with active user participation, information systems for business applications. RAD is dedicated to providing high speed system development while improving quality software product and reducing its cost.

Among the universal programming languages ​​today, the most popular are the following:

Basic - requires initial training to master (secondary school);

Pascal - requires special training (schools with advanced
studying the subject and general technical universities);

C++ (C++), Java, C Sharp (C#) - require professional training (specialized secondary and higher educational institutions).

For each of these programming languages ​​today there are many programming systems produced by various companies and aimed at various models PC and OS. The most popular are the following visual environments fast design programs for Windows:

Basic: Microsoft Visual Basic;

Pascal: Borland Delphi;

C++: Microsoft Visual C++;

Java: BorlandJBuilder,

C#: Microsoft Visual Studio.NET, Borland C#Builder.

To develop server and distributed applications, you can use the Microsoft Visual C++ programming system, Borland products, and almost any programming tool in Java.

5. Entering the program into the computer memory. Trial run

On large computing centers When solving fairly large and complex problems, programs are entered by people of a special profession - computer operators. In addition to entering programs, operators prepare data - entering data into memory, recording it to external media. A programmer working on a PC enters the program and data himself.

After the program has been entered, a test run follows. In cases that should be considered exceptional, the program is executed immediately and produces some result. Much more often you have to find the reasons why the program does not work or does not work correctly, and correct them - debug the program.

6. Debugging and testing the program

The process of finding and correcting errors in a program is called debugging. Errors may occur when typing as a result of violating the rules for writing programs in a programming language - the so-called syntactic errors. Special instrumental programs (syntax control programs) included in the programming system help to detect and correct them. The system analyzes the program and issues a message about the location and nature of the error. Often errors are caused by the fact that some syntactically correct construction cannot be performed (for example, division by zero or an attempt to assign a real value to an integer value). In this case, a message also appears about the reason for the failure and indicates which specific command cannot be executed.

Much harder to find mistakes made when compiling the algorithm, which ultimately lead to malfunction programs: no result, looping, incorrect result. In this case, step-by-step control of program execution is useful.

An important step in the debugging process is testing programs, i.e. testing it by introducing a test - a certain set of initial data, for which the result of the operation of individual blocks or the program as a whole is known in advance.

Often, as part of developing an information model, restrictions are placed on the source data. In this case, the program must react to the entry of incorrect values: stop work or request re-entry. As a rule, the program provides protection against entering incorrect data or other unintended user actions. Then, during the testing process, the quality of such protection is checked.

The ability to successfully select a test in which an error (if any) is most likely, and to provide a variety of course options computing process, as well as user actions (sometimes very unpredictable), and, therefore, protecting the operation of the program from any surprises is a great skill of the programmer.

The simplest test example: if the program contains a branch, i.e. it is necessary to select a method of action depending on the fulfillment of the condition; it is necessary to check its operation with those initial data under which the condition is satisfied, and with those under which it is not satisfied.

Until recently, stages 4, 5 and 6 were the necessary stages of solving a problem using a computer. At the same time, programming languages ​​and systems were the software tools with the help of which new programs were created to solve user problems. However, with the expansion of the range of tasks for which a computer is used, the number of people who, not being professional programmers, use a computer in their work is growing.

In this regard, various software tools have been created that are the basis information technologies , used to solve a variety of practical problems, such as word processing and spreadsheets, creating graphic images, accessing information stored in a database, solving a mathematical problem, calculating a technical design, and much more. To solve them, the computer user has extensive software at his disposal.

In the process of building an information model of a task, the user determines what actions he will need to perform to achieve the result, and in accordance with this decides what software take advantage of. If he has at his disposal a program suitable for solving a given problem, then the user selects it as a tool (DBMS, table processor, mathematical package, etc.). If you cannot use a ready-made application software, you will have to use programming technology.

7. Obtaining and analyzing results

Whatever technology for solving problems on a computer is used, the necessary stage will be to obtain and analyze the result: the compliance of the obtained results with what is expected within the framework of the constructed information model of the problem is checked, and also the extent to which the obtained result relates to real practice is assessed.

At this stage, it is revealed to what extent the constructed information model corresponds to reality. The fact is that the more properties of objects and phenomena are recognized as significant and taken into account, the more the model reflects reality. However, taking into account a large number of characteristics leads to a more complex model and difficulties in mathematically expressing the relationships between characteristics. Usually they try to find a balance between the completeness of compliance of the information model with the real state of affairs and its complexity in the process of refining the model (gradually increasing the number of essential properties taken into account).

Questions to prepare for test work on the topic “Modeling, algorithmization, programming”

Delays of transactions at a specified time. Static modeling is used to describe the behavior of an object at any point in time. Dynamic Simulation reflects the behavior of an object over time. Discrete modeling is used to display an object at a specific point in time.


Share your work on social networks

If this work does not suit you, at the bottom of the page there is a list of similar works. You can also use the search button


Other similar works that may interest you.vshm>

9929. Algorithmic methods of information protection 38.36 KB
For these systems to function properly and safely, their security and integrity must be maintained. What is cryptography Cryptography is the science of ciphers was classified for a long time as it was used mainly to protect state and military secrets. Currently, cryptography methods and tools are used to ensure information security not only the state but also private individuals and organizations. While cryptographic algorithms for the average consumer are a closely guarded secret, although many already...
1927. System Modeling 21.47 KB
In the student computer room there are two mini computers and one data preparation device (DPD). Students come at intervals of 8±2 minutes and a third of them want to use UPD and computers, and the rest only computers. The permissible queue in the computer room is four people, including the person working at the UPD.
1974. SURFACE MODELING 233.46 KB
Surface and digital model The basis for representing data on the earth's surface are digital elevation models. Surfaces are objects that are most often represented by Z height values ​​​​distributed over an area defined by X and Y coordinates. DEM a means of digitally representing the relief of the earth's surface. collecting stereo pairs of images is labor-intensive and requires specific software but at the same time allows you to provide the desired degree of detail in the representation of the earth's surface.
2156. Lighting simulation 125.57 KB
For an observer located at any point, the brightness of the point that he sees will be expressed as follows. where V is the brightness for h b; E albedo surface reflectance. Compared to Lambert's method, this model reduces the brightness of points that we look at at an angle of 90 and increases the brightness of those points that we look at casually. Application of lighting laws in the synthesis of an image object. 7 The brightness is calculated at one point, for example, at the center of gravity for convex face polygons according to Lambert and...
8080. Ternary modeling 18.3 KB
Ternary Simulation Ternary simulation is widely used to identify signal races that may occur in a circuit. Modeling of the input set occurs in 2 stages. Example: carry out ternary logic modeling using the E method. Ternary modeling with increasing uncertainty B this algorithm For each LT, the maximum and minimum delay values ​​are indicated.
6675. Simulation modeling 56.71 KB
This process consists of two large stages: model development and analysis of the developed model. Modeling allows you to explore the essence of complex processes and phenomena through experiments not with a real system, but with its model. In the field of creating new systems, modeling is a research tool important characteristics future system at the earliest stages of its development.
5651. Manufacturing System Simulation 391.61 KB
The computer is involved in control technological equipment. To monitor the equipment status, one of three types of tasks is launched every 20 minutes. Every 5 minutes of processor operation, each task outputs the results of its work to the database
4640. MODELING DIGITAL NODES 568.49 KB
On the chips of modern LSIs it is possible to place many functional blocks of old computers along with interblock connection circuits. The development and testing of such crystals is only possible using mathematical modeling methods using powerful computers.
6206. Modeling in scientific research 15.78 KB
Great successes and recognition in almost all industries modern science brought to the modeling method of the twentieth century. However, modeling methodology has long been developed independently by individual sciences. Only gradually the role of modeling as a universal method of scientific knowledge began to be realized.
3708. Modeling using splines 465.08 KB
They also determine the degree of curvature of the spline segments adjacent to these vertices. Segment is the part of the spline line between two adjacent vertices. 3ds Mx uses four types of vertices: Corner a vertex whose adjacent segments have no curvature; Smooth A smooth vertex through which the spline curve is drawn with a bend and has the same curvature of the segments on both sides of it; Bezier A Bezier vertex is similar to a smooth vertex but allows you to control the curvature of the spline segments on either side of the vertex....
Did you like the article? Share with your friends!
Was this article helpful?
Yes
No
Thanks for your feedback!
Something went wrong and your vote was not counted.
Thank you. Your message has been sent
Found an error in the text?
Select it, click Ctrl + Enter and we will fix everything!