Python and MATLAB for Control Systems Simulation: A Side-by-Side Tutorial
Abstract
This note presents a novel side-by-side tutorial on basic control systems simulation, analysis, and design using MATLAB and Python. While open-source software has advanced rapidly in areas such as artificial intelligence and machine learning, the adoption of Python for control system design has remained comparatively limited. This is despite the long-standing contributions of the control community to MATLAB toolboxes and workflows. Over the past decade, the emergence of the Python Control Systems Library [1,2] has provided a mature and capable alternative for control applications, warranting broader consideration. Many control engineers and students, accustomed to the intuitive simulation environment of MATLAB, may find the transition to Python challenging due to differences in syntax, libraries, and development practices. Although several resources exist, the learning process can often be fragmented and overwhelming. This tutorial addresses this gap by offering a structured, practical, and directly comparable presentation of MATLAB and Python implementations. The material covers various topics, from basic vector and matrix operations, transfer-function and state-space modelling, and classical control design, to selected topics in nonlinear and discrete-time systems, as well as data visualisation for technical reporting and research dissemination, presented in a practical format suitable for students and novice researchers. The document has been used in teaching contexts for students with basic backgrounds in control theory and programming, and has demonstrated effective learning impact through worked examples. It aims to serve as a practical reference for engineers and researchers seeking to implement control algorithms efficiently in both environments. While MATLAB remains a well-established and widely accepted tool with a proven track record in control engineering, this work aims to further facilitate the adoption of open-source Python tools. This is particularly valuable in environments where access to commercial software is limited and can help accelerate the dissemination of control methodologies within research and engineering communities that primarily operate in Python-based ecosystems.
Fields of Study & Subjects
Computational Physics and Python Applications
Modeling and Simulation Systems
Advanced Control Systems Design
Publication details
- Journal / source
- Zenodo (CERN European Organization for Nuclear Research)
- Publication date
- 9 February 2026