Related Experiment Video
Updated: Nov 10, 2025

Subject-specific Musculoskeletal Model for Studying Bone Strain During Dynamic Motion
Published on: April 11, 2018
Component-oriented acausal modeling of the dynamical systems in Python language on the example of the model of the
Volodymyr B Kopei1, Oleh R Onysko1, Vitalii G Panchuk1
1Department of Computerized Mechanical Engineering, Ivano-Frankivsk National Technical University of Oil and Gas, Ivano-Frankivsk, Ukraine.
Abstract:
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.
Related Concept Videos
Linear Approximation in Time Domain
For a simple pendulum with a mass evenly distributed along its length and the center of mass located at half the pendulum's length,...
Simplification of a Force and Couple System I
Simplification of a Force and Couple System: II
Mechanistic Models: Overview of Compartment Models
Simplified Synchronous Machine Model
In this model, each generator is connected to a...
Kinematic Equations: Problem Solving

