//--------------------------------------------------------------------------- // // Design of the UV-MRAC for the third order system of relative degree one. // The system has an uncertain parameter. Now an input disturbance is // included and the uncertain terms on the HFG matrix are nonlinear. // Copied from the file uvmrac_design_final.sci of the TAC'2001 paper. // // Developed for Scilab 2.6/2.7. // // Rio de Janeiro, December 10, 2001. // // Author: Jose' Paulo V. S. da Cunha // // Last revision: September 16, 2003. // //--------------------------------------------------------------------------- // Laplace complex variable definition: s=poly(0,"s"); // Reference model matrix: Am= [-2 0; 0 -2]; // Basic Plant right matrix fraction decomposition (G(s)=Nr(s)(Dr(s))^-1): // Nr = [(s+3), (2*s) ; (-2*s-4), (s+3)]; Nr = [(s+(3/5)), (-6/5) ; (2/5), (s+(11/5))]; Dr = [(s^2-1), 0 ; 0, (s^2-1)]; // Uniform upper bound for the norm of the input disturbance: bar_d = 5 // State filters: Lambda=[(s+1), 0 ; 0, (s+1)]; A=[(1), 0 ; 0, (1)]; // Uncertain parameter range: alpha_min = 0.3; alpha_max = 4; // alpha_nom = 0.55; alpha_nom = 1; alpha_step= 0.01; // Nominal parameter matrix: //[theta_nom,theta_null]=mrcmatch(Nr*diag([1,alpha_nom]),Dr,(s*eye(2,2)-Am),A,Lambda); [theta_nom,theta_null]=mrcmatch(Nr*[1,2*(alpha_nom^2);-2,alpha_nom],Dr,(s*eye(2,2)-Am),A,Lambda); theta_nom theta_null // Precompensation matrix: Sp = eye(2,2); // Lyapunov design matrix: Q = eye(2,2); // Desired stability margin: delta_bar = 0.1; // Design of the UV-MRAC: // [c1,c2,c3,cd,theta,Kp] = uvmrac2(Nr*diag([1,alpha_min]),Dr,Am,Lambda,A,theta_nom,Sp,Q,delta_bar); [c1,c2,c3,cd,theta,Kp] = uvmrac2(Nr*[1,2*(alpha_min^2);-2,alpha_min],Dr,Am,Lambda,A,theta_nom,Sp,Q,delta_bar); // DC gain Wd(0): A0Lambda01 = coeff(A,0) * inv(coeff(Lambda,0)); [lA0Lambda01,cA0Lambda01] = size(A0Lambda01); wdc = norm(eye(2,2) - (theta(1:lA0Lambda01,:))' * A0Lambda01); ccc = [alpha_min,c1,c2,c3,cd,wdc]; for alpha=alpha_min+alpha_step:alpha_step:alpha_max, // [c1p,c2p,c3p,cdp,theta,Kp]=uvmrac2(Nr*diag([1,alpha]),Dr,Am,Lambda,A,theta_nom,Sp,Q,delta_bar); [c1p,c2p,c3p,cdp,theta,Kp]=uvmrac2(Nr*[1,2*(alpha^2);-2,alpha],Dr,Am,Lambda,A,theta_nom,Sp,Q,delta_bar); wdcp = norm(eye(2,2) - (theta(1:lA0Lambda01,:))' * A0Lambda01); ccc=[ccc ; alpha,c1p,c2p,c3p,cdp,wdcp]; c1 = max(c1,c1p); c2 = max(c2,c2p); c3 = max(c3,c3p); cd = max(cd,cdp); wdc = max(wdc,wdcp); end // Plots alpha x c1 : disp('Type RETURN to show c1 graphics...'); pause; xbasc(); xset("default"); xset("font size",6); xset("line style",1); xset("line style",1); xset("thickness",2); plot2d(ccc(:,1),ccc(:,2),rect=[0,0,4.0,20],nax=[10,4,5,4]); xset("line style",2); xset("thickness",1); xset("mark size",0); xgrid(1); xtitle('','alpha','c1'); xset("line style",1); xset("thickness",1); // Plots alpha x c3 : disp('Type RETURN to show c3 graphics...'); pause; xbasc(); xset("default"); xset("font size",6); xset("line style",1); plot(ccc(:,1),ccc(:,4)); xtitle('','alpha','c3'); // Plots alpha x wdc : disp('Type RETURN to show DC gain graphics...'); pause; xbasc(); xset("default"); xset("font size",6); xset("line style",1); plot(ccc(:,1),ccc(:,6)); xtitle('','alpha','wdc'); // Modulation function coefficients: c1 c2 c3 cd // Maximum DC gain norm ||Wd(0)||: wdc // Desired coefficient for finite-time convergence: delta = 0.1