This repository implements the package JumpMarkovSystem, which contains a class for Jump Markov Linear Systems (JMLS), control-related algorithms for JLMS and a simulator class to simulate a JMLS.
The package JumpMarkovSystem is then used in a networked control application, which represents the method developed in the paper "Handling Stochastic Delays through Multi-Hypothesis Control" by Daniel Arnström and David Umsonst, which is currently under review.
This package contains the classes LinearJumpMarkovSystem and Simulator.
Furthermore, an algorithm to determine the LQR-based controller gains for an JMLS is provided as well as a method to determine an upper bound on the LinearJumpMarkovSystem object. Finally, a method to test the mean-square stability of a JMLS has been implemented as well.
├── src/ # Core library
│ └── jms.py # LinearJumpMarkovSystem class, LQR design (dlqr_jms),
│ # H-infinity norm, stability analysis, and Simulator
├── code/
│ ├── examples/
│ │ └── example_of_basic_jms_functionalities.py # Tutorial: define a JMS, compute controllers, simulate trajectories
│ └── results/ # Scripts to reproduce the paper's figures
└── pyproject.toml # Project metadata and dependencies
- Python >= 3.12
- uv (recommended) or pip
-
Clone the repository:
git clone https://github.com/EricssonResearch/networked-jmls.git cd networked-jmls -
Create a virtual environment and install dependencies:
Using uv (recommended):
uv sync
Using pip:
python -m venv .venv source .venv/bin/activate pip install -e .
numpy— linear algebra and array operationsscipy— matrix exponentials, block diagonals, M/D/1 queueing computationscvxpy— semidefinite programming for LQR and H-infinity norm computation (uses CLARABEL solver)matplotlib— plotting (heatmaps, violin plots, trajectories)control— used for baseline controller design comparisons
Run the example script to see core JMS functionality (system definition, controller design, simulation):
Using uv (recommended):
cd code/examples
uv run example_of_basic_jms_functionalities.pyUsing pip: Make sure to have the virtual environment activated before running the command below:
cd code/examples
python example_of_basic_jms_functionalities.pyThe scripts in code/results/ generate the figures from the paper. For example:
Using uv (recommended):
cd code/results
uv run generate_heatmap_of_control_cost.py
uv run generate_violin_plot_of_control_cost.pyUsing pip: Make sure to have the virtual environment activated before running the commands below:
cd code/results
python generate_heatmap_of_control_cost.py
python generate_violin_plot_of_control_cost.pyClaude Opus 4.6 was used to review and suggest improvements for the code, draft comments and README files. Everything was double-checked by the authors of the paper to make sure the changes represent the paper correctly.