<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE root>
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ali="http://www.niso.org/schemas/ali/1.0/" article-type="research-article" dtd-version="1.2" xml:lang="en"><front><journal-meta><journal-id journal-id-type="publisher-id">Discrete and Continuous Models and Applied Computational Science</journal-id><journal-title-group><journal-title xml:lang="en">Discrete and Continuous Models and Applied Computational Science</journal-title><trans-title-group xml:lang="ru"><trans-title>Discrete and Continuous Models and Applied Computational Science</trans-title></trans-title-group></journal-title-group><issn publication-format="print">2658-4670</issn><issn publication-format="electronic">2658-7149</issn><publisher><publisher-name xml:lang="en">Peoples' Friendship University of Russia named after Patrice Lumumba (RUDN University)</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">51923</article-id><article-id pub-id-type="doi">10.22363/2658-4670-2026-34-2-214-225</article-id><article-id pub-id-type="edn">JFJZIZ</article-id><article-categories><subj-group subj-group-type="toc-heading" xml:lang="en"><subject>Modeling and Simulation</subject></subj-group><subj-group subj-group-type="toc-heading" xml:lang="ru"><subject>Математическое моделирование</subject></subj-group><subj-group subj-group-type="article-type"><subject>Research Article</subject></subj-group></article-categories><title-group><article-title xml:lang="en">Calculation of modified Hamiltonian in Sage</article-title><trans-title-group xml:lang="ru"><trans-title>Вычисление модифицированного гамильтониана в Sage</trans-title></trans-title-group></title-group><contrib-group><contrib contrib-type="author"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0001-6541-6603</contrib-id><contrib-id contrib-id-type="scopus">6602318510</contrib-id><contrib-id contrib-id-type="researcherid">P-8123-2016</contrib-id><name-alternatives><name xml:lang="en"><surname>Malykh</surname><given-names>Mikhail D.</given-names></name><name xml:lang="ru"><surname>Малых</surname><given-names>М. Д.</given-names></name></name-alternatives><bio xml:lang="en"><p>Doctor of Physical and Mathematical Sciences, head of the department of Mathematical Modeling and Artificial Intelligence, RUDN University, research fellow of MLIT JINR (Dubna)</p></bio><email>malykh-md@rudn.ru</email><xref ref-type="aff" rid="aff1"/><xref ref-type="aff" rid="aff2"/></contrib><contrib contrib-type="author"><name-alternatives><name xml:lang="en"><surname>Konyaeva</surname><given-names>Marina A.</given-names></name><name xml:lang="ru"><surname>Коняева</surname><given-names>М. А.</given-names></name></name-alternatives><bio xml:lang="en">Student of the chair of Mathematical Modeling and Artificial Intelligence, RUDN University</bio><email>1032217044@pfur.ru</email><xref ref-type="aff" rid="aff1"/></contrib></contrib-group><aff-alternatives id="aff1"><aff><institution xml:lang="en">RUDN University</institution></aff><aff><institution xml:lang="ru">Российский университет дружбы народов</institution></aff></aff-alternatives><aff-alternatives id="aff2"><aff><institution xml:lang="en">Joint Institute for Nuclear Research</institution></aff><aff><institution xml:lang="ru">Объединённый институт ядерных исследований</institution></aff></aff-alternatives><pub-date date-type="pub" iso-8601-date="2026-08-15" publication-format="electronic"><day>15</day><month>08</month><year>2026</year></pub-date><volume>34</volume><issue>2</issue><issue-title xml:lang="en">VOL 34, NO2 (2026)</issue-title><issue-title xml:lang="ru">ТОМ 34, №2 (2026)</issue-title><fpage>214</fpage><lpage>225</lpage><history><date date-type="received" iso-8601-date="2026-08-20"><day>20</day><month>08</month><year>2026</year></date></history><permissions><copyright-statement xml:lang="en">Copyright ©; 2026, Malykh M.D., Konyaeva M.A.</copyright-statement><copyright-statement xml:lang="ru">Copyright ©; 2026, Малых М.Д., Коняева М.А.</copyright-statement><copyright-year>2026</copyright-year><copyright-holder xml:lang="en">Malykh M.D., Konyaeva M.A.</copyright-holder><copyright-holder xml:lang="ru">Малых М.Д., Коняева М.А.</copyright-holder><ali:free_to_read xmlns:ali="http://www.niso.org/schemas/ali/1.0/"/><license><ali:license_ref xmlns:ali="http://www.niso.org/schemas/ali/1.0/">https://creativecommons.org/licenses/by-nc/4.0</ali:license_ref></license></permissions><self-uri xlink:href="https://journals.rudn.ru/miph/article/view/51923">https://journals.rudn.ru/miph/article/view/51923</self-uri><abstract xml:lang="en"><p>The algebraic properties of difference approximations of Hamiltonian systems are investigated. Symplectic schemes exactly preserve linear and quadratic integrals by virtue of Cooper's theorem, but not the total mechanical energy of nonlinear systems. However, it is known that instead of energy, symplectic difference schemes preserve with a given order of approximation a quantity that goes over into the Hamiltonian as the time step tends to zero. The paper presents an algorithm for calculating such a modified Hamiltonian and its implementation in the Sage computer algebra system for a given symplectic difference scheme, the required order of energy conservation, and the Hamiltonian of the original mechanical system. The program successfully reproduces formulas previously derived manually, which confirms its consistency. Numerical experiments show that solutions obtained using symplectic schemes closely coincide with the level lines of the modified Hamiltonian, which emphasizes its role in preserving the qualitative behavior of the system during numerical integration over large time intervals</p></abstract><trans-abstract xml:lang="ru"><p>Исследуются алгебраические свойства разностных аппроксимаций гамильтоновых системах. Симплектические схемы точно сохраняют линейные и квадратичные интегралы в силу теоремы Купера, но не полную механическую энергию нелинейных систем. Однако известно, что вместо энергии симплектические разностные схемы сохраняют с заданным порядком аппроксимации величину, которая переходит в гамильтониан при стремлении шага по времени к нулю. В работе представлен алгоритм вычисления такого модифицированного гамильтониана и его реализация в системе компьютерной алгебры Sage по заданной симплектической разностной схемы, требуемому порядку сохранения энергии и гамильтониану исходной механической системы. Программа успешно воспроизводит формулы, ранее выведенные вручную, что подтверждает её состоятельность. Численные эксперименты показывают, что решения, полученные с помощью симплектических схем, близко совпадают с линиями уровня модифицированного гамильтониана, что подчеркивает его роль в сохранении качественного поведения системы при численном интегрировании на больших временных интервалах.</p></trans-abstract><kwd-group xml:lang="en"><kwd>symplectic difference schemes</kwd><kwd>Hamiltonian systems</kwd></kwd-group><kwd-group xml:lang="ru"><kwd>симплектические разностные схемы</kwd><kwd>Гамильтоновы системы</kwd></kwd-group><funding-group/></article-meta><fn-group/></front><body></body><back><ref-list><ref id="B1"><label>1.</label><mixed-citation>E. Hairer, G. Wanner, and C. Lubich, Geometric Numerical Integration. Berlin, Heidelberg: Springer, 2006.</mixed-citation></ref><ref id="B2"><label>2.</label><mixed-citation>Y. B. Suris, “The Canonicity of Mappings Generated by Runge-Kutta Type Methods when Integrating the Systems  ̈ =  ( ),” Computational Mathematics and Mathematical Physics, vol. 29, no. 2, pp. 202-211, 1989.</mixed-citation></ref><ref id="B3"><label>3.</label><mixed-citation>Y. B. Suris, “Hamiltonian Runge-Kutta Type Methods and Their Variational Interpretation,” Mat. Model., no. 2, pp. 78-87, 1990.</mixed-citation></ref><ref id="B4"><label>4.</label><mixed-citation>B. Batgerel, E. G. Nikonov, and I. V. Puzynin, “A Procedure for Constructing Simplectic Numerical Schemes for Solving of Hamiltonian Systems of Equations,” RUDN Journal. Ser. MIF., no. 1, pp. 41-58, 2016.</mixed-citation></ref><ref id="B5"><label>5.</label><mixed-citation>V. P. Gerdt, M. D. Malykh, L. A. Sevastianov, and Y. Ying, “On the properties of numerical solutions of dynamical systems obtained using the midpoint method,” Discrete and Continuous Models and Applied Computational Science, vol. 27, no. 3, pp. 242-262, 2019. DOI: 10.22363/2658-4670-2019-27-3-242-262</mixed-citation></ref><ref id="B6"><label>6.</label><mixed-citation>D. Greenspan, “Completely conservative, covariant numerical methodology,” Computers &amp; Mathematics with Applications, vol. 29, no. 4, pp. 37-43, 1995. DOI: 10.1016/0898-1221(94)00236-E</mixed-citation></ref><ref id="B7"><label>7.</label><mixed-citation>D. Greenspan, “Completely conservative, covariant numerical solution of systems of ordinary differential equations with applications,” Rendiconti del Seminario Matematico e Fisico di Milano, vol. 65, pp. 63-87, 1995. DOI: 10.1007/BF02925253</mixed-citation></ref><ref id="B8"><label>8.</label><mixed-citation>D. Greenspan, N-Body Problems and Models. World Scientific, 2004.</mixed-citation></ref><ref id="B9"><label>9.</label><mixed-citation>E. Graham, G. Jelenić, and M. A. Crisfield, “A note on the equivalence of two recent time-integration schemes for N-body problems,” Communications in Numerical Methods in Engineering, vol. 18, pp. 615-620, 2002. DOI: 10.1002/cnm.520</mixed-citation></ref><ref id="B10"><label>10.</label><mixed-citation>Y. Ying, A. Baddour, V. P. Gerdt, M. D. Malykh, and L. A. Sevastianov, “On the Quadratization of the Integrals for the Many-Body Problem,” Mathematics, vol. 9, no. 24, p. 3208, 2021. DOI: 10.3390/math9243208</mixed-citation></ref><ref id="B11"><label>11.</label><mixed-citation>L. F. Richardson and J. A. Gaunt, “The deferred approach to the limit,” Phil. Trans. A, vol. 226, pp. 299-349, 1927.</mixed-citation></ref><ref id="B12"><label>12.</label><mixed-citation>N. N. Kalitkin, Numerical methods. Moscow: Nauka, 1979, In Russian.</mixed-citation></ref><ref id="B13"><label>13.</label><mixed-citation>N. N. Kalitkin, A. B. Al’shin, E. A. Al’shina, and B. V. Rogov, Calculations on quasi-uniform grids. Moscow: Fizmatlit, 2005, In Russian.</mixed-citation></ref><ref id="B14"><label>14.</label><mixed-citation>A. A. Belov, N. N. Kalitkin, and I. P. Poshivaylo, “Geometrically adaptive grids for stiff Cauchy problems,” Doklady Mathematics, vol. 93, no. 1, pp. 112-116, 2016. DOI: 10.1134/S1064562416010129</mixed-citation></ref><ref id="B15"><label>15.</label><mixed-citation>A. A. Belov and N. N. Kalitkin, “Nonlinearity Problem in the Numerical Solution of Superstiff Cauchy Problems,” Mathematical Models and Computer Simulations, vol. 8, no. 6, pp. 638-650, 2016. DOI: 10.1134/S2070048216060065</mixed-citation></ref><ref id="B16"><label>16.</label><mixed-citation>A. A. Belov, N. N. Kalitkin, P. E. Bulatov, and E. K. Zholkovskii, “Explicit methods for integrating stiff Cauchy problems,” Doklady Mathematics, vol. 99, no. 2, pp. 230-234, 2019. DOI: 10.1134/S1064562419020273</mixed-citation></ref><ref id="B17"><label>17.</label><mixed-citation>A. Baddour and M. D. Malykh, “Richardson-Kalitkin method in abstract description,” Discrete and Continuous Models and Applied Computational Science, vol. 29, no. 3, pp. 271-284, 2021.</mixed-citation></ref><ref id="B18"><label>18.</label><mixed-citation>J. M. Sanz-Serna and M. P. Calvo, Numerical Hamiltonian Problems. London, Glasgow, New York, Tokyo, Melbourne, Madras: CHAPMAN &amp; HALL, 1994.</mixed-citation></ref><ref id="B19"><label>19.</label><mixed-citation>A. Baddour, M. M. Gambaryan, L. Gonzalez, and M. D. Malykh, “On Implementation of Numerical Methods for Solving Ordinary Differential Equations in Computer Algebra Systems,” Programming and Computer Software, vol. 5, pp. 412-422, 2023. DOI: 10.1134/S0361768823020044</mixed-citation></ref><ref id="B20"><label>20.</label><mixed-citation>M. D. Malykh, W. Shiwei, and Y. Ying, “On a set of tests for numerical methods of integrating differential equations, based on the Calogero system,” Discrete and Continuous Models and Applied Computational Science, vol. 31, no. 4, pp. 387-398, 2023.</mixed-citation></ref><ref id="B21"><label>21.</label><mixed-citation>W. A. Stein et al., Sage Mathematics Software (Version 10.5), The Sage Development Team, 2024.</mixed-citation></ref><ref id="B22"><label>22.</label><mixed-citation>M. D. Malykh, FDM: a new package for numerical solution of ordinary differential equations in Sage, RUDN, 2025.</mixed-citation></ref><ref id="B23"><label>23.</label><mixed-citation>M. N. Gevorkyan, “Specific implementations of symplectic numerical methods,” Bulletin of the Peoples Friendship University of Russia. Series: Mathematics informatics physics., no. 1, pp. 77-89, 2013.</mixed-citation></ref></ref-list></back></article>
