Implementation of the Finite-Time Resilient Consensus Protocol.
This repository contains the code used in the paper Resilient Finite-Time Consensus: A Discontinuous Systems Perspective by James Usevitch and Dimitra Panagou from the University of Michigan Aerospace Engineering Department.
-
Clone the repo, and navigate to the repo folder in MATLAB.
-
Create a
struct
with the following fields:
n
: An integer for the number of total agents.k
: The integer parameter for the k-circulant network communication structure.type
: A string specifying the type of circulant graph for the communication structure. Set this variable askdir
for a directed k-circulant graph, orkundir
for an undirected circulant graph.
- Run the main function
FTRC
. A plot will automatically be generated.
Example code:
args.n = 15;
args.k = 11;
args.type = 'kdir';
data = FTRC(args); % This runs the main function.
Note: The function FTRC
automatically determines the maximum number of adversaries that the network can tolerate and uses this maximum number. This is the variable F
in the function FTRC
.
Another Note: Finite time consensus is difficult to simulate exactly due to the inherent limitations of Euler's method. Two possible ways to deal with this limitation are 1) Stop the simulation when the error between agents drops below a particular threshold, or 2) Adaptively decrease your time step size as the distance between agents gets smaller and smaller.