This code refers to the artifact developed in support of the paper
Alessandro Vittorio Papadopoulos, Enrico Bini, Sanjoy Baruah, and Alan Burns, ``AdaptMC: Control Theory for Mixed-Criticality Systems'', in Proceedings of the 30th Euromicro Conference on Real-Time Systems (ECRTS 2018)
We implemented the results presented in the paper by using Matlab, using mostly basic functions, and few functions included in the Control System Toolbox. We used Wolfram Mathematica to symbolically analyze, and compute the stability region presented in Figure 2. In particular, the following are the main requirements:
-
Matlab R2016a or higher: We tested the codes on Matlab R2016a, R2016b, R2017a, but the lower is not confirmed.
-
Control System Toolbox of Matlab.
-
For Figure 2, the symbolic expressions are obtained in Matlab, but the regions have been obtained with Wolfram Mathematica. In order to reproduce such graph the following alternatives can be used:
- Wolfram Mathamatica 11 (license needed).
- Wolfram CDF player 11.3, no need of any license.
The generation of Figure 2 requires the execution of the following code, contained in the stability.m
file.
clear; clc;
% Definition of symbolic variables
syms Khh Khl Kll Klh real
syms z
% Dynamic matrix of AdaptMC
A = [zeros(2,2), eye(2);
-Khh, -Khl, 1, 0;
0, -Kll,-Klh, 1];
% Computation of the characteristic polynomial
p = charpoly(A,z);
% Extraction of the coefficient of the characteristic polynomial
c1 = coeffs(p,z);
c2 = c1(end:-1:1); % Reordering the coefficients
% Computation of the Jury chart
[J,C] = jury(c2)
The variable C
contains the coefficients "of interest", i.e., the entries of the first column with uneven row-indices. J
contains the whole Jury chart.
Theoreom The eigenvalues of the matrix
A
lie in the unit circle if and only if the coefficients inC
are greater than zero. Moreover, if non of these is zero, then the number of negative entries gives the number of roots outside the unit disc.
The jury.m
function is not part of the standard library of Matlab, or of the Control System Toolbox, but it can be found at this link.
Plugging the coefficients of C
in a symbolic manipulation tool, allow the calculation. In order to obtain Figure 2, we used Wolfram Mathematica, but a Computable Document Format is also provided.
In order to generate Figure 5, execute the function generateFigure5.m
. There is a toggle variable SAVE
, that if set to 1, saves the data generated by the script. The script makes use of the function csvwrite_with_headers
, available at this link.
In order to generate Figure 6, execute the function generateFigure6.m
. There is a toggle variable SCENARIO
that can be used to evaluate the different systems under different disturbance scenarios.
Scenario 1 generates Figure 6.
There is also a toggle variable SAVE
, that if set to 1, saves the data generated by the script.
In order to generate Figure 7, execute the function generateFigure7.m
. There is a toggle variable SCENARIO
that can be used to evaluate the different systems under different disturbance scenarios, with the same meaning as for Figure 6.
There is also a toggle variable SAVE
, that if set to 1, saves the data generated by the script.
Finally, there is a toggle variable GAIN
, that decides what is the value of the set of gains to use, as described in the paper.
GAIN=1 generates what is presented in Figure 7, with SCENARIO=4.
- Alessandro Papadopoulos (name dot surname at mdh dot se)
- Enrico Bini
- Sanjoy Baruah
- Alan Burns