home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 2.ddi / MUTOOLS2.DI$ / HIMAT_X6.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  3.0 KB  |  98 lines

  1.  echo on
  2. %
  3. %   HIMAT_EX6
  4. %
  5. %  It assumes that either HIMAT_X4 or HIMAT_X5 has been run.
  6. %
  7. %  This MATLAB script file compares time response of the 'best' 
  8. %   control law synthesized using mu-synthesis techniques and 
  9. %   a loopshape control design. From mu-analysis  and the 
  10. %   output sensitivity and input complementary sensitivity, 
  11. %   we have seen that the mu control law appears to be better.
  12. %   Let's look at their time responses in the nominal case
  13. %   with a constant level of uncertainty.
  14.   
  15.  pause    % strike any key to continue
  16.  
  17. %   We will compare the two designs, with no error or 
  18. %   uncertainty weights, for the nominal case and with an 
  19. %   uncertainty block [0.1 0;0 -0.1] 
  20. %   fedback around the input multiplicative uncertainty. 
  21.  
  22. %  The time response will be from 0 to 2 seconds with a 
  23. %  sample time of 0.01 seconds. We'll look at a unit step 
  24. %  input into the first channel.
  25.  
  26.  mkhimat;
  27.  mkklp;
  28.  himat_idn = himat_ic;
  29.  g_muidn = starp(himat_idn,k4,2,2);
  30.  g_lpidn = starp(himat_idn,klp,2,2);
  31.  g_muinS = sel(g_muidn,[3:4],[3:4]);
  32.  g_lpinS = sel(g_lpidn,[3:4],[3:4]);
  33.  
  34.  pause     % strike any key to continue
  35.  
  36.  t = 0.:.01:2.;
  37.  u = ones(t);
  38.  in = [u' 0*t' t';0 201 inf];
  39.  in = transp(in);
  40.  out_munS = trsp(g_muinS,in,2.,0.01);
  41.  out_lpnS = trsp(g_lpinS,in,2.,0.01);
  42.  clg
  43.  
  44. % plot the time histories of nominal systems
  45. %
  46. %  both controllers perform very well.
  47.   
  48.  echo off;
  49.  axis;
  50.  subplot(211), axis([0 2 -2 2]);
  51.  subplot(212), axis([0 2 -2 2]);
  52.  subplot(211), vplot('iv,d',out_lpnS)
  53.  subplot(211), title('Nominal response of loop-shape control law')
  54.  subplot(211), text(.2,.86,'Unit step input','sc');
  55.  subplot(211), grid ;
  56.  subplot(212), vplot('iv,d',out_munS)
  57.  subplot(212), title('Nominal response of mu control law')
  58.  subplot(212), grid; xlabel('Time (secs)') ;
  59.  pause
  60.  echo on;
  61.  clear out_lpnS out_munS
  62.  
  63.   pause      % strike any key to continue
  64.   clg;
  65.  
  66. % plot time histories of the perturbed system with uncertainty added
  67. %   notice that the size of the uncertainty, delta, is 0.1.
  68. %
  69. % The loop-shape controller performs poorly with a small perturbation
  70. %   in the input signal where as the mu controller exhibits little
  71. %   degradation in its performance. 
  72.  
  73.  delta = [.1 0;0 -.1];
  74.  g_muidS = starp(delta,g_muidn,2,2);
  75.  g_lpidS = starp(delta,g_lpidn,2,2);
  76.  out_mudS = trsp(g_muidS,in,2.,0.01);
  77.  out_lpdS = trsp(g_lpidS,in,2.,0.01);
  78.  
  79.  echo off;
  80.  subplot(211), axis([0 2 -4 2]);
  81.  subplot(212), axis([0 2 -4 2]);
  82.  subplot(211), vplot('iv,d',out_lpdS)
  83.  subplot(211), title('Perturbed system response with loop-shape control law')
  84.  subplot(211), text(.2,.86,'Unit step input','sc');
  85.  subplot(211), grid ;
  86.  subplot(212), vplot('iv,d',out_mudS)
  87.  subplot(212), title('Perturbed system response with mu control law')
  88.  subplot(212), grid; xlabel('Time (secs)') ;
  89.  
  90.  pause     % strike any key to continue
  91.  clear out_lpdS out_mudS a b c delta in t u ptest
  92.  echo on;
  93.  clg;
  94. %
  95. %       This concludes the HIMAT example 
  96. %
  97. % Copyright MUSYN INC 1991,  All Rights Reserved
  98.