%% Simulation main file % % The simulation parameters 'rho' and 'observer' must be already defined in the workspace % % Manfredi Maggiore, 7/8/99 %function []=simul() % Parameters initialization l1=6;l2=12;l3=8; A=[0 1 0 ;0 0 1;0 0 0]; C=[1 0 0]; S=sqrtm(lyap(A-[l1 l2 l3]'*C,eye(3))); E1=diag(rho.^(-2:1:0)); SE1=S*E1; invSE1=inv(SE1); constants; % defines all the necessary constants related to the sf controller. %%%%%%%%%%%%%%%%%%%%%%%%%% %observer=1; % this flag determines whether the observer is used or not X0=[.05 -.05 -.1 0 0 0 0 0]; %disp(['Initial condition: ',num2str(X0(1:3))]); %%%%%%%%%%%%%%%%%%%%%%%%%% options=odeset('AbsTol',1e-6,'RelTol',1e-6); [t,x]=ode15s('fun',[0 10],X0(1:5+observer*3),options,rho,invSE1,l1,l2,l3,observer); disp 'Simulation done ....'