{"id":435,"date":"2017-01-24T23:54:50","date_gmt":"2017-01-24T20:54:50","guid":{"rendered":"https:\/\/digiratory.ru\/?p=435"},"modified":"2026-10-22T23:16:57","modified_gmt":"2026-10-22T20:16:57","slug":"postroenie-fazovyx-portretov-na-yazyke-python","status":"publish","type":"post","link":"https:\/\/digiratory.ru\/?p=435","title":{"rendered":"\u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043e\u0432 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python"},"content":{"rendered":"<p>\u0424\u0430\u0437\u043e\u0432\u0430\u044f \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u2014 \u0441\u043b\u0435\u0434 \u043e\u0442 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u0438. \u0424\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u043e\u0440\u0442\u0440\u0435\u0442 \u2014 \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u0430\u044f \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0437\u043e\u0432\u044b\u0445 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0439. \u041e\u043d\u00a0\u0445\u043e\u0440\u043e\u0448\u043e \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0435\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0442\u043e\u0447\u043a\u0438 \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u0438\u044f.<\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440\u044b (\u041c\u0435\u0442\u043e\u0434 \u0444\u0430\u0437\u043e\u0432\u043e\u0439 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438) \u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u0438 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0430 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043e\u0432 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 \u0444\u043e\u0440\u043c\u0435 \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u0445 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439<\/p>\n<p><!--more--><\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u043c\u0430\u044f\u0442\u043d\u0438\u043a\u0430 \u0441 \u0432\u044f\u0437\u043a\u0438\u043c \u0442\u0440\u0435\u043d\u0438\u0435\u043c:<\/p>\n\n<p>\u0413\u0434\u0435\u00a0$latex \\omega $ \u2014 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c,\u00a0$latex \\theta $ \u2014 \u0443\u0433\u043e\u043b \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f,\u00a0\u00a0$latex b\u00a0$ \u2014 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u0432\u044f\u0437\u043a\u043e\u0433\u043e \u0442\u0440\u0435\u043d\u0438\u044f,\u00a0$latex \u0441\u00a0$ \u2014 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442,\u00a0\u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043c\u0430\u0441\u0441\u0443, \u0434\u043b\u0438\u043d\u0443 \u0438 \u0441\u0438\u043b\u0443 \u0442\u044f\u0436\u0435\u0441\u0442\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 numpy, scipy \u0438\u00a0matplotlib \u0434\u043b\u044f \u044f\u0437\u044b\u043a\u0430 Python.<\/p>\n<p>\u0411\u043b\u043e\u043a \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre class=\"lang:python decode:true\">import numpy as np\nfrom scipy.integrate import odeint\nimport matplotlib.pyplot as plt<\/pre>\n<h1>\u0428\u0430\u0433 1. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u041e\u0414\u0423 \u0432 Python<\/h1>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0443\u044e \u0437\u0430 \u0440\u0430\u0441\u0447\u0435\u0442 \u041e\u0414\u0423. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<pre class=\"lang:python decode:true \">def ode(y, t, b, c):\n        theta, omega = y\n        dydt = [omega, -b*omega - c*np.sin(theta)]\n        return dydt<\/pre>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f:<\/p>\n<ul>\n<li>y \u2014 \u0432\u0435\u043a\u0442\u043e\u0440 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/li>\n<li>t \u2014 \u0432\u0440\u0435\u043c\u044f<\/li>\n<li>b, c \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0414\u0423 (\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e)<\/li>\n<\/ul>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0435\u043a\u0442\u043e\u0440 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u044b\u0445.<\/p>\n<h1>\u0428\u0430\u0433 2. \u0427\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u041e\u0414\u0423<\/h1>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u041e\u0414\u0423 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438:<\/p>\n<pre class=\"lang:python decode:true\">def calcODE(args, y0, dy0, ts = 10, nt = 101):\n    y0 = [y0, dy0]\n    t = np.linspace(0, ts, nt)\n    sol = odeint(ode, y0, t, args)\n    return sol<\/pre>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f:<\/p>\n<ul>\n<li>args \u2014\u00a0\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u041e\u0414\u0423 (\u0441\u043c. \u0448\u0430\u0433 1)<\/li>\n<li>y0\u2014 \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/li>\n<li>dy0 \u2014 \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (\u0438\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439)<\/li>\n<li>ts \u2014 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/li>\n<li>nt \u2014 \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0433\u043e\u0432 \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438\u00a0(= \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f * \u0448\u0430\u0433 \u0432\u0440\u0435\u043c\u0435\u043d\u0438)<\/li>\n<\/ul>\n<p>\u0412 3-\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u0442\u0441\u0447\u0435\u0442\u043e\u0432. \u0412 4-\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u041e\u0414\u0423.<\/p>\n<h1>\u0428\u0430\u0433\u00a03. \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0438 \u0432\u044b\u0432\u043e\u0434 \u0444\u0430\u0437\u043e\u0432\u043e\u0433\u043e\u00a0\u043f\u043e\u0440\u0442\u0440\u0435\u0442\u0430<\/h1>\n<p>\u0414\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0444\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u041e\u0414\u0423 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 (\u0432\u043e\u043a\u0440\u0443\u0433 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u0438). \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<pre class=\"lang:python decode:true \">def drawPhasePortrait(args, deltaX = 1, deltaDX = 1, startX = 0,  stopX = 5, startDX = 0, stopDX = 5, ts = 10, nt = 101):\n    for y0 in range(startX, stopX, deltaX):\n            for dy0 in range(startDX, stopDX, deltaDX):\n                sol = calcODE(args, y0, dy0, ts, nt)\n                plt.plot(sol[:, 1], sol[:, 0], 'b')\n    plt.xlabel('x')\n    plt.ylabel('dx\/dt')\n    plt.grid()\n    plt.show()<\/pre>\n<p>\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f:<\/p>\n<ul>\n<li>args \u2014\u00a0\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u041e\u0414\u0423 (\u0441\u043c. \u0448\u0430\u0433 1)<\/li>\n<li>deltaX \u2014 \u0428\u0430\u0433 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0441\u0438 (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f)<\/li>\n<li>deltaDX \u2014 \u0428\u0430\u0433 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0441\u0438 (\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f)<\/li>\n<li>startX \u2014 \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439<\/li>\n<li>stopX \u2014 \u041a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439<\/li>\n<li>startDX \u2014 \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439<\/li>\n<li>stopDX\u00a0\u2014 \u041a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439<\/li>\n<li>ts \u2014 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/li>\n<li>nt \u2014 \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0433\u043e\u0432 \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438\u00a0(= \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f * \u0448\u0430\u0433 \u0432\u0440\u0435\u043c\u0435\u043d\u0438)<\/li>\n<\/ul>\n<p>\u0412\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0446\u0438\u043a\u043b\u0430\u0445 (\u0441\u0442\u0440\u043e\u043a\u0438 3-4) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0431\u043e\u0440 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f. \u0412 \u0442\u0435\u043b\u0435 \u044d\u0442\u0438\u0445 \u0446\u0438\u043a\u043b\u043e\u0432 (\u0441\u0442\u0440\u043e\u043a\u0438 5-6) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u041e\u0414\u0423 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u041d\u0423 \u0438 \u0432\u044b\u0432\u043e\u0434 \u0444\u0430\u0437\u043e\u0432\u0430\u044f \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0438\u00a0\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0435\u0445\u0438\u0442\u0440\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f:<\/p>\n<ul>\n<li>\u0421\u0442\u0440\u043e\u043a\u0430 7 \u2014 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u0441\u0438 X<\/li>\n<li>\u0421\u0442\u0440\u043e\u043a\u0430 9 \u2014 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043e\u0441\u0438 Y<\/li>\n<li>\u0421\u0442\u0440\u043e\u043a\u0430 10 \u2014 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0435\u0442\u043a\u0430 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435<\/li>\n<li>\u0421\u0442\u0440\u043e\u043a\u0430 11 \u2014 \u0432\u044b\u0432\u043e\u0434 \u0433\u0440\u0430\u0444\u0438\u043a\u0430 (\u0440\u0435\u043d\u0434\u0435\u0440)<\/li>\n<\/ul>\n<h1>\u0428\u0430\u0433 4. \u0417\u0430\u043f\u0443\u0441\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f<\/h1>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre class=\"lang:python decode:true\">b = 0.25\nc = 5.0\nargs=(b, c)\ndrawPhasePortrait(args)\ndrawPhasePortrait(args, 1, 1, -10, 10, -5, 5, ts = 30, nt = 301)<\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435:<\/p>\n<p>\u0421\u0442\u0440\u043e\u043a\u0430 1-2 \u2014 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u041e\u0414\u0423<\/p>\n<p>\u0421\u0442\u0440\u043e\u043a\u0430 3 \u2014 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/p>\n<p>\u0421\u0442\u0440\u043e\u043a\u0430 4 \u2014 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0444\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 &#171;\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e&#187;<\/p>\n<p>\u0421\u0442\u0440\u043e\u043a\u0430 5 \u2014 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0444\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u0430 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438<\/p>\n<h1>\u0418\u0442\u043e\u0433<\/h1>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p><a href=\"https:\/\/digiratory.ru\/wp-content\/uploads\/435-pic1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-455 aligncenter\" src=\"https:\/\/digiratory.ru\/wp-content\/uploads\/435-pic1-300x222.png\" alt=\"\" width=\"300\" height=\"222\" \/><\/a><\/p>\n<p><a href=\"https:\/\/digiratory.ru\/wp-content\/uploads\/435-pic2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-456 aligncenter\" src=\"https:\/\/digiratory.ru\/wp-content\/uploads\/435-pic2-300x204.png\" alt=\"\" width=\"300\" height=\"204\" \/><\/a><\/p>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u043e\u0434 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 MIT (\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a):<\/p>\n<pre class=\"lang:default decode:true \"># -*- coding: utf-8 -*-\n&quot;&quot;&quot;\nThis function create a phase portrait of ode\n\nCreated on Mon Jan 23 18:51:01 2017\nCopyright 2017 Sinitsa AM site: digiratory.ru\/\n\nPermission is hereby granted, free of charge, to any person obtaining a copy \nof this software and associated documentation files (the &quot;Software&quot;), to deal \nin the Software without restriction, including without limitation the rights \nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell \ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in \nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL \nTHE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS \nIN THE SOFTWARE.\n\n\n@author: Sinitsa AM digiratory.ru\/\n&quot;&quot;&quot;\nimport numpy as np\nfrom scipy.integrate import odeint\nimport matplotlib.pyplot as plt\n\n&apos;&apos;&apos;\nIn this function you should implement your ode\nfor example:\nd*theta\/dt = omega\nd*omega\/dt = -b*omega - c*np.sin(theta)\n\n@args:\n    y - state variable\n    t - time\n    b, c - args of ode\n&apos;&apos;&apos;\ndef ode(y, t, b, c):\n        theta, omega = y\n        dydt = [omega, -b*omega - c*np.sin(theta)]\n        return dydt\n        \n\n&apos;&apos;&apos;\nCalculate ode\n\n@args:\n    args - arguments of ODE\n    y0 - The initial state of y\n    yd0 - The initial state of derivative y\n    ts - the duration of the simulation\n    nt - Number steps if simulation (=ts*deltat)\n&apos;&apos;&apos;\ndef calcODE(args, y0, dy0, ts = 10, nt = 101):\n    y0 = [y0, dy0]\n    t = np.linspace(0, ts, nt)\n    sol = odeint(ode, y0, t, args)\n    return sol\n\n&apos;&apos;&apos;\nDrawing Phase portrait of ODE in function ode()\n\n@args:\n    args - arguments of ODE\n    deltaX - step  x\n    deltaDX - step  derivative x\n    startX - start value of x\n    stopX - stop value of x\n    startDX - start value of derivative x\n    stopDX - stop value of derivative x\n    ts - the duration of the simulation\n    nt - Number steps if simulation (=ts*deltat)\n&apos;&apos;&apos;    \ndef drawPhasePortrait(args, deltaX = 1, deltaDX = 1, startX = 0,  stopX = 5, startDX = 0, stopDX = 5, ts = 10, nt = 101):\n    for y0 in range(startX, stopX, deltaX):\n            for dy0 in range(startDX, stopDX, deltaDX):\n                sol = calcODE(args, y0, dy0, ts, nt)\n                plt.plot(sol[:, 0], sol[:, 1], &apos;b&apos;)\n    plt.xlabel(&apos;x&apos;)\n    plt.ylabel(&apos;dx\/dt&apos;)\n    plt.grid()\n    plt.show()\n    \n      \nb = 0.25\nc = 5.0\nargs=(b, c)\ndrawPhasePortrait(args)\ndrawPhasePortrait(args, 1, 1, -10, 10, -5, 5, ts = 30, nt = 301)<\/pre>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043f\u043e \u0413\u041e\u0421\u0422:<\/p>\n<p>\u0421\u0438\u043d\u0438\u0446\u0430 \u0410.\u041c.: \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043e\u0432 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python [\u042d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441] \/\/ Digiratory. 2017 \u0433. URL: https:\/\/digiratory.ru\/?p=435\u00a0(\u0434\u0430\u0442\u0430 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f: \u0414\u0414.\u041c\u041c.\u0413\u0413\u0413\u0413).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0424\u0430\u0437\u043e\u0432\u0430\u044f \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u2014 \u0441\u043b\u0435\u0434 \u043e\u0442 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u0438. \u0424\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u043e\u0440\u0442\u0440\u0435\u0442 \u2014 \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u0430\u044f \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0437\u043e\u0432\u044b\u0445 \u0442\u0440\u0430\u0435\u043a\u0442\u043e\u0440\u0438\u0439. \u041e\u043d\u00a0\u0445\u043e\u0440\u043e\u0448\u043e \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0435\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0442\u043e\u0447\u043a\u0438 \u0440\u0430\u0432\u043d\u043e\u0432\u0435\u0441\u0438\u044f. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440\u044b (\u041c\u0435\u0442\u043e\u0434 \u0444\u0430\u0437\u043e\u0432\u043e\u0439 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438) \u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438 \u0438 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0430 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0444\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043e\u0432 \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":455,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[20],"class_list":["post-435","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tac","tag-scipy"],"_links":{"self":[{"href":"https:\/\/digiratory.ru\/index.php?rest_route=\/wp\/v2\/posts\/435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digiratory.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digiratory.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digiratory.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/digiratory.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=435"}],"version-history":[{"count":1,"href":"https:\/\/digiratory.ru\/index.php?rest_route=\/wp\/v2\/posts\/435\/revisions"}],"predecessor-version":[{"id":2138,"href":"https:\/\/digiratory.ru\/index.php?rest_route=\/wp\/v2\/posts\/435\/revisions\/2138"}],"wp:attachment":[{"href":"https:\/\/digiratory.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digiratory.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digiratory.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}