Cargando…

Component-oriented acausal modeling of the dynamical systems in Python language on the example of the model of the sucker rod string

Typically, component-oriented acausal hybrid modeling of complex dynamic systems is implemented by specialized modeling languages. A well-known example is the Modelica language. The specialized nature, complexity of implementation and learning of such languages somewhat limits their development and...

Descripción completa

Detalles Bibliográficos
Autores principales: Kopei, Volodymyr B., Onysko, Oleh R., Panchuk, Vitalii G.
Formato: Online Artículo Texto
Lenguaje:English
Publicado: PeerJ Inc. 2019
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7924524/
https://www.ncbi.nlm.nih.gov/pubmed/33816880
http://dx.doi.org/10.7717/peerj-cs.227
_version_ 1783659108084219904
author Kopei, Volodymyr B.
Onysko, Oleh R.
Panchuk, Vitalii G.
author_facet Kopei, Volodymyr B.
Onysko, Oleh R.
Panchuk, Vitalii G.
author_sort Kopei, Volodymyr B.
collection PubMed
description Typically, component-oriented acausal hybrid modeling of complex dynamic systems is implemented by specialized modeling languages. A well-known example is the Modelica language. The specialized nature, complexity of implementation and learning of such languages somewhat limits their development and wide use by developers who know only general-purpose languages. The paper suggests the principle of developing simple to understand and modify Modelica-like system based on the general-purpose programming language Python. The principle consists in: (1) Python classes are used to describe components and their systems, (2) declarative symbolic tools SymPy are used to describe components behavior by difference or differential equations, (3) the solution procedure uses a function initially created using the SymPy lambdify function and computes unknown values in the current step using known values from the previous step, (4) Python imperative constructs are used for simple events handling, (5) external solvers of differential-algebraic equations can optionally be applied via the Assimulo interface, (6) SymPy package allows to arbitrarily manipulate model equations, generate code and solve some equations symbolically. The basic set of mechanical components (1D translational “mass”, “spring-damper” and “force”) is developed. The models of a sucker rods string are developed and simulated using these components. The comparison of results of the sucker rod string simulations with practical dynamometer cards and Modelica results verify the adequacy of the models. The proposed approach simplifies the understanding of the system, its modification and improvement, adaptation for other purposes, makes it available to a much larger community, simplifies integration into third-party software.
format Online
Article
Text
id pubmed-7924524
institution National Center for Biotechnology Information
language English
publishDate 2019
publisher PeerJ Inc.
record_format MEDLINE/PubMed
spelling pubmed-79245242021-04-02 Component-oriented acausal modeling of the dynamical systems in Python language on the example of the model of the sucker rod string Kopei, Volodymyr B. Onysko, Oleh R. Panchuk, Vitalii G. PeerJ Comput Sci Algorithms and Analysis of Algorithms Typically, component-oriented acausal hybrid modeling of complex dynamic systems is implemented by specialized modeling languages. A well-known example is the Modelica language. The specialized nature, complexity of implementation and learning of such languages somewhat limits their development and wide use by developers who know only general-purpose languages. The paper suggests the principle of developing simple to understand and modify Modelica-like system based on the general-purpose programming language Python. The principle consists in: (1) Python classes are used to describe components and their systems, (2) declarative symbolic tools SymPy are used to describe components behavior by difference or differential equations, (3) the solution procedure uses a function initially created using the SymPy lambdify function and computes unknown values in the current step using known values from the previous step, (4) Python imperative constructs are used for simple events handling, (5) external solvers of differential-algebraic equations can optionally be applied via the Assimulo interface, (6) SymPy package allows to arbitrarily manipulate model equations, generate code and solve some equations symbolically. The basic set of mechanical components (1D translational “mass”, “spring-damper” and “force”) is developed. The models of a sucker rods string are developed and simulated using these components. The comparison of results of the sucker rod string simulations with practical dynamometer cards and Modelica results verify the adequacy of the models. The proposed approach simplifies the understanding of the system, its modification and improvement, adaptation for other purposes, makes it available to a much larger community, simplifies integration into third-party software. PeerJ Inc. 2019-10-28 /pmc/articles/PMC7924524/ /pubmed/33816880 http://dx.doi.org/10.7717/peerj-cs.227 Text en © 2019 Kopei et al. https://creativecommons.org/licenses/by/4.0/ This is an open access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/) , which permits unrestricted use, distribution, reproduction and adaptation in any medium and for any purpose provided that it is properly attributed. For attribution, the original author(s), title, publication source (PeerJ Computer Science) and either DOI or URL of the article must be cited.
spellingShingle Algorithms and Analysis of Algorithms
Kopei, Volodymyr B.
Onysko, Oleh R.
Panchuk, Vitalii G.
Component-oriented acausal modeling of the dynamical systems in Python language on the example of the model of the sucker rod string
title Component-oriented acausal modeling of the dynamical systems in Python language on the example of the model of the sucker rod string
title_full Component-oriented acausal modeling of the dynamical systems in Python language on the example of the model of the sucker rod string
title_fullStr Component-oriented acausal modeling of the dynamical systems in Python language on the example of the model of the sucker rod string
title_full_unstemmed Component-oriented acausal modeling of the dynamical systems in Python language on the example of the model of the sucker rod string
title_short Component-oriented acausal modeling of the dynamical systems in Python language on the example of the model of the sucker rod string
title_sort component-oriented acausal modeling of the dynamical systems in python language on the example of the model of the sucker rod string
topic Algorithms and Analysis of Algorithms
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7924524/
https://www.ncbi.nlm.nih.gov/pubmed/33816880
http://dx.doi.org/10.7717/peerj-cs.227
work_keys_str_mv AT kopeivolodymyrb componentorientedacausalmodelingofthedynamicalsystemsinpythonlanguageontheexampleofthemodelofthesuckerrodstring
AT onyskoolehr componentorientedacausalmodelingofthedynamicalsystemsinpythonlanguageontheexampleofthemodelofthesuckerrodstring
AT panchukvitaliig componentorientedacausalmodelingofthedynamicalsystemsinpythonlanguageontheexampleofthemodelofthesuckerrodstring