Научная статья на тему 'PROGRAMMING ALGORITHM FOR APPROXIMATE SOLUTION OF NEWTON'S EQUATION OF MOTION'

PROGRAMMING ALGORITHM FOR APPROXIMATE SOLUTION OF NEWTON'S EQUATION OF MOTION Текст научной статьи по специальности «Компьютерные и информационные науки»

CC BY
0
0
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
school physics course / movement / time / coordinate / speed / moment of time / equation of motion / acceleration / approximate methods / Euler-Cromer method / algorithm

Аннотация научной статьи по компьютерным и информационным наукам, автор научной работы — Zakhidov Ibrokhimjon Obidzhonovich, Inoyatov Shukrillo Turgunboyevich

It should be noted that the approximate solution of Newton's differential equation helps the student to form initial skills and ideas, but does not cover all computer methods for solving Newton's equation. The article selected the simplest possible mechanical problems and tried to choose the simplest algorithms for its approximate solution. Common languages such as EXEL, BASIC, PASCAL can be used for programming the algorithm. It is known that modern MATLAB (Simulink), MAPLE (PDE_Solve) systems have ready packages for approximate solution of differential equations. However, this article will help the reader to understand their main essence.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «PROGRAMMING ALGORITHM FOR APPROXIMATE SOLUTION OF NEWTON'S EQUATION OF MOTION»

PROGRAMMING ALGORITHM FOR APPROXIMATE SOLUTION OF NEWTON'S EQUATION OF MOTION

*Zakhidov Ibrokhimjon Obidzhonovich, 2Inoyatov Shukrillo Turgunboyevich

'Associate Professor of the Department of Methods of Teaching Physics at Namangan State University, Candidate of Pedagogical Sciences 2Head of the Department of Methods of Teaching Physics at Namangan State University, Candidate of Physical and Mathematical Sciences, Associate Professor https://doi.org/10.5281/zenodo.10702742

Abstract. It should be noted that the approximate solution of Newton's differential equation helps the student to form initial skills and ideas, but does not cover all computer methods for solving Newton's equation. The article selected the simplest possible mechanical problems and tried to choose the simplest algorithms for its approximate solution. Common languages such as EXEL, BASIC, PASCAL can be used for programming the algorithm. It is known that modern MATLAB (Simulink), MAPLE (PDESolve) systems have ready packages for approximate solution of differential equations. However, this article will help the reader to understand their main essence.

Keywords: school physics course, movement, time, coordinate, speed, moment of time, equation of motion, acceleration, approximate methods, Euler-Cromer method, algorithm.

Introduction. The main requirements for modern physics lessons should include: scientific justification of the topic in each lesson; determining the size of the material and its complexity, taking into account the interests and capabilities of students; provide interaction with previously studied materials; determining the system of tasks given to students and their independent work; defining the material and technical equipment of the lesson and enriching it with additional visual aids; the use of additional media, the introduction of methods of constantly showing physical processes using software and improving the teaching methodology. In order to further improve the educational process, suggestions and recommendations have been made in our research works on the implementation of the above-mentioned tasks, teaching by ensuring the interrelation of knowledge, using software in the educational process, and developing the scientific outlook and ecological thinking of students [1-6]. At the same time: development of new innovative methods and software for teaching chapters and topics of the school physics course; in the process of improving physics education, we believe that it is appropriate to develop the teaching methodology of the selected educational materials in teaching the subjects of the physics course of the school, based on the results of experiments, and to increase the interest of students in concrete and technical sciences. From this point of view, we tried to choose the simplest algorithms for the approximate solution of Newton's equations of motion.

At a time when constant use of digital knowledge and modern information technologies in educational activities is required to achieve the effectiveness of teaching subjects: it is of great importance for the teacher to know how modern information and communication technologies are used in the educational process when collecting, processing and teaching specific educational material.

Methods. Equation of motion. In the general high school physics course [7] Newton's equation is studied as a special case - the uniformly accelerated motion of a body under the

influence of a constant force. For example, for a body with coordinates and velocity xo, at the initial time t=0, and moving along the X axis under the influence of a constant force F=const, the form of this equation is as follows

ma = F = const (!)

it is required to find the coordinate (x) and velocity ( 0 ) at the next instants of time. The solution to this problem is as follows

Ft _ o0 + o Ft2 0 = 0 0 +- D = —- X = xo+0t = x0 + x01 + -—

0 m , 2 , 0 0 0 2 m . (2)

In general, in many problems in nature, the force acting on an object may depend on time, coordinate, or velocity. In such cases, the differential form of the equation of motion is written as follows

ma = md-x = F(t ,x,o)

dt2 (3)

