Theme 3. Mathematical modeling. Computer Mathematics Systems
Site: | Навчально-інформаційний портал НУБіП України |
Course: | Computers and Computer Technology (БЦІ). P2 ☑️ |
Book: | Theme 3. Mathematical modeling. Computer Mathematics Systems |
Printed by: | Гість-користувач |
Date: | Tuesday, 13 May 2025, 2:46 AM |
1. Mathematical modeling
Simulation - replacement of the object (the original) in its conventional way (model) and study the properties of the original by studying the properties of the model. There are physical and mathematical models.
Mathematical model - a set of mathematical relations, equations, inequalities, describing the basic laws of the object under study.
Natural phenomena, production process, economics, etc. |
-> |
Formalization, mathematical model |
-> |
Search, solution |
The mathematical model is based on some simplification (idealization) and is an approximate description of reality.
An analysis of a mathematical model allows predicting the behavior of a real object.
Mathematical models are widely used in physics, biology, and the like.
The model is never the same as the real process. The results of the mathematical model only approximate the process.
A criterion for adequacy (matching) of a mathematical model and a real process is practice (field experiment).
The formal classification of models is based on the mathematical tools used to solve the tasks.
There are models:
- Linear or nonlinear models;
- Concentrated or distributed systems;
- Deterministic or stochastic;
- Static or dynamic.
Simulation (simulation) involves presenting a model in the form of an algorithm and a computer program that allows you to recreate the behavior of the object.
Imitation models are considered as experiments conducted on computers, with mathematical models simulating the behavior of real objects.
At the same time, elementary phenomena are simulated with the preservation of their logical structure and consistency in time, which allows obtaining information about the state of the system at a certain point in time and evaluate the characteristics of the system.
Imitation models allow solving more complex tasks than analytic ones.
2. Algorithms. Block diagrams
The program should be created in a certain sequence:
- Statement of the task: the full content of the problem, the purpose of its solution.
- Mathematical model of problem solving: description of the problem in mathematical concepts (formulas, equations), determination of initial data; forms of output of the obtained results (tables, graphs, diagrams, etc.); the accuracy of the solution of the problem.
- The choice of the method of solution of the problem: on the accuracy, speed, and volume of the calculation; requirements for PC capabilities; availability of already developed methods, etc.
- Development of the algorithm for solving the problem: establishing a logical sequence of operations (actions), recording and analysis of the algorithm.
- Writing an application in a language: transferring an algorithm to a programming language.
- Debugging the program: finding syntax (incorrect record of constructs) and logical errors (violations of the sequence of actions, formulas, output data). Tests are used to identify logical errors - specially selected initial data together with known results.
- Computational experiment: calculations and their analysis. If necessary, adjustments to the previous stages are carried out.
Algorithm - an exact and understandable sequence of actions (steps) that lead to the solution of the problem.
The term "algorithm" comes from the name of the mathematics of the Middle Ages of al-Khorezm, who were offered methods for performing arithmetic calculations with multivalued numbers.
Block diagram of the algorithm for solving a problem
There are various forms of writing the algorithm: graphical circuits (flowcharts), RI-schematics, verbal description.
Writing an algorithm in the form of flowcharts is a labor-intensive process, but it is obvious.
GOST 19.001-77 ... 19.106-78 provides for the basic rules for the execution of schemes of algorithms and programs, terms and definitions, types of program documents.
The basic requirements for the compilation of the flowchart algorithm:
- the ratio of width to the height of the graphics block 3: 2, the graphics blocks need to be sized in multiple 5 units (10, 15, 20, 25, ...).
- Records can be used both in the middle of the graphics side and externally with the help of horizontal lines and square brackets.
- Each block has one entry point.
There are three basic algorithmic designs:
- linear - consists of consecutive actions;
- branched (condition) - the sequence of execution depends on certain conditions;
- cyclic - one and this sequence is executed two or more times.
3. Languages and programming environments
Programming languages - the system of notation for the accurate recording of the algorithm, which is understood for the PC.
Programming languages are largely reminiscent of ordinary languages - English or Ukrainian and consist of words, phrases, syntactic rules.
Write a program - translate the algorithm into a programming language, a receptive PC.
The same algorithm can be translated into different programming languages.
Programming languages are divided into:
- Algorithmic (procedural) - languages that describe the problem solving algorithm using a list of procedures, such as Basic, Pascal, C, Logo, and others;
- functional - description of the model of the subject area by means of a hierarchy of functions, for example, the language Lisp;
- logical - a description of the model of the domain by means of mathematical logic, for example, the language Prolog, SmallTalk.
Programming can be divided into:
- Visual programming is a means by which you can quickly create an application by visualizing its layout graphically, such as Visual C, Visual Basic, Delphi.
- high-level languages - consists of operators that are similar to ordinary words;
- Low-level language (assembler) - translates symbols (mnemonic) in person into machine codes.
Translation from the programming language into machine codes is carried out by translators - translation programs.
There are two possible broadcasts:
- compiler - translates the whole program, after which it is executed;
- interpreter - translates part of the program (line) and executes it immediately.
The language of Si and its environment
Language X was created in 1972 by Denis Ritchie to develop the operating system UNIX.
After publishing in the book "The Programming Language of Si" in 1978, C language becomes a popular language for applied and system programming, since it has a compact way of recording expressions and a wide range of operators.
In the language of C, a graphical AutoCAD system, Windows operating system, and more.
Advantages of C language:
- power - performing a maximum of work for a small number of steps;
- portability - the ability to implement Xi on different computers;
- popularity - has a million programmers who use this language;
- development - is constantly supplemented and expanding its capabilities at the expense of libraries of functions, new operators.
A structured approach to programming
For better software development, a structured approach to programming is used.
Each subproblem corresponds to an independent software module - which, as a rule, the module implements one function and returns the control of the module that called it.
The source code of the program must be clearly divided into blocks:
1) a brief explanation of the purpose of the module, its method of call, output data and the result of its work, date of creation, etc .;
2) description of all the variables used in this module;
3) the algorithm for solving the problem;
4) processing the results of the problem.
Structural programming - a method of writing the text of the program based on the use of basic structures for managing the calculation process: linear, branching, and loop.
In this approach, the program code (program functions) and data are separated.
Functions determine what is going on over the data, but not vice versa.
Testing - the process of finding errors:
- analysis of program work in a given range of output data or extreme data;
- program response to incorrect output;
- the interaction between modules, etc.
Object-Oriented Programming
OOP - a method of programming that allows you to consider the conceptual model as a set of objects.
OOP is implemented in Visual C ++, Delphi and other environments.
The basis of the OOP is a new object (data type) - class. The class consists of a set of variables (data) and operations (methods = class member functions) that work only with these variables.
A number of basic terms are associated with the PLO:
- Encapsulation is a way of combining data and functions (methods) into a single structure. In C ++ classes, the functional elements of the object are used with private, public, protected.
- Hierarchy of classes. Objects created on the basis of the class description are called instances of the class. You can build a hierarchy of classes that consist of a parent class and several child classes. Parent classes represent common problems, and derived classes implement more specific tasks.
- IThe implication(inheritance) - the ability of the class to imitate the features of other classes. The parent class is used for a derived class instance, which can be changed in different ways.
- Polymorphism - the concept of an OOP, in which the same message can be sent to the parent class and the objects of the derived classes. Each subclass object responds in some way to the format of the message, as appropriate, to its description.
4. Computer Mathematics Systems
With the advent of the PC, a number of software systems were created that implemented a wide range of methods for solving various problems in mathematics.
Systems of computer mathematics replace the work of mathematicians - theorists and analysts of a high level. There are already discoveries made using such systems.
The term " computer mathematics " includes a set of both theoretical and methodological tools, as well as modern software and hardware, allowing to perform all mathematical calculations with high accuracy and productivity, to build complex chains of computational algorithms with wide possibilities of visualization of processes and data when processing them. .
Initially, systems of computer mathematics were divided into two different groups: for numerical and symbolic (analytical) calculations.
The first group was Eureka, MathCAD, MatLAB, Excel.
The second group included Derive, MuPAD, Mathematica and Maple. Today, this classification is conditional.
Each of these systems of computer mathematics has the characteristic features of the internal construction and implementation of the interface.
MathCAD arithmetic computing system
MathCAD is a popular computer mathematics system designed to automate solving common mathematical problems in various fields of science, technology, and learning.
The name MathCAD comes from the words MATHematic (mathematics) and CAD (Computer Aided Design). Developer - MathSoft Inc. ( http://www.mathsoft.com ). To date, MathCAD 15 is used. The price is about $ 800.
System Structure:
- document editor - system for typing text, formulas, charts, etc .;
- MathConex - Integrator with other systems;
- Help system - thematic and indexed directory of help;
- quick cheat sheet - short examples with minimal comment, built-in operators and functions, etc.
The calculations in MathCAD can be done in one of three ways:
- selecting operation in the menu;
- using toolbars;
- addressing the relevant functions.
A document in MathCAD, called WorkSheets (worksheets), combines a code written in a visually-oriented language, which is almost the same as the usual language of mathematics.
The description of the algorithm is carried out in the usual mathematical form with the use of commonly accepted symbols, for example, root square, integral, matrix, etc.
The MathCAD interface is a collection of tools that provide MathCAD management through the keyboard and mouse.
Main menu and standard toolbar.
The panels of analytical calculations provide a quick set of arithmetic operators, plotting, matrix operations, and the like.
The following concepts and objects of the MathCAD system are identified - identifiers, constants, variables, arrays, operators, functions, control structures, etc.
Constants are named objects that store constant values, for example, a number. Some constants are systemic.
Operators are the elements of the language in which mathematical expressions are created. These include symbols of arithmetic operations, derivatives, integrals, etc.
Built-in functions implement the implementation of generally accepted mathematical calculations, in particular, trigonometric sin ( x ) .
MatLAB engineering calculation system
The MatLAB system (abbreviated as MATrix LABoratory - matrix laboratory) is an interactive system for utilizing engineering and scientific calculations with a focus on working with data arrays.
Created by MatLAB by MathWork Inc. (http://www.mathwork.com USA). Widely began to be used in the late 80's after the appearance of the MatLAB 4.0 market. The price is about $ 2940.
Among the main areas of MatLAB application are mathematical calculations, data analysis and visualization, application development, including graphical user interface. Built-in universal interfaces make it easy to work with external information sources, integrate with procedures written in C, Java, etc.
MatLAB has digital processing of signals and images, designing control systems, science, etc. Multiplatform MatLAB has made it one of the most widely used products - it has actually become the world-wide standard of technical computing.
The system is different from other similar thanks to:
- designation for engineering calculations;
- a programming language that is close to BASIC is used ;
- easy integration with other systems.
Calculations in the MatLAB environment can be performed in the following modes:
- calculator;
- programming.
- work with vectors and matrices.
System of scientific researches Mathematica
Mathematica System - Wolfram Research , Inc. ( http://www.wolfram.com/ ) has an extremely wide range of tools that translate complex mathematical algorithms into applications. The price is about $ 1460.
Mathematica 1, which appeared in 1988, became the first serious system of computer algebra, which aroused interest from lecturers of universities, postgraduates, engineers and scientists all over the world.
All the algorithms contained in the course of higher mathematics of higher educational institutions are laid in the memory of the system Mathematica .
Mathematica began to feel the sharp competition of other systems of computer mathematics, such as Maple.
Often, users abandoned Mathematica simply because they did not understand the language of the functional programming of the system, the unusual typing of the input by the keys Shift + Enter (usually the input is fixed with the Enter key ), unusual function names, such as Sin [x], with parameters in square brackets and others "trivia".
The advantages of Mathematica include elements of dynamic variables, interactive interface, performs computing faster than its competitors through the support of the capabilities of modern multi-core processors.
5. The system of symbolic algebra Maple
The Maple system was created by a group of symbolic calculations organized by Gonne in 1980 at Waterloo University, Canada. The price of Maple 18 is about $ 3000.
Maple - this Computer Algebraic System (CAS, C . A . S . - Computer Algebra System ), which means its action under the laws of algebra in the study sections Calculations, Differential Equations and Linear Algebra and others.
The system absorbed most of the mathematical functions and rules of their transformations, which are in mathematics. Maple is used to solving the problems of aerodynamics, field theory, thermal conductivity, theoretical mechanics, etc.
The Maple core is used in MathCAD, MatLAB systems. The latest version is Maple 2018.
The Maple system combines:
- powerful programming language (is the language of interactive interaction with the system);
- editor for preparing and editing documents and programs;
- modern multi-window user interface;
- powerful reference system with many thousands of examples;
- the core of the algorithms and rules for the transformation of mathematical expressions;
- software close and character processors;
- library of built-in functions (more than 3000 for Maple 6) and more.
Maple is a powerful programming language based on three languages:
- the input - which is used for the task questions (input data for their processing). This language is the interpretative type and has a large number of definite mathematical and graphical functions.
- Implementation - Se- terms. In this language, the core of the system is prepared.
- programming - Maple-language. This language has traditional means for solving typical programming tasks based on the principles of a structured approach: loops, conditional and unconditional transitions, logical operators, procedures, etc.
Most of the library functions are prepared in Maple-language, which allows users to complete or modify them.
System interface and work in dialog mode
The Maple system has a standard graphical user interface for programs running Windows operating systems.
Document files include the full text of the program, computational results, graphics information, etc.
A file is a program that is written in an intermediate programming language of the system.
When the program is downloaded, a window is displayed on the monitor screen. In the upper part, directly under the title of the window, is the main menu of the system, whose type (its commands) varies depending on the context: if a graphic object is highlighted on the worksheet, the menu contains commands for working with graphics.
Below the main menu is the main toolbar with a number of buttons that duplicate the most frequently used commands in the main menu.
Directly under the toolbar is a context toolbar, whose type depends on which area of the worksheet is located cursor and that in this area is displayed.
Most of the interface window is occupied by a workspace where worksheets are placed, where commands are entered and the results of their execution are displayed.
At the bottom of the window, there is a status bar that displays some parameters of the Maple system, as well as brief information about the selected menu command or toolbar buttons.
Work in dialog mode
The worksheet consists of an input area and an output area.
Dialog with Maple system occurs in question mode: the user enters the command and pressing [ Enter ] transfers them to the kernel of the Maple system.
The result of the team's operation is displayed in the output field.
To enter a formula in a standard mathematical form, you must execute the Insert - Math Input command. In this case, the input field will display command in the form of Maple syntax, and in the output field, the same command will be displayed in the mathematical notation.
Writing text comments is a mode in which any information is understood as text (not fulfilling).
To insert a text comment, follow the Insert - Text command or click the button on the main toolbar or F 5.
In Maple 18, a button that duplicates the command Edit - Execute - Worksheet is entered on the toolbar.
Main elements of Maple syntax :
- / Flashing inclining risk - marker input formula.
- | | Flashing vertical risk is a text input marker.
- ; The sign of the end of the expression with the output of the result of calculations on the screen.
- : A sign of fixation of the end of the expression, which prevents the output of the result on the screen.
- : = Assignment operator (for example, x: = 4 ).
- = Equality operator for equations and logical conditions (for example, a = b ), indicating areas of change of variables (for example, i = 1 .. 5) and parameter values - options in functions and commands (for example, color = black ).
Moving a command to a new line (without execution) is performed by pressing the [ Shift + Enter ] key combination.
All operators introduced in this way form one group and are executed successively by pressing the [ Enter ] key once.
To insert a new line before the cursor is ([ Ctrl + Shift + K ]) and, accordingly, ([ Ctrl + Shift + J ]) to insert a new line after the cursor.
Basic editing operations are in the main menu item Edit.
- Delete Paragraph or Ctrl + Del - erase the selected objects.
- Find ... or Ctrl + F 5 - find the specified text or mathematical string.
- Input Mode or F 5 - Enable / Disable Text Input.
Maple worksheets are stored in files with the extension mw.
It is possible to save the worksheet in other file formats by entering the Save As command in the dialog as the appropriate format, or use the Export As substitution commands :
- Plain Text. txt is a plain text file.
- Maple Text. txt is a text format of maple.
- HTM .html is an HTML format .
- Maple explorer tex is a format for Maple (allows you to view Maple files ).
- RTF. RTF - format RTF (worksheets pasting into documents MS Word while maintaining the color palette).
6. Questions for self-examination
- What is a mathematical model?
- What are the types of algorithms?
- How do I write algorithms?
- How are the programming languages shared?
- Why is there such a large number of computer math systems?
Font Face
Font Size
Text Colour
Background Colour
Font Kerning
Image Visibility
Letter Spacing
Line Height
Link Highlight