HCS Toolbox for MATLAB

Home Downloads Manual About

Homogeneous Observer (HO)

$\textbf{Model of the system:}$

$\dot x={\color{blue}A}x+p, \quad y={\color{blue}C}x\quad x\in \mathbb{ R } ^n, \quad u\in \mathbb{ R } ^m, \quad {\color{blue}A}\in \mathbb{ R } ^{n\times m}, \quad {\color{blue}C}\in \mathbb{ R } ^{k\times n}$

where the pair $\{A,C\}$ is observable and $p\in \mathbb{ R } ^n$ - known exogenous input

$\textbf{Observer:}$

$ \dot z={\color{blue}A}z+p+\left( {\color{magenta}{L_0}}+ |{\color{blue}C}z-y|^{{\color{blue}{\nu}-1}}\mathbf{ d } (\ln |{\color{blue}C}z-y|) {\color{magenta}L}\right)({\color{blue}C}z-y), \quad {\color{magenta}{L_0}}\in \mathbb{ R } ^{n\times k}, \quad {\color{magenta}L}\in \mathbb{ R } ^{n\times k}$

where $\mathbf{ d } (s)=e^{s{\color{magenta}{G_{\mathbf{ d } }}}}$ is a dilation in $\mathbb{ R } ^n$ and ${\color{blue} \nu}\geq -1/ñ$, where $ñ\in \mathbb{N}$ is a minimal natural number such that $ \texttt{rank}\left[\begin{smallmatrix}C\\CA\\...\\CA^{ñ-1}\end{smallmatrix}\right]=n.$

$\textbf{Properties}:$

    Design of HO    

The function ${\color{red} { \texttt{ho_design }} } $ computes parameters ${\color{magenta}{L_0,L}}$ and $ {\color{magenta} {G_{\mathbf{ d } }}}$ of HO
  • $\textbf{Input parameters}: {\color{blue}A}, {\color{blue}C}$ and ${\color{blue}\nu}>0$

  • $\textbf{Output parameters}: {\color{magenta}{L_0,L}}$ and ${\color{magenta} {G_{\mathbf{ d } }}} $

    Implementation of HO    

  • The function ${\color{red} { \texttt{e_ho }} } $ computes $\textit{explicit}$ discretization of HO

    • $\textbf{Input parameters}: h$ (sampling period) ,$z,y$, ${\color{blue}{A,C, p}}, {\color{magenta}{L_0, L}}, {\color{magenta}{G_{\mathbf{ d } }}}, {\color{blue}{\nu}}\ $

    • $\textbf{Output parameters}: z^{new}$ - new estimation of $x$

  • The function ${\color{red} { \texttt{si_ho}} } $ computes $\textit{semi-implicit} $ discretization of HO

    • $\textbf{Input parameters}: h,z,y, {\color{blue}{A,C, p}}, {\color{magenta}{L_0, L}}, {\color{magenta}{G_{\mathbf{ d } }}}, {\color{blue}\nu} $

    • $\textbf{Output parameters}: z^{new}$ - new estimation of $x$

Use ${\color{red} { \texttt{demo_ho.m }} } $ from $\texttt{HCS Toolbox}$ as a demo of HO design

${\color{red} { \texttt{demo_ho.m}} } $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Example of Homogenenous Observer (HO) design %% %% System: dx/dt=A*x+f, y=C*x %% %% where %% x - system state vector (n x 1) %% f - measured input (n x 1) %% y - measured output (k x 1) %% A - system matrix (n x n) %% C - output matrix (k x n) %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%% %% Model of system %%%%%%%%%%%%%%%%%%% A= [0 1; -1 0]; % sysytem matrix (harmonic oscillator) C= [1 0 ]; % output matrix n=2; k=1; %%%%%%%%%%%%%%%%% %% HO design %%%%%%%%%%% rho=1; %convergence rate tuning parameter (larger rho, faster convergence) nu=-0.5; % the homogeneity degree % nu<0 - finite-time stability, % nu>0 - nearly fixed-time stability [L0 L Gd]=ho_design(A,C,nu,rho); % design of HPC %L0 - homogenization gain %L - observer gain %Gd - generators of dilation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Numerical Simulation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% t=0; Tmax=6; % time interval h=0.01; % sampling period x=[1;0]; z=[0;0]; tl=[t];xl=[x];zl=[z]; alpha=0.001;%tuning parameter beta=Inf;%tuning parameter noise=0.0; %magnitude of measurement noises disp('Run numerical simulation...'); while t<Tmax x=x+h*A*x; % explicit Euler method (system dynamics) y=C*x+2*noise*(rand(k,1)-0.5); %measurement of the system z=e_ho(h,z,y,A,C,0,L0,L,Gd,nu,alpha,beta); %explicit discretization of HO %z=si_ho(h,z,y,A,C,0,L0,L,Gd,nu,alpha,beta); %semi-implicit discretization of HO %z=e_ho(h,z,y,A,C,0,L0,L,Gd,nu,1,1);; %linear observer t=t+h; tl=[tl t]; xl=[xl x]; zl=[zl z]; end; disp('Done!'); %%norm of the error at the time instant Tmax disp(['||z(Tmax)-x(Tmax)||=',num2str(norm(x-z))]) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Plot simulation results %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% figure; axes1 = subplot(1,3,1); hold(axes1,'on'); plot1 = plot(tl,xl,'LineWidth',2,'Parent',axes1); set(plot1(1),'DisplayName','$x_1$'); set(plot1(2),'DisplayName','$x_2$'); ylabel('$x$','Interpreter','latex'); xlabel('$t$','Interpreter','latex'); title({'n=2'}); xlim(axes1,[0 Tmax]); ylim(axes1,[-2 2]); box(axes1,'on'); hold(axes1,'off'); set(axes1,'FontSize',30,'XGrid','on','YGrid','on'); legend1 = legend(axes1,'show'); set(legend1,'Interpreter','latex'); axes2 = subplot(1,3,2); hold(axes2,'on'); plot2 = plot(tl,xl-zl,'LineWidth',2); set(plot2(1),'DisplayName','$x_1-z_1$'); set(plot2(2),'DisplayName','$x_2-z_2$'); ylabel('$x-z$','Interpreter','latex'); xlabel('$t$','Interpreter','latex'); title({'HO,k=1'}); xlim(axes2,[0 Tmax]); ylim(axes2,[-2 2]); box(axes2,'on'); hold(axes2,'off'); set(axes2,'FontSize',30,'XGrid','on','YGrid','on'); legend2 = legend(axes2,'show'); set(legend2,'Interpreter','latex');