Professional Documents
Culture Documents
Adaptive Research Assign
Adaptive Research Assign
Submitted to:
Dr. Muhammad Rehan
Submitted by:
Raheel Aslam
Muhammad Hayyan Mehmood
Subject:
Adaptive Control
Class:
MSSE (2021-2023)
Main Code:
clc
clear all
close all
% options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4 1e-5]);
[T,x] = ode45(@simple_ode,[0 2.5],[1 -1 1 5 1 -1 0 0 0.5]);
%Time [0 15] for simple case and [0 200] for time-varying parameters.
subplot(3,1,1);
plot(T,x(:,3))
hold on
plot(T,x(:,7),'-.')
xlabel('time')
title('Actual and Estimated values of the state variables and system parameter')
ylabel('State x3')
legend('Actual Value','Adaptive State Observer')
subplot(3,1,2);
plot(T,x(:,4))
hold on
plot(T,x(:,8),'-.')
xlabel('time')
ylabel('State x4')
legend('Actual Value','Adaptive State Observer','Location','southeast')
subplot(3,1,3);
plot(t,m)
hold on
plot(T,x(:,9),'-.')
xlabel('time')
ylabel('Parameter m')
legend('Actual value','Adaptive Law')