Fixed-time 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\{ \begin{array}{lcl} \left( {\color{magenta}{L_0}}+ |{\color{blue}C}z-y|^{{\color{magenta}{\nu_1}}-1}\mathbf{ d }_1(\ln |{\color{blue}C}z-y|) {\color{magenta}L}\right)({\color{blue}C}z-y) & \text{if} & |{\color{blue}C}z-y|\leq 1\\ \left( {\color{magenta}{L_0}}+ |{\color{blue}C}z-y|^{{\color{magenta}{\nu_2}}-1}\mathbf{ d }_2(\ln |{\color{blue}C}z-y|) {\color{magenta}L}\right)({\color{blue}C}z-y) & \text{if} & |{\color{blue}C}z-y|> 1 \end{array} \right. $
where ${\color{magenta}{\nu_1}}\!<\!0\!<\!{\color{magenta}{\nu_2}}$, $\mathbf{ d }_k(s)\!=\!e^{s(In+{\color{magenta}{\nu_k G_0}})}$, $k\!=\!1,2$ and $ {\color{magenta}{L_0}}\in \mathbb{ R }^{n\times k}, {\color{magenta}L}\in \mathbb{ R }^{n\times k}$
$\textbf{Properties}:$
- fixed-time state observation:
$\exists T_{\max}>0 : \quad : \quad z(t)=x(t), \quad \forall t\geq T_{\max}, \quad \forall x(0)\in \mathbb{ R }^n$
- the error $\epsilon=z-x$ has a locally homogeneous dynamics $\quad \Rightarrow \quad$ ISS (Input-to-State Stability) with respect to measurement noises.
    Design of Fixed-time HO    
The function ${\color{red} { \texttt{fho_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} $
- $\textbf{Output parameters}: {\color{magenta}{L_0,L}}, {\color{magenta} {G_{0}, \nu_1,\nu_2}} $
    Implementation of Fixed-time HO    
- The function ${\color{red} { \texttt{e_fho }} } $ computes $\textit{explicit}$ discretization of Fixed-time HO
- $ \textbf{Input parameters}: h, z, y, {\color{blue}{A,C, p}}, {\color{magenta}{L_0, L}}, {\color{magenta}{G_{0}}}, {\color{magenta}{\nu_{1}, \nu_{2}}} $
- $\textbf{Output parameters}: z^{new}$ - new estimation of $x$
- The function ${\color{red} { \texttt{si_fho }} } $ computes $\textit{semi-implicit}$ discretization of Fixed-time HO
- $\textbf{Input parameters}: h, z, y, {\color{blue}{A,C, p}}, {\color{magenta}{L_0, L}}, {\color{magenta}{G_{0}}}, {\color{magenta}{\nu_{1}, \nu_{2}}} $
- $ \textbf{Output parameters}: z^{new}$ - new estimation of $x$
Use ${\color{red} { \texttt{demo_fho.m}} } $ from $\texttt{HCS Toolbox}$ as a demo of HO design
${\color{red} { \texttt{demo_fho.m}} } $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Example of Fixed-Time Homogenenous Observer (HO) design %% %% System: dx/dt=A*x+B*u, y=C*x %% %% where %% x - system state vector (n x 1) %% u - control input (m x 1) %% y - measured output (k x 1) %% A - system matrix (n x n) %% B - control matrix (m x m) %% 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; m=1; k=1; %%%%%%%%%%%%%%%%% %% HO design %%%%%%%%%%% [L0, L, G0, nu1, nu2]=fho_design(A,C); % design of HPC %L0 - homogenization gain %L - observer gain %G0 - defines generators of dilations Gd1=eye(n)+nu1*G0; Gd2=eye(n)+nu2*G0; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Numerical Simulation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% t=0; Tmax=4; h=0.001; % sampling period x=[10;0]; z=[0;0]; tl=[t];xl=[x];zl=[z]; alpha=0.0;%tuning parameter beta=Inf;%tuning parameter noise=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_fho(h,z,y,A,C,0,L0,L,G0,nu1,nu2,alpha,beta);%explicit FHO z=si_fho(h,z,y,A,C,0,L0,L,G0,nu1,nu2,alpha,beta);%semi-implicit FHO t=; 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,2,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 4]); ylim(axes1,[-10 10]); 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,2,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({'FHO,k=1'}); xlim(axes2,[0 Tmax]); ylim(axes2,[-10 10]); box(axes2,'on'); hold(axes2,'off'); set(axes2,'FontSize',30,'XGrid','on','YGrid','on'); legend2 = legend(axes2,'show'); set(legend2,'Interpreter','latex');