{"id":353847,"date":"2024-05-20T22:36:31","date_gmt":"2024-05-20T22:36:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=353847"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=353847","title":{"rendered":"<span>\u0428\u0430\u0433 \u0432 \u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u043a\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\u0414\u0430\u0432\u043d\u044b\u043c-\u0434\u0430\u0432\u043d\u043e, \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u043b\u043e \u0432\u0437\u043e\u0440\u044b \u043a \u043d\u0435\u0431\u0435\u0441\u0430\u043c \u0438 \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u043e \u0441\u0435\u0431\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e \u043f\u0440\u0438\u0440\u043e\u0434\u0435 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u043a\u0430 \u0441\u0442\u0430\u043b\u0430 \u043a\u043b\u044e\u0447\u043e\u043c \u043a \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439. \u041c\u044b \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0447\u0435\u0440\u043d\u044b\u0435 \u0434\u044b\u0440\u044b, \u0438\u0437\u0443\u0447\u0430\u0435\u043c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043f\u043b\u0430\u043d\u0435\u0442 \u0438 \u0437\u0432\u0451\u0437\u0434, \u0440\u0430\u0437\u0433\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a.<\/p>\n<p>  \u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u0417\u0434\u0435\u0441\u044c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0412\u0441\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0430, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0432\u0451\u0437\u0434\u044b \u0438 \u043f\u043b\u0430\u043d\u0435\u0442\u044b, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/yj\/pl\/yq\/yjplyqki7ytzptyp5j4dshwgt-4.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/yj\/pl\/yq\/yjplyqki7ytzptyp5j4dshwgt-4.jpeg\" data-blurred=\"true\"\/><br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 Python \u0441\u0442\u0430\u043b \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u043a\u043e\u0432 \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043e\u043d \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0436\u0438\u0437\u043d\u044c \u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u043a\u043e\u0432 \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0438\u043c \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u043d\u043e\u0432\u044b\u0445 \u0432\u044b\u0441\u043e\u0442 \u0432 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u043a\u043e\u0441\u043c\u043e\u0441\u0430.<\/p>\n<h3>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u043d\u0430\u0443\u043a\u0435, \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u2014 \u044d\u0442\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u044f. \u0417\u0434\u0435\u0441\u044c \u0432 \u0438\u0433\u0440\u0443 \u0432\u0441\u0442\u0443\u043f\u0430\u0435\u0442 <b>NumPy<\/b>. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 NumPy \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>  <b>SciPy<\/b> \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435, \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a SciPy \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u043a\u0430\u043c \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u044b\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043e \u0412\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u2014 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u0434\u0435\u043b\u0430. <b>Matplotlib<\/b> \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u043a\u0430\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439, \u0434\u0435\u043b\u0430\u044f \u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438 \u0438 \u0434\u0435\u043b\u0430\u044f \u043d\u0430\u0448\u0435 \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u044b \u0431\u043e\u043b\u0435\u0435 \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u043c.<\/p>\n<h1>\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439<\/h1>\n<p>  <\/p>\n<h3>\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u043d\u0435\u0442 \u0438 \u0437\u0432\u0451\u0437\u0434<\/h3>\n<p>  \u0410\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u043a\u0430 \u2014 \u044d\u0442\u043e \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u043d\u0435\u0442 \u0438 \u0437\u0432\u0451\u0437\u0434. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043e\u0440\u0431\u0438\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043d\u0430\u043c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043d\u0435\u0431\u0435\u0441\u043d\u044b\u0445 \u0442\u0435\u043b \u043d\u0430 \u043c\u043d\u043e\u0433\u0438\u0435 \u0433\u043e\u0434\u044b \u0432\u043f\u0435\u0440\u0451\u0434. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u043e\u0440\u0431\u0438\u0442\u0443 \u043f\u043b\u0430\u043d\u0435\u0442\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u0437\u0432\u0435\u0437\u0434\u044b:<\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b G = 6.67430e-11  # \u0413\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f M_star = 1.989e30  # \u041c\u0430\u0441\u0441\u0430 \u0437\u0432\u0435\u0437\u0434\u044b (\u0421\u043e\u043b\u043d\u0446\u0435) M_planet = 5.972e24  # \u041c\u0430\u0441\u0441\u0430 \u043f\u043b\u0430\u043d\u0435\u0442\u044b (\u0417\u0435\u043c\u043b\u044f) r_initial = 1.496e11  # \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0421\u043e\u043b\u043d\u0446\u0430 (\u0430\u043f\u0441\u0442\u0440\u0438\u043c)  # \u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b t_max = 3.154e7 * 1  # \u0413\u043e\u0434 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445 (\u043e\u0434\u0438\u043d \u0437\u0435\u043c\u043d\u043e\u0439 \u0433\u043e\u0434) dt = 3600  # \u0428\u0430\u0433 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 (\u043e\u0434\u0438\u043d \u0447\u0430\u0441)  # \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 time_points = [] distances = []  # \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f r = r_initial v = 0  # \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c  # \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u042d\u0439\u043b\u0435\u0440\u0430 for t in np.arange(0, t_max, dt):     F_gravity = -G * M_star * M_planet \/ r**2     a = F_gravity \/ M_planet     v += a * dt     r += v * dt     time_points.append(t)     distances.append(r)  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f plt.plot(time_points, distances) plt.xlabel(\"\u0412\u0440\u0435\u043c\u044f (\u0441\u0435\u043a\u0443\u043d\u0434\u044b)\") plt.ylabel(\"\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0421\u043e\u043b\u043d\u0446\u0430 (\u043c\u0435\u0442\u0440\u044b)\") plt.title(\"\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0440\u0431\u0438\u0442\u044b \u043f\u043b\u0430\u043d\u0435\u0442\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u0437\u0432\u0435\u0437\u0434\u044b\") plt.grid(True) plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/lf\/hs\/t5\/lfhst5pbw9e3pqk84ehuc66o-xy.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/lf\/hs\/t5\/lfhst5pbw9e3pqk84ehuc66o-xy.jpeg\" data-blurred=\"true\"\/>  <\/p>\n<h3>\u0412\u043b\u0438\u044f\u043d\u0438\u0435 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0440\u0431\u0438\u0442\u044b<\/h3>\n<p>  \u0413\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u044f \u2014 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432, \u0432\u043b\u0438\u044f\u044e\u0449\u0438\u0445 \u043d\u0430 \u043e\u0440\u0431\u0438\u0442\u044b \u043d\u0435\u0431\u0435\u0441\u043d\u044b\u0445 \u0442\u0435\u043b. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u043b\u0430\u043d\u0435\u0442\u0430\u043c\u0438 \u0438 \u0437\u0432\u0451\u0437\u0434\u0430\u043c\u0438. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 \u0434\u0432\u0435 \u043f\u043b\u0430\u043d\u0435\u0442\u044b:<\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b G = 6.67430e-11  # \u0413\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f M_star = 1.989e30  # \u041c\u0430\u0441\u0441\u0430 \u0437\u0432\u0435\u0437\u0434\u044b (\u0421\u043e\u043b\u043d\u0446\u0435) M_planet1 = 5.972e24  # \u041c\u0430\u0441\u0441\u0430 \u043f\u043b\u0430\u043d\u0435\u0442\u044b 1 (\u0417\u0435\u043c\u043b\u044f) M_planet2 = 6.39e23  # \u041c\u0430\u0441\u0441\u0430 \u043f\u043b\u0430\u043d\u0435\u0442\u044b 2 (\u041c\u0430\u0440\u0441) r_initial = 1.496e11  # \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0421\u043e\u043b\u043d\u0446\u0430 (\u0430\u043f\u0441\u0442\u0440\u0438\u043c)  # \u0412\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b t_max = 3.154e7 * 2  # \u0413\u043e\u0434 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445 (\u0434\u0432\u0430 \u0437\u0435\u043c\u043d\u044b\u0445 \u0433\u043e\u0434\u0430) dt = 3600  # \u0428\u0430\u0433 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 (\u043e\u0434\u0438\u043d \u0447\u0430\u0441)  # \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 time_points = [] distances_planet1 = [] distances_planet2 = []  # \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f r1 = r_initial r2 = r_initial * 1.5  # \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u041c\u0430\u0440\u0441\u0430 \u043e\u0442 \u0421\u043e\u043b\u043d\u0446\u0430 v1 = 0  # \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043b\u0430\u043d\u0435\u0442\u044b 1 v2 = 0  # \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043b\u0430\u043d\u0435\u0442\u044b 2  # \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u042d\u0439\u043b\u0435\u0440\u0430 for t in np.arange(0, t_max, dt):     F_gravity1 = -G * M_star * M_planet1 \/ r1**2     F_gravity2 = -G * M_star * M_planet2 \/ r2**2     a1 = F_gravity1 \/ M_planet1     a2 = F_gravity2 \/ M_planet2     v1 += a1 * dt     v2 += a2 * dt     r1 += v1 * dt     r2 += v2 * dt     time_points.append(t)     distances_planet1.append(r1)     distances_planet2.append(r2)  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f plt.plot(time_points, distances_planet1, label=\"\u0417\u0435\u043c\u043b\u044f\") plt.plot(time_points, distances_planet2, label=\"\u041c\u0430\u0440\u0441\") plt.xlabel(\"\u0412\u0440\u0435\u043c\u044f (\u0441\u0435\u043a\u0443\u043d\u0434\u044b)\") plt.ylabel(\"\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0421\u043e\u043b\u043d\u0446\u0430 (\u043c\u0435\u0442\u0440\u044b)\") plt.title(\"\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0417\u0435\u043c\u043b\u0438 \u0438 \u041c\u0430\u0440\u0441\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 \u0421\u043e\u043b\u043d\u0446\u0430\") plt.legend() plt.grid(True) plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/ws\/wg\/rl\/wswgrlmuetlzymmn6gczgkv_zp8.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/ws\/wg\/rl\/wswgrlmuetlzymmn6gczgkv_zp8.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043b\u0430\u043d\u0435\u0442, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0438\u0445 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<h1>\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0447\u0435\u0440\u043d\u044b\u0445 \u0434\u044b\u0440 \u0438 \u043d\u0435\u0439\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u0437\u0432\u0451\u0437\u0434<\/h1>\n<p>  <\/p>\n<h3>\u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/h3>\n<p>  \u0427\u0435\u0440\u043d\u044b\u0435 \u0434\u044b\u0440\u044b \u0438 \u043d\u0435\u0439\u0442\u0440\u043e\u043d\u043d\u044b\u0435 \u0437\u0432\u0451\u0437\u0434\u044b \u2014 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0447\u0443\u0434\u0435\u0441\u0430 \u0412\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/2c\/lu\/i1\/2clui1upjhzntxrtpcquoh5t5zg.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/2c\/lu\/i1\/2clui1upjhzntxrtpcquoh5t5zg.jpeg\" data-blurred=\"true\"\/><\/p>\n<p>  \u0422\u0440\u0438 \u0444\u0430\u043a\u0442\u0430 \u043e \u0447\u0435\u0440\u043d\u044b\u0445 \u0434\u044b\u0440\u0430\u0445:<br \/>  <b>1. \u0412\u0440\u0435\u043c\u044f \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043b\u0435 \u0447\u0435\u0440\u043d\u044b\u0445 \u0434\u044b\u0440:<\/b> \u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043e\u0431\u0449\u0435\u0439 \u0442\u0435\u043e\u0440\u0438\u0435\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0410\u043b\u044c\u0431\u0435\u0440\u0442\u0430 \u042d\u0439\u043d\u0448\u0442\u0435\u0439\u043d\u0430, \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u044f \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435\u0441\u044c \u0432\u0431\u043b\u0438\u0437\u0438 \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b, \u0433\u0434\u0435 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e\u0435, \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u043d\u0435 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438. \u042d\u0442\u043e \u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u0438\u043b\u0430\u0442\u0430\u0446\u0438\u0435\u0439. \u0415\u0441\u043b\u0438 \u0431\u044b \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043a\u043e\u0433\u043e-\u0442\u043e, \u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u0432 \u0447\u0435\u0440\u043d\u0443\u044e \u0434\u044b\u0440\u0443, \u0442\u043e \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0447\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0443 \u044d\u0442\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0438\u0434\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0438 \u043e\u043d \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b.<\/p>\n<p>  <b>2. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b \u0431\u044b\u043b \u043d\u0435 \u0430\u0441\u0442\u0440\u043e\u043d\u043e\u043c<\/b>: \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0441\u0430\u043c\u043e\u0439 \u0437\u043d\u0430\u043c\u0435\u043d\u0438\u0442\u043e\u0439 \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0441\u0442\u0430\u043b\u0430 \u0447\u0435\u0440\u043d\u0430\u044f \u0434\u044b\u0440\u0430 \u0432 \u0446\u0435\u043d\u0442\u0440\u0435 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0438 \u041c\u043b\u0435\u0447\u043d\u044b\u0439 \u041f\u0443\u0442\u044c, \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043a\u0430\u043a \u0421\u0433\u0443\u0449\u0435\u043d\u0438\u0435 \u0432 \u0421\u043a\u043e\u0440\u043f\u0438\u043e\u043d\u0435 (Sagittarius A*). \u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u0443 \u0447\u0435\u0440\u043d\u0443\u044e \u0434\u044b\u0440\u0443 \u043e\u0442\u043a\u0440\u044b\u043b \u043d\u0435 \u0430\u0441\u0442\u0440\u043e\u043d\u043e\u043c, \u0430 \u0440\u0430\u0434\u0438\u043e\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u041a\u0430\u0440\u043b \u042f\u043d\u0441\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b \u0440\u0430\u0434\u0438\u043e\u0432\u043e\u043b\u043d\u044b \u0438\u0437 \u0446\u0435\u043d\u0442\u0440\u0430 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0438 \u0432 1960-\u0445 \u0433\u043e\u0434\u0430\u0445. \u041e\u043d \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u0438\u043a\u043e\u043c \u0440\u0430\u0434\u0438\u043e\u0430\u0441\u0442\u0440\u043e\u043d\u043e\u043c\u0438\u0438.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/uf\/ly\/c7\/uflyc7pkixyucbsgqh6qizzr6rc.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/uf\/ly\/c7\/uflyc7pkixyucbsgqh6qizzr6rc.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u043e\u043c\u043e\u0433\u043b\u043e \u0430\u0441\u0442\u0440\u043e\u043d\u043e\u043c\u0430\u043c \u043f\u043e\u043d\u044f\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0447\u0435\u0440\u043d\u044b\u0445 \u0434\u044b\u0440 \u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432.<\/p>\n<p>  <b>3. \u0427\u0435\u0440\u043d\u044b\u0435 \u0434\u044b\u0440\u044b \u0438\u0441\u043f\u0430\u0440\u044f\u044e\u0442\u0441\u044f:<\/b> \u0427\u0435\u0440\u043d\u044b\u0435 \u0434\u044b\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u0430\u0440\u044f\u0442\u044c\u0441\u044f! \u042d\u0442\u043e \u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u0430\u0440\u0435\u043d\u0438\u0435\u043c \u0425\u043e\u043a\u0438\u043d\u0433\u0430, \u0438 \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0444\u0438\u0437\u0438\u043a\u043e\u043c \u0421\u0442\u0438\u0432\u0435\u043d\u043e\u043c \u0425\u043e\u043a\u0438\u043d\u0433\u043e\u043c \u0432 1974 \u0433\u043e\u0434\u0443. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0435\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438, \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u044b\u0435 \u0444\u043b\u0443\u043a\u0442\u0443\u0430\u0446\u0438\u0438 \u0432\u0431\u043b\u0438\u0437\u0438 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0438\u0437\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u0442\u0438\u0446. \u042d\u0442\u043e \u0438\u0437\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0443 \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b, \u0438, \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435, \u0447\u0435\u0440\u043d\u0430\u044f \u0434\u044b\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u0447\u0435\u0437\u043d\u0443\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e. \u042d\u0442\u043e \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u0435\u0442 \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u0435\u0439 \u0438 \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u043e\u0439.<br \/>  \u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0445 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u043a\u043e\u043d\u043e\u0432, \u043d\u043e \u0438 \u0443\u043c\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. <\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b:  <\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b M_bh = 1.989e30 * 10  # \u041c\u0430\u0441\u0441\u0430 \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b (10 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u044b\u0445 \u043c\u0430\u0441\u0441) r_schwarzchild = (2 * 6.67430e-11 * M_bh) \/ (3e8)**2  # \u0420\u0430\u0434\u0438\u0443\u0441 \u0428\u0432\u0430\u0440\u0446\u0448\u0438\u043b\u044c\u0434\u0430  # \u0420\u0430\u0441\u0447\u0435\u0442 \u043e\u0440\u0431\u0438\u0442\u044b \u0447\u0430\u0441\u0442\u0438\u0446\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b def calculate_orbit(initial_distance, initial_velocity, time_step, total_time):     r = initial_distance     v = initial_velocity     time_points = []     distances = []      for t in np.arange(0, total_time, time_step):         a = -(6.67430e-11 * M_bh) \/ r**2         v += a * time_step         r += v * time_step         time_points.append(t)         distances.append(r)      return time_points, distances  # \u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0440\u0431\u0438\u0442\u044b \u0447\u0430\u0441\u0442\u0438\u0446\u044b initial_distance = 1.5 * r_schwarzchild  # \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0446\u0435\u043d\u0442\u0440\u0430 \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b initial_velocity = 0.9 * (2 * 6.67430e-11 * M_bh \/ initial_distance)**0.5  # \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c time_step = 1  # \u0428\u0430\u0433 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 total_time = 1000  # \u0412\u0440\u0435\u043c\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f  time_points, distances = calculate_orbit(initial_distance, initial_velocity, time_step, total_time)  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0440\u0431\u0438\u0442\u044b plt.plot(time_points, distances) plt.xlabel(\"\u0412\u0440\u0435\u043c\u044f (\u0441\u0435\u043a\u0443\u043d\u0434\u044b)\") plt.ylabel(\"\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0442 \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b (\u043c\u0435\u0442\u0440\u044b)\") plt.title(\"\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0440\u0431\u0438\u0442\u044b \u0447\u0430\u0441\u0442\u0438\u0446\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b\") plt.grid(True) plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/wk\/zy\/bd\/wkzybdhyvob6qheihvmsscyc9yi.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/wk\/zy\/bd\/wkzybdhyvob6qheihvmsscyc9yi.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a Python \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0440\u0431\u0438\u0442\u044b \u0447\u0430\u0441\u0442\u0438\u0446\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u0447\u0435\u0440\u043d\u043e\u0439 \u0434\u044b\u0440\u044b.<\/p>\n<h3>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441 \u0438 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438<\/h3>\n<p>  \u041d\u0435\u0439\u0442\u0440\u043e\u043d\u043d\u044b\u0435 \u0437\u0432\u0451\u0437\u0434\u044b \u2014 \u044d\u0442\u043e \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0439 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0441\u0436\u0430\u0442\u044b\u043c\u0438 \u044f\u0434\u0440\u0430\u043c\u0438. \u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0445 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. Python \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0432 \u044d\u0442\u043e\u043c:  <\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441 \u043d\u0435\u0439\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u0437\u0432\u0451\u0437\u0434 np.random.seed(0) mean_mass = 1.4  # \u0421\u0440\u0435\u0434\u043d\u044f\u044f \u043c\u0430\u0441\u0441\u0430 \u043d\u0435\u0439\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u0437\u0432\u0435\u0437\u0434\u044b (\u0432 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0430\u0445) std_deviation = 0.2  # \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u044b num_samples = 1000  # \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0432\u0451\u0437\u0434  neutron_star_masses = np.random.normal(mean_mass, std_deviation, num_samples)  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441 plt.hist(neutron_star_masses, bins=30, density=True, alpha=0.6, color='g', label='\u041c\u0430\u0441\u0441\u0430 \u043d\u0435\u0439\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u0437\u0432\u0451\u0437\u0434') plt.xlabel(\"\u041c\u0430\u0441\u0441\u0430 (\u0432 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0430\u0445)\") plt.ylabel(\"\u041f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438\") plt.title(\"\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441 \u043d\u0435\u0439\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u0437\u0432\u0451\u0437\u0434\") plt.legend() plt.grid(True) plt.show() <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/3g\/ro\/wx\/3growxzw5jtwnvaa0xrrhgwyfcm.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/3g\/ro\/wx\/3growxzw5jtwnvaa0xrrhgwyfcm.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441 \u043d\u0435\u0439\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u0437\u0432\u0451\u0437\u0434.<\/p>\n<p>  <a href=\"https:\/\/otus.pw\/yruH\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/jt\/gl\/uw\/jtgluwzk-dmheaqhrc-ww6shkhy.png\" data-src=\"https:\/\/habrastorage.org\/webt\/jt\/gl\/uw\/jtgluwzk-dmheaqhrc-ww6shkhy.png\"\/><br \/>  <\/a><\/p>\n<h1>\u0421\u0432\u0435\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0438 \u0441\u043f\u0435\u043a\u0442\u0440 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a<\/h1>\n<p>  <\/p>\n<h3>\u0420\u0430\u0441\u0447\u0451\u0442 \u0441\u043f\u0435\u043a\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a<\/h3>\n<p>  \u0421\u0432\u0435\u0442, \u0438\u0437\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0430\u043c\u0438, \u0445\u0440\u0430\u043d\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 \u043e \u0438\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u0435, \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0438 \u0438 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0441\u043f\u0435\u043a\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0438:  <\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043f\u0435\u043a\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0438 wavelengths = np.linspace(400, 700, 1000)  # \u0414\u043b\u0438\u043d\u044b \u0432\u043e\u043b\u043d \u043e\u0442 400 \u043d\u043c \u0434\u043e 700 \u043d\u043c flux = np.random.normal(1.0, 0.1, 1000)  # \u0418\u043c\u0438\u0442\u0430\u0446\u0438\u044f \u0441\u043f\u0435\u043a\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0441\u0432\u0435\u0442\u0430)  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043f\u0435\u043a\u0442\u0440\u0430 plt.plot(wavelengths, flux) plt.xlabel(\"\u0414\u043b\u0438\u043d\u0430 \u0432\u043e\u043b\u043d\u044b (\u043d\u043c)\") plt.ylabel(\"\u0418\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u044c\") plt.title(\"\u0421\u043f\u0435\u043a\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0438\") plt.grid(True) plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/rg\/75\/c0\/rg75c04zstne7rw9vyb-bc_s7n8.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/rg\/75\/c0\/rg75c04zstne7rw9vyb-bc_s7n8.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043f\u0435\u043a\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0438, \u0434\u0435\u043b\u0430\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u043c.<\/p>\n<h3>\u0410\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439<\/h3>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u043c\u0438 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438. Python \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043c\u043e\u0433\u0430\u044f \u0443\u0447\u0435\u043d\u044b\u043c \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0446\u0435\u043d\u043d\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044f\u0445 \u0438 \u0445\u0438\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u0435. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0437\u0432\u0451\u0437\u0434 \u0432 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0435:  <\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0437\u0432\u0451\u0437\u0434 \u0432 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0435 # (\u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445) velocities = np.random.normal(200, 50, 100)  # \u0418\u043c\u0438\u0442\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 (\u043a\u043c\/\u0441) distances = np.random.uniform(0, 100, 100)  # \u0418\u043c\u0438\u0442\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0438 (\u043c\u043b\u043d \u0441\u0432\u0435\u0442\u043e\u0432\u044b\u0445 \u043b\u0435\u0442)  # \u0410\u043d\u0430\u043b\u0438\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f plt.scatter(distances, velocities, marker='o', s=10, alpha=0.6) plt.xlabel(\"\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 (\u043c\u043b\u043d \u0441\u0432\u0435\u0442\u043e\u0432\u044b\u0445 \u043b\u0435\u0442)\") plt.ylabel(\"\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c (\u043a\u043c\/\u0441)\") plt.title(\"\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0437\u0432\u0451\u0437\u0434 \u043e\u0442 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0435\") plt.grid(True) plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/8o\/e2\/nt\/8oe2ntyaew3wn7qawj6rtuvpqwa.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/8o\/e2\/nt\/8oe2ntyaew3wn7qawj6rtuvpqwa.jpeg\" data-blurred=\"true\"\/>  <\/p>\n<h1>\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u043d\u0435\u0442\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c<\/h1>\n<p>  <\/p>\n<h3>\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438<\/h3>\n<p>  \u0418\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0438\u0437 \u043c\u0435\u043b\u044c\u0447\u0430\u0439\u0448\u0438\u0445 \u0447\u0430\u0441\u0442\u0438\u0446 \u043f\u044b\u043b\u0438 \u0438 \u0433\u0430\u0437\u0430 \u0440\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043b\u0430\u043d\u0435\u0442\u044b. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441:  <\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u0418\u043c\u0438\u0442\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438 num_particles = 1000 positions = np.random.uniform(0, 1, (num_particles, 2))  # \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 masses = np.random.uniform(1e20, 1e24, num_particles)  # \u0421\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u044b \u0447\u0430\u0441\u0442\u0438\u0446 radii = np.sqrt(masses)  # \u0420\u0430\u0434\u0438\u0443\u0441\u044b \u0447\u0430\u0441\u0442\u0438\u0446 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b \u043a\u043e\u0440\u043d\u044e \u0438\u0437 \u043c\u0430\u0441\u0441\u044b  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f plt.scatter(positions[:, 0], positions[:, 1], s=radii \/ 1e21, alpha=0.6) plt.xlabel(\"X-\u043f\u043e\u0437\u0438\u0446\u0438\u044f\") plt.ylabel(\"Y-\u043f\u043e\u0437\u0438\u0446\u0438\u044f\") plt.title(\"\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438\") plt.grid(True) plt.show() <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/jj\/rr\/eu\/jjrreutog2dxghlozzrqdhgwc-s.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/jj\/rr\/eu\/jjrreutog2dxghlozzrqdhgwc-s.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a \u0438\u0437 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438.<\/p>\n<h1>\u0414\u0438\u043d\u0430\u043c\u0438\u043a\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u043d\u0435\u0442<\/h1>\n<p>  \u0421\u043e\u043b\u043d\u0435\u0447\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0438 \u043f\u043b\u0430\u043d\u0435\u0442\u044b \u0434\u0432\u0438\u0433\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0421\u043e\u043b\u043d\u0446\u0430, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044f \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0443 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u043d\u0435\u0442:  <\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0440\u0431\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0438 \u043f\u043b\u0430\u043d\u0435\u0442\u044b def simulate_planet_orbit(semi_major_axis, eccentricity, num_points):     theta = np.linspace(0, 2 * np.pi, num_points)     r = semi_major_axis * (1 - eccentricity**2) \/ (1 + eccentricity * np.cos(theta))     x = r * np.cos(theta)     y = r * np.sin(theta)     return x, y  # \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u0440\u0431\u0438\u0442\u044b \u0417\u0435\u043c\u043b\u0438 semi_major_axis_earth = 1.0  # \u0411\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u043e\u043b\u0443\u043e\u0441\u044c \u0432 \u0430\u0441\u0442\u0440\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u0445 eccentricity_earth = 0.0167  # \u042d\u043a\u0441\u0446\u0435\u043d\u0442\u0440\u0438\u0441\u0438\u0442\u0435\u0442 \u043e\u0440\u0431\u0438\u0442\u044b \u0417\u0435\u043c\u043b\u0438  # \u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0440\u0431\u0438\u0442\u044b \u0417\u0435\u043c\u043b\u0438 x_earth, y_earth = simulate_planet_orbit(semi_major_axis_earth, eccentricity_earth, 1000)  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0440\u0431\u0438\u0442\u044b \u0417\u0435\u043c\u043b\u0438 plt.plot(x_earth, y_earth) plt.xlabel(\"X-\u043f\u043e\u0437\u0438\u0446\u0438\u044f (\u0430.\u0435.)\") plt.ylabel(\"Y-\u043f\u043e\u0437\u0438\u0446\u0438\u044f (\u0430.\u0435.)\") plt.title(\"\u041e\u0440\u0431\u0438\u0442\u0430 \u0417\u0435\u043c\u043b\u0438 \u0432\u043e\u043a\u0440\u0443\u0433 \u0421\u043e\u043b\u043d\u0446\u0430\") plt.grid(True) plt.show() <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/iz\/dw\/kd\/izdwkduax87y1otsyzwbeucpomi.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/iz\/dw\/kd\/izdwkduax87y1otsyzwbeucpomi.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0440\u0431\u0438\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u0438\u043d\u0430\u043c\u0438\u043a\u0438 \u043f\u043b\u0430\u043d\u0435\u0442 \u0432 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<h3>\u041f\u043e\u0438\u0441\u043a \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442<\/h3>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442, \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043a\u0440\u0438\u0432\u0443\u044e \u0431\u043b\u0435\u0441\u043a\u0430, \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043f\u043b\u0430\u043d\u0435\u0442\u044b \u043f\u043e \u0438\u0445 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u043d\u0430 \u044f\u0440\u043a\u043e\u0441\u0442\u044c \u0437\u0432\u0435\u0437\u0434\u044b:<\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u0418\u043c\u0438\u0442\u0430\u0446\u0438\u044f \u043a\u0440\u0438\u0432\u043e\u0439 \u0431\u043b\u0435\u0441\u043a\u0430 time = np.linspace(0, 10, 1000) flux = np.sin(time) + np.random.normal(0, 0.1, 1000)  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0440\u0438\u0432\u043e\u0439 \u0431\u043b\u0435\u0441\u043a\u0430 plt.plot(time, flux) plt.xlabel(\"\u0412\u0440\u0435\u043c\u044f\") plt.ylabel(\"\u042f\u0440\u043a\u043e\u0441\u0442\u044c\") plt.title(\"\u0418\u043c\u0438\u0442\u0430\u0446\u0438\u044f \u043a\u0440\u0438\u0432\u043e\u0439 \u0431\u043b\u0435\u0441\u043a\u0430 \u0437\u0432\u0435\u0437\u0434\u044b \u0441 \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u043e\u0439\") plt.grid(True) plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/u0\/xi\/9w\/u0xi9ws978b48k4nq5n7amjffzy.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/u0\/xi\/9w\/u0xi9ws978b48k4nq5n7amjffzy.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a Python \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043a\u0440\u0438\u0432\u044b\u0445 \u0431\u043b\u0435\u0441\u043a\u0430 \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442.<\/p>\n<h3>\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a \u0437\u0432\u0451\u0437\u0434 \u0438 \u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c<\/h3>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a \u0437\u0432\u0451\u0437\u0434 \u0438 \u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. Python \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. \u041a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0437\u0432\u0435\u0437\u0434\u044b \u0438 \u0435\u0451 \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u044b:<\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0432\u0435\u0437\u0434\u044b \u0438 \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u044b star_mass = 2e30  # \u041c\u0430\u0441\u0441\u0430 \u0437\u0432\u0435\u0437\u0434\u044b (\u043a\u0433) planet_mass = 5.972e24  # \u041c\u0430\u0441\u0441\u0430 \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u044b (\u043a\u0433) distance = 1.496e11  # \u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0437\u0432\u0435\u0437\u0434\u043e\u0439 \u0438 \u043f\u043b\u0430\u043d\u0435\u0442\u043e\u0439 (\u043c)  # \u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0440\u0431\u0438\u0442\u044b \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u044b time = np.linspace(0, 1e7, 1000) angular_velocity = np.sqrt(6.67430e-11 * star_mass \/ distance**3) theta = angular_velocity * time  x = distance * np.cos(theta) y = distance * np.sin(theta)  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0440\u0431\u0438\u0442\u044b plt.plot(x, y) plt.xlabel(\"X-\u043f\u043e\u0437\u0438\u0446\u0438\u044f (\u043c)\") plt.ylabel(\"Y-\u043f\u043e\u0437\u0438\u0446\u0438\u044f (\u043c)\") plt.title(\"\u041e\u0440\u0431\u0438\u0442\u0430 \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u0437\u0432\u0435\u0437\u0434\u044b\") plt.grid(True) plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/fv\/mg\/ia\/fvmgiaz20fwsqcbgqho7ltxbdgo.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/fv\/mg\/ia\/fvmgiaz20fwsqcbgqho7ltxbdgo.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a Python \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0437\u0432\u0451\u0437\u0434 \u0438 \u0438\u0445 \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442.<\/p>\n<h3>\u0418\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0433\u043d\u0438\u0442\u043e\u0441\u0444\u0435\u0440 \u0438 \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440 \u043f\u043b\u0430\u043d\u0435\u0442<\/h3>\n<p>  \u041c\u0430\u0433\u043d\u0438\u0442\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u0438\u0433\u0440\u0430\u044e\u0442 \u0432\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0430\u0433\u043d\u0438\u0442\u043e\u0441\u0444\u0435\u0440 \u043f\u043b\u0430\u043d\u0435\u0442 \u0438 \u0437\u0430\u0449\u0438\u0442\u0435 \u0438\u0445 \u043e\u0442 \u0432\u0440\u0435\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0437\u043b\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:  <\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u0433\u043d\u0438\u0442\u043e\u0441\u0444\u0435\u0440\u044b \u043f\u043b\u0430\u043d\u0435\u0442\u044b radius = 6400e3  # \u0420\u0430\u0434\u0438\u0443\u0441 \u043f\u043b\u0430\u043d\u0435\u0442\u044b (\u043c) B_strength = 3.0e-5  # \u0421\u0438\u043b\u043e\u0432\u0430\u044f \u0438\u043d\u0434\u0443\u043a\u0446\u0438\u044f \u043c\u0430\u0433\u043d\u0438\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f (\u0422\u0435\u0441\u043b\u0430)  # \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0442\u043a\u0438 \u0432\u043e\u043a\u0440\u0443\u0433 \u043f\u043b\u0430\u043d\u0435\u0442\u044b theta = np.linspace(0, 2 * np.pi, 100) phi = np.linspace(0, np.pi, 50) Theta, Phi = np.meshgrid(theta, phi)  # \u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438 \u043f\u043b\u0430\u043d\u0435\u0442\u044b x = radius * np.sin(Phi) * np.cos(Theta) y = radius * np.sin(Phi) * np.sin(Theta) z = radius * np.cos(Phi)  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0430\u0433\u043d\u0438\u0442\u043e\u0441\u0444\u0435\u0440\u044b plt.figure(figsize=(8, 6)) plt.contourf(x, y, z, levels=20, cmap='coolwarm') plt.colorbar(label=\"\u0421\u0438\u043b\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f (\u0422\u0435\u0441\u043b\u0430)\") plt.xlabel(\"X (\u043c)\") plt.ylabel(\"Y (\u043c)\") plt.title(\"\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u0433\u043d\u0438\u0442\u043e\u0441\u0444\u0435\u0440\u044b \u043f\u043b\u0430\u043d\u0435\u0442\u044b\") plt.grid(True) plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/iw\/be\/2j\/iwbe2jtqauqzpow4q-9l0s5bzpc.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/iw\/be\/2j\/iwbe2jtqauqzpow4q-9l0s5bzpc.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a Python \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u0430\u0433\u043d\u0438\u0442\u043e\u0441\u0444\u0435\u0440\u044b \u043f\u043b\u0430\u043d\u0435\u0442\u044b.<\/p>\n<h3>\u0410\u043d\u0430\u043b\u0438\u0437 \u043a\u043b\u0438\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439<\/h3>\n<p>  \u0410\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u044b \u043f\u043b\u0430\u043d\u0435\u0442 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043a\u043b\u0438\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u043d\u043e\u0433\u043e \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u043d\u043e\u0433\u043e \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0440\u0430\u0437\u043d\u043e\u0439 \u0432\u044b\u0441\u043e\u0442\u0435 altitude = np.linspace(0, 100000, 100)  # \u0412\u044b\u0441\u043e\u0442\u0430 (\u043c) pressure = 101.3 * np.exp(-altitude \/ 8000)  # \u041c\u043e\u0434\u0435\u043b\u044c \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u043d\u043e\u0433\u043e \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f (\u041f\u0430\u0441\u043a\u0430\u043b\u0438)  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u043d\u043e\u0433\u043e \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f plt.plot(pressure, altitude) plt.xlabel(\"\u0414\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (\u041f\u0430\u0441\u043a\u0430\u043b\u0438)\") plt.ylabel(\"\u0412\u044b\u0441\u043e\u0442\u0430 (\u043c)\") plt.title(\"\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u043d\u043e\u0433\u043e \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f\") plt.grid(True) plt.gca().invert_yaxis() plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/p0\/gm\/k2\/p0gmk2kl4yts6j4rfmv4mdqzss8.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/p0\/gm\/k2\/p0gmk2kl4yts6j4rfmv4mdqzss8.jpeg\" data-blurred=\"true\"\/><br \/>  \u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0430\u0433\u043d\u0438\u0442\u043e\u0441\u0444\u0435\u0440 \u0438 \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440 \u043f\u043b\u0430\u043d\u0435\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u0440\u043e\u0434\u0443 \u044d\u0442\u0438\u0445 \u043e\u0431\u043e\u043b\u043e\u0447\u0435\u043a \u0438 \u0438\u0445 \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u0436\u0438\u0437\u043d\u044c \u0438 \u043a\u043b\u0438\u043c\u0430\u0442 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u043d\u0435\u0442\u0430\u0445. <\/p>\n<h1>\u041e\u0431\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b<\/h1>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0435\u0449\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0441\u0432\u0435\u0449\u0430\u044e\u0442 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u043a\u0438 \u0438 \u0435\u0451 \u0432\u043a\u043b\u0430\u0434 \u0432 \u043d\u0430\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439.<\/p>\n<h3>\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python \u0438 \u0442\u0435\u043b\u0435\u0441\u043a\u043e\u043f\u043e\u0432<\/h3>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python \u0438 \u043c\u043e\u0449\u043d\u044b\u0445 \u0442\u0435\u043b\u0435\u0441\u043a\u043e\u043f\u043e\u0432 \u0443\u0447\u0435\u043d\u044b\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438 \u0442\u044b\u0441\u044f\u0447\u0438 \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0433\u043e\u043b\u043a\u0430\u0445 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0438. \u041e\u0434\u0438\u043d \u0438\u0437 \u0437\u043d\u0430\u043c\u0435\u043d\u0438\u0442\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u2014 \u043c\u0435\u0442\u043e\u0434 \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u043e\u0432, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u0430 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0437\u0432\u0435\u0437\u0434\u0443, \u0437\u0430\u0442\u043c\u0435\u0432\u0430\u044f \u0435\u0451 \u0441\u0432\u0435\u0442. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0430 \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u044b:<\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt  # \u0421\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044f \u043a\u0440\u0438\u0432\u043e\u0439 \u0431\u043b\u0435\u0441\u043a\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0430 time = np.linspace(0, 1, 1000) flux = 1 - 0.1 * np.sin(2 * np.pi * time)  # \u0418\u043c\u0438\u0442\u0430\u0446\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0430  # \u0410\u043d\u0430\u043b\u0438\u0437 \u043a\u0440\u0438\u0432\u043e\u0439 \u0431\u043b\u0435\u0441\u043a\u0430 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u044b depth = 1 - min(flux)  # \u0413\u043b\u0443\u0431\u0438\u043d\u0430 \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0430 period = time[np.argmax(flux)]  # \u041f\u0435\u0440\u0438\u043e\u0434 \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0430  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u0440\u0438\u0432\u043e\u0439 \u0431\u043b\u0435\u0441\u043a\u0430 plt.plot(time, flux) plt.xlabel(\"\u0412\u0440\u0435\u043c\u044f\") plt.ylabel(\"\u042f\u0440\u043a\u043e\u0441\u0442\u044c\") plt.title(\"\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0440\u0438\u0432\u043e\u0439 \u0431\u043b\u0435\u0441\u043a\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0430 \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442\u044b\") plt.grid(True) plt.show()  print(f\"\u0413\u043b\u0443\u0431\u0438\u043d\u0430 \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0430: {depth}\") print(f\"\u041f\u0435\u0440\u0438\u043e\u0434 \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u0430: {period}\")<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/rp\/jv\/at\/rpjvatv2ufibugqv5umgtkojjhu.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/rp\/jv\/at\/rpjvatv2ufibugqv5umgtkojjhu.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0438\u0442\u044b \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u044d\u043a\u0437\u043e\u043f\u043b\u0430\u043d\u0435\u0442.<\/p>\n<h3>\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a \u0438 \u0438\u0445 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438<\/h3>\n<p>  \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043b\u0438 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043d\u0430\u0448\u0430 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0430 \u041c\u043b\u0435\u0447\u043d\u044b\u0439 \u041f\u0443\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c. <\/p>\n<pre><code class=\"python\"># \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a import numpy as np import matplotlib.pyplot as plt  # \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0438 time = np.linspace(0, 13.8, 100)  # \u0412\u0440\u0435\u043c\u044f (\u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u044b \u043b\u0435\u0442) stellar_mass = np.exp(-time \/ 5) * 1e11  # \u041c\u0430\u0441\u0441\u0430 \u0437\u0432\u0451\u0437\u0434 (\u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044f)  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438 \u043c\u0430\u0441\u0441\u044b \u0437\u0432\u0451\u0437\u0434 \u0432 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0435 plt.plot(time, stellar_mass) plt.xlabel(\"\u0412\u0440\u0435\u043c\u044f (\u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u044b \u043b\u0435\u0442)\") plt.ylabel(\"\u041c\u0430\u0441\u0441\u0430 \u0437\u0432\u0451\u0437\u0434 (\u043a\u0433)\") plt.title(\"\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438 \u043c\u0430\u0441\u0441\u044b \u0437\u0432\u0451\u0437\u0434 \u0432 \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a\u0435\") plt.grid(True) plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/hd\/rk\/wn\/hdrkwnmir5hyc9avndb03pln0ye.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/hd\/rk\/wn\/hdrkwnmir5hyc9avndb03pln0ye.jpeg\" data-blurred=\"true\"\/>  <\/p>\n<h3>\u041f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u0430\u0442\u0430\u0441\u0442\u0440\u043e\u0444 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/h3>\n<p>  \u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u043a\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0430\u0441\u043d\u044b\u0435 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0430\u0441\u0442\u0435\u0440\u043e\u0438\u0434\u043e\u0432 \u0441 \u0417\u0435\u043c\u043b\u0435\u0439 \u0438\u043b\u0438 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u044b\u0435 \u0431\u0443\u0440\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u043d\u0430\u0448\u0438 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<pre><code class=\"python\"># \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0431\u0443\u0440\u0438 import numpy as np import matplotlib.pyplot as plt  # \u0421\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u044f \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0431\u0443\u0440\u0438 time = np.linspace(0, 24, 100)  # \u0412\u0440\u0435\u043c\u044f (\u0447\u0430\u0441\u044b) solar_activity = np.sin(2 * np.pi * time \/ 24) + np.random.normal(0, 0.1, 100)  # \u0418\u043c\u0438\u0442\u0430\u0446\u0438\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0421\u043e\u043b\u043d\u0446\u0430  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 plt.plot(time, solar_activity) plt.xlabel(\"\u0412\u0440\u0435\u043c\u044f (\u0447\u0430\u0441\u044b)\") plt.ylabel(\"\u0418\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438\") plt.title(\"\u041c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438\") plt.grid(True) plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/rl\/m2\/wm\/rlm2wmirohqn1pmvto8tanq-pt4.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/rl\/m2\/wm\/rlm2wmirohqn1pmvto8tanq-pt4.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u0443\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0433\u0440\u043e\u0437.<\/p>\n<h3>\u0420\u0430\u0434\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u043c \u043d\u0430\u0448\u0443 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443<\/h3>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0439 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python \u044d\u0442\u043e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>matplotlib<\/code> \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>numpy<\/code> \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439:<\/p>\n<pre><code class=\"python\">import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D  # \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u0440\u0431\u0438\u0442 \u043f\u043b\u0430\u043d\u0435\u0442 (\u043f\u043e\u043b\u0443\u043e\u0441\u0438, \u044d\u043a\u0441\u0446\u0435\u043d\u0442\u0440\u0438\u0441\u0438\u0442\u0435\u0442\u044b) semimajor_axes = [0.39, 0.72, 1.00, 1.52, 5.20, 9.58, 19.22, 30.05]  # \u0432 \u0430\u0441\u0442\u0440\u043e\u043d\u043e\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u0445 (1 AU = 149.6 \u043c\u043b\u043d \u043a\u043c) eccentricities = [0.206, 0.007, 0.017, 0.093, 0.049, 0.056, 0.046, 0.010]  # \u0423\u0433\u043b\u043e\u0432\u044b\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u043b\u0430\u043d\u0435\u0442 \u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u0430\u0445 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 angular_velocities = [2 * np.pi \/ 88, 2 * np.pi \/ 225, 2 * np.pi \/ 365, 2 * np.pi \/ 687, 2 * np.pi \/ 12, 2 * np.pi \/ 29.5, 2 * np.pi \/ 84, 2 * np.pi \/ 165]  # \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u0431\u043e\u0440\u043e\u0442\u0430 \u0441\u0430\u043c\u043e\u0439 \u0434\u043e\u043b\u0433\u043e\u0439 \u043e\u0440\u0431\u0438\u0442\u044b (\u043f\u043b\u0430\u043d\u0435\u0442\u044b \u041d\u0435\u043f\u0442\u0443\u043d) time = np.linspace(0, 165 * 365, 10000)  # \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0435\u0439 \u043f\u043b\u0430\u043d\u0435\u0442 planet_positions = [np.zeros((len(time), 3)) for _ in range(len(semimajor_axes))] planet_velocities = [np.zeros((len(time), 3)) for _ in range(len(semimajor_axes))]  # \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043e\u0440\u0431\u0438\u0442 \u043f\u043b\u0430\u043d\u0435\u0442 for i in range(len(semimajor_axes)):     a = semimajor_axes[i]     e = eccentricities[i]     w = angular_velocities[i]          r = a * (1 - e**2) \/ (1 + e * np.cos(w * time))          planet_positions[i][:, 0] = r * np.cos(w * time)     planet_positions[i][:, 1] = r * np.sin(w * time)          v = np.sqrt(2 \/ r - 1 \/ a)     planet_velocities[i][:, 0] = -v * np.sin(w * time)     planet_velocities[i][:, 1] = v * np.cos(w * time)  # \u0426\u0432\u0435\u0442\u0430 \u043f\u043b\u0430\u043d\u0435\u0442 (\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430) planet_colors = ['gray', 'orange', 'royalblue', 'red', 'saddlebrown', 'goldenrod', 'lightseagreen', 'blue']  # \u0420\u0430\u0437\u043c\u0435\u0440\u044b \u043f\u043b\u0430\u043d\u0435\u0442 (\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0435 \u0440\u0430\u0434\u0438\u0443\u0441\u044b) planet_radii = [0.38, 0.95, 1, 0.53, 11.21, 9.45, 4.01, 3.88]  # \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043b\u0430\u043d\u0435\u0442 planet_names = ['\u041c\u0435\u0440\u043a\u0443\u0440\u0438\u0439', '\u0412\u0435\u043d\u0435\u0440\u0430', '\u0417\u0435\u043c\u043b\u044f', '\u041c\u0430\u0440\u0441', '\u042e\u043f\u0438\u0442\u0435\u0440', '\u0421\u0430\u0442\u0443\u0440\u043d', '\u0423\u0440\u0430\u043d', '\u041d\u0435\u043f\u0442\u0443\u043d']  # \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b fig = plt.figure(figsize=(12, 12)) ax = fig.add_subplot(111, projection='3d')  for i in range(len(semimajor_axes)):     ax.plot(planet_positions[i][:, 0], planet_positions[i][:, 1], planet_positions[i][:, 2], color=planet_colors[i], label=planet_names[i], linewidth=2)     ax.scatter([planet_positions[i][0, 0]], [planet_positions[i][0, 1]], [planet_positions[i][0, 2]], color=planet_colors[i], s=planet_radii[i] * 100)     ax.text(planet_positions[i][0, 0], planet_positions[i][0, 1], planet_positions[i][0, 2], planet_names[i], fontsize=12)  ax.set_xlabel('X (AU)') ax.set_ylabel('Y (AU)') ax.set_zlabel('Z (AU)') ax.set_title('\u0421\u043e\u043b\u043d\u0435\u0447\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430') ax.legend()  plt.show()<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/na\/c5\/mr\/nac5mrukvjohj9ryhydzk7zba6o.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/na\/c5\/mr\/nac5mrukvjohj9ryhydzk7zba6o.jpeg\" data-blurred=\"true\"\/><br \/>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 3D-\u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u043f\u043b\u0430\u043d\u0435\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u0439 \u0446\u0432\u0435\u0442 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0432 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0435.<\/p>\n<h1>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  \u0410\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u043a\u0430 \u0441 Python \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u043d\u0430\u0448\u0435 \u0437\u043d\u0430\u043d\u0438\u0435 \u043e \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439, \u043d\u043e \u0438 \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0434\u043e\u0433\u0440\u0435\u043b\u0430 \u0432\u0430\u0448 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u043a \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c\u0443 \u043c\u0438\u0440\u0443 \u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u043a\u0438 \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430, \u043a\u0430\u043a Python \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0432 \u044d\u0442\u043e\u043c \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438. \u041f\u0440\u0438\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0441\u043c\u043e\u0441\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0442\u0441\u044f, \u0438 Python \u2014 \u0432\u0430\u0448 \u0432\u0435\u0440\u043d\u044b\u0439 \u0441\u043f\u0443\u0442\u043d\u0438\u043a \u0432 \u044d\u0442\u043e\u043c \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u0438.<\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043d\u043e\u0443\u0442\u0431\u0443\u043a \u0432 \u0433\u0443\u0433\u043b \u043a\u043e\u043b\u043b\u0430\u0431\u0435<a href=\"https:\/\/colab.research.google.com\/drive\/1fMPeJPWRjpscHfcQjDAy6mvh9dpBH1tR?usp=sharing\"> \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a><\/p>\n<p>  <a href=\"https:\/\/otus.pw\/yruH\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/qt\/mz\/yf\/qtmzyfwkrn1snee-zgcykifv7yq.png\" data-src=\"https:\/\/habrastorage.org\/webt\/qt\/mz\/yf\/qtmzyfwkrn1snee-zgcykifv7yq.png\"\/><\/a><\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/758526\/\"> https:\/\/habr.com\/ru\/articles\/758526\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\u0414\u0430\u0432\u043d\u044b\u043c-\u0434\u0430\u0432\u043d\u043e, \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u043b\u043e \u0432\u0437\u043e\u0440\u044b \u043a \u043d\u0435\u0431\u0435\u0441\u0430\u043c \u0438 \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u043e \u0441\u0435\u0431\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e \u043f\u0440\u0438\u0440\u043e\u0434\u0435 \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0437\u0438\u043a\u0430 \u0441\u0442\u0430\u043b\u0430 \u043a\u043b\u044e\u0447\u043e\u043c \u043a \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439. \u041c\u044b \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0447\u0435\u0440\u043d\u044b\u0435 \u0434\u044b\u0440\u044b, \u0438\u0437\u0443\u0447\u0430\u0435\u043c \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043f\u043b\u0430\u043d\u0435\u0442 \u0438 \u0437\u0432\u0451\u0437\u0434, \u0440\u0430\u0437\u0433\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0441\u0435\u043a\u0440\u0435\u0442\u044b \u0433\u0430\u043b\u0430\u043a\u0442\u0438\u043a.<\/p>\n<p>  \u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. \u0417\u0434\u0435\u0441\u044c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0412\u0441\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0430, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0432\u0451\u0437\u0434\u044b \u0438 \u043f\u043b\u0430\u043d\u0435\u0442\u044b, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0438\u0445 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/yj\/pl\/yq\/yjplyqki7ytzptyp5j4dshwgt-4.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/yj\/pl\/yq\/yjplyqki7ytzptyp5j4dshwgt-4.jpeg\" data-blurred=\"true\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-353847","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=353847"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/353847\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=353847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=353847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=353847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}