An algorithm for Recursive Least Squares (RLS) model parameters identification using MATLAB.
This project provides a MATLAB implementation of the Recursive Least Squares (RLS) algorithm for identifying system parameters. The algorithm is designed to estimate the parameters of a discrete-time transfer function model based on input and output data.
- Parameter Identification: Identify the system parameters for a given system input and output using the RLS method.
- Data Preprocessing: Preprocess data based on step changes of the manipulated variable and conduct centralization and normalization.
- Plotting: Visualize the convergence of parameters and compare the actual and estimated system outputs.
-
Clone the repository:
git clone https://github.com/MarekWadinger/RLS_identification.git
-
Navigate to the project directory:
cd RLS_identification
-
Load your data into MATLAB. The data should be in a structure with fields
t
(time),u
(input), andy
(output). -
Preprocess the data:
[u_mean, y_mean, idx] = preprocessData(data);
-
Identify the system parameters:
Ts = 0.01; idtf = recursiveLeastSquares(u_mean, y_mean, Ts, 1, 2, 'PlotConv', true);
Here is an example of how to use the provided functions:
%% Load file
load("example_fan_control.mat");
%% Make preprocessing
[u_mean, y_mean, idx] = preprocessData(data);
%% Identify system parameters of the specified order
Ts = 0.01;
idtf = recursiveLeastSquares(u_mean, y_mean, Ts, 1, 2, 'PlotConv', true);
MIT License