This is a 2nd-order single differential equation that can be replaced by the following system of lst-order two-differential equations

i do Ft,x,o a t,x,o!=-= ml dt m

(4a, 4b)

Expression (4a) is called instantaneous acceleration (value of acceleration at time t), and expression (4b) is called instantaneous velocity (value of velocity at time t). Note that the instantaneous acceleration in (4a) is not constant as in (1), but varies with time, coordinate, or velocity changes.

Results. Approximate methods: Euler-Cromer method. Let's consider the problem of

determining the coordinate and velocity value x(t! , o(t! at an arbitrary moment of time t >0 by solving equation (3) or (4) if the form of the force acting on the body is

F(t,x ,0! and the coordinate and velocity value x° , 00 at the initial moment of time t = 0 is given.

Usually, such problems are covered in a differential equations course, and only certain types of equations can be solved exactly. If it is not possible to find an exact analytical solution, then approximate numerical methods are used. Such methods are quite universal and allow to find a numerical solution to a wide range of problems such as (3) and analyze the solution graphically.

A summary of the approximate methods is as follows: the total time interval t max is divided

N At ^ t / N

into JV small steps max , and then the problem is solved approximately in these

At time steps. One of the widely used numerical methods is the Euler-Cromer method [8, 9], whose algorithm is as follows:

t = 0

u=u

0

F ( t,x,u )

a =—!--

m

Print the results t ,

t = t+At u = u + aAt x = x + uAt

x = x

0

(5a)

(5b)

(5c)

(5d) (5e) (5f)

initially, coordinate ( x ) and speed ( u ) variables are assigned values t 0 at the initial

time x0 , U0 (5a);

knowing the coordinate, time and speed values, the force is determined, and then the acceleration is found (5b);

the results for this moment of time are recorded (5c);

moves to the next moment of time (time counter increases to At ) (5d);

the value of speed (5e) and coordinate (5f) corresponding to the new moment of time is calculated;

then points (5b-5f) are repeated cyclically.

Pay attention to the following:

(5c and 5f) formulas have the previous (old) value of speed and coordinate on the right sides, and the new values on the left sides;

t > t

max

time according to the condition of

(5b-5f) points can be stopped after a certain the cyclic repetition;

the choice of time step At depends on the type of problem. For example, if the oscillatory motion is considered At ^ T/ N , (I-oscillation period, N —100 ). if

At ^ t / N t

accelerating or decelerating motion due to resistance is considered, max , (

max

approximate value of total motion time, N ^10 —100 ).

Oscillating motion of a body under the influence of elastic force. Small vibrations of the body under the influence of elastic force (Hooke force) are also called harmonic oscillator. Its equation of motion is:

ma=-kx

So the acceleration (force) is a function of the coordinate x,

k 2 [k a=—x =-œ x o=\ — m V m

(6)

(7)

this problem is not a uniformly accelerated motion like (1) (2)! The initial conditions for this problem are given as follows

x

u

a

t=0 *0=1 u0=0 a = 1 (k = m = l)

(8)

It is required to find the solution in (8) (that is, information about the coordinate, velocity, kinetic and potential energies, etc.) at the next instant of time by the Euler-Cromer method.

More precisely, a body attached to an elastic force (for example, a spring) is initially

x = 1

stretched 0 units and then released. In this case, the characteristic time-oscillation

period is T = 2n/^ = 2 n/1^6-28 , so the time step should be taken in the order of

At«T/N = 6/°.6 . We choose even smaller, At=0.2 .

In Table 1 below (5a-5f), the calculation results (some values) of the algorithm are presented in columns t, x, 0 . For the purpose of comparison, in the last two columns, the values of the exact solution of the problem are x exact, 0 exact.

xexact = c0s (0t! dsd , °exact=-W Sin ( 0t! (9)

Calculations can also be done on a calculator, although it takes a little more time. But the MS EXEL method is convenient: the algorithm (5a-5f) is easily written and the calculation is much easier, the graph of the results can also be drawn in MS EXEL or MS WORD programs.

Table 1

t X u X exact U exact

0,00 1,00 0,00 1,00 0,00

0,20 0,96 -0,20 0,98 -0,20

0,40 0,88 -0,39 0,92 -0,39

0,60 0,77 -0,57 0,83 -0,56

2,80 -0,98 -0,33 -0,94 -0,33

3,00 -1,00 -0,14 -0,99 -0,14

3,20 -0,99 0,06 -1,00 0,06

3,40 -0,94 0,26 -0,97 0,26

5,40 0,72 0,77 0,63 0,77

5,60 0,84 0,63 0,78 0,63

5,80 0,94 0,46 0,89 0,46

6,00 0,99 0,27 0,96 0,28

X

X exact

Figure 1. A graph with exact solution coordinate values

It can be seen from the given graph (Figure 1) that the coordinate values are close to the

exact solution. If the time step At is made smaller, for example, if we choose At = 0 •02 , the accuracy will increase even more.

Discussion. Movement under the influence of a variable force. A body with a mass of 1

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

kg began to be acted upon by a force F = at linearly dependent on time along the X-axis.

Acceleration, coordinate and velocity t = 2 sec after the start of motion. How does it change over time?

Solve the problem by the Euler-Cromer approximation method.

Graph the coordinate and velocity functions, a = 2 N/sec. In this case, acceleration (force) is a function of time t , since

F t 21

a =— = at=21

m , a = 2 (10) and (2) can't be used for linear accelerated motion formulas.

In order to verify the obtained results, we present the exact solution of problem (10).

J 2

=0L = 0L

x exact 6 , 0 exact= 2 (11)

Since m=l kg, we omitted it from the following formulas. Time step At=tmax/10=2/10=0,2. Below is a graphical representation of the exact and approximate solutions found using the (5a-5f) algorithm (Fig. 2).

V exact X X exact

V

3,5

2,5

1,5

0,5

0

0.2

0.4

0.6

0.8

1.2 1.4 1.6 1.8

Figure 2. A graph of approximate solutions found using the algorithm

It can be seen from the graph that the approximate instantaneous speed values are far from the exact result. To reduce this error, the accuracy can be increased by choosing a smaller

time interval = 0-02 .

Conclusion. The above examples were chosen to simplify for the reader and have a clear solution. But not all problems in nature always have a clear solution. At that time, approximate methods are mainly used to solve the equation of motion. Take, for example, the planets moving through the solar system. Each planet is influenced by Newton's law of gravitation, both with the Sun at the center and with each other. As a result, the problem consists of a system of several interconnected equations of motion. Solving such systems is much more difficult than the above examples and can only be solved approximately with the help of computer programs. In the future, we recommend using more literature to learn, master, and get a broader picture of how to solve such problems.

3

2

0

REFERENCES

1. Qodirov X. A., Ismoilov I. V. Bozorqulov AA va Zaxidov IO Magnit maydonda tokli o'tkazgichni ko'chirishda bajarilgan ish //Elektron hosoblash mashinalari uchun dastur № DGU. - 2022. - T. 18016.

2. Obidjonovich Z. I., Anvarovich Q. X. ELEKTROMAGNIT INDUKSIYA HODISASINI MAKTAB FIZIKA KURSIDA O 'QITISHDA DASTURIY TA'MINOTLARDAN

FOYDALANISH //Science and innovation. - 2023. - Т. 2. - №. Special Issue 5. - С. 556560.

3. Alijanov D., Zaxidov I. Таълимда фанлараро богланишларнинг функциялари //Science and innovation. - 2022. - Т. 1. - №. B7. - С. 1406-1411.

4. Boyto'Raeva G. ФАНЛАРАРО АЛО^АДОРЛИК ВА УНИНГ ЯРИМУТКАЗГИЧЛАР ФИЗИКАСИНИ У^ИТИШДАГИ УРНИ //Science and innovation. - 2022. - Т. 1. - №. B4. - С. 533-537.

5. Umarov A., Zakhidov I., Boyturayeva G. INTERDISCIPLINARY RELATIONSHIPS AND ITS APPLICATION IN TEACHING THE TOPICS OF ELECTRICITY IN A SCHOOL PHYSICS COURSE //Science and innovation. - 2024. - Т. 3. - №. B1. - С. 166-170.

6. Ibroximjon Z., Abduraxmon K. TABIIY FANLARNI О 'QITISHDA SUV VA SUVGA DOIR BILIMLARDAN FOYDALANISH ORQALI О ' QUVCHILARNING EKOLOGIK TAFAKKURINI RIVO JLANTIRISH //Fergana state university conference. - 2023.

7. P.Q.Habibullayev, A.Boydedayev, A.D.Bahromov.- Fizika: umumiy o'rta ta'lim maktablari 7-sinfi uchun darslik/ Qayta ishlangan uchinchi nashr. — T.: «O'zbekiston milliy ensiklopediyasi» Davlat ilmiy nashriyoti, 2017. - 176 b.

8. Гулд Х., Табочник Я. Компьютерное моделирование в физике. Часть I. (Перевод с англ) М.: Мир, 1990. ст.349.

9. Хеерман Д.В. Методы компьютерного эксперимента в теоретической физике. (Перевод с англ) М.: Наука, 1990. ст.176.

i Надоели баннеры? Вы всегда можете отключить рекламу.