home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 7.ddi / ROBUST.DI$ / MUPLT.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  4.1 KB  |  149 lines

  1. %
  2. % ---------------------------------------------------------------
  3. %  MUPLT.M is a script file that produces the plots for the ACC
  4. %     Benchmark problem.
  5. % ---------------------------------------------------------------
  6. %
  7.  
  8. % R. Y. Chiang & M. G. Safonov 
  9. % Copyright (c) 1988 by the MathWorks, Inc.
  10. % All Rights Reserved.
  11.    subplot
  12.    subplot(211)
  13.    semilogx(w,[perttw1;pertt1]);
  14.    title('Ty1u1 in "s~" and "s"');
  15.    grid;xlabel('Rad/Sec'); ylabel('PERRON SSV (db)');
  16.    text(0.002,-5,['MSM in s~: +-',num2str(msmw1),' %']);
  17.    text(0.002,-10,['MSM in s : +-',num2str(msm1),' %']);
  18.  
  19.    subplot(212)
  20.    semilogx(w,[perttw;pertt]);
  21.    title('Ty1u1 in "s~" and "s"');
  22.    grid;xlabel('Rad/Sec'); ylabel('PERRON SSV (db)');
  23.    text(0.002,-5,['MSM in s~: +-',num2str(msmw),' %']);
  24.    text(0.002,-10,['MSM in s : +-',num2str(msm),' %']);
  25.    pause
  26.    ptid = input(' Do you want a hardcopy ? (1=yes,0=no)');
  27.    if ptid == 1
  28.      print
  29.    end
  30.  
  31.    subplot
  32.    subplot(221)
  33.    loglog(w,exp(diag_d))
  34.    title('Diagonal Scaling D(s)')
  35.    xlabel('Rad/Sec')
  36.    ylabel('logd')
  37.  
  38.    subplot(222)
  39.    loglog(w,exp(diag_d(1,:)),'x',w,ga1);
  40.    title('D11(s)')
  41.    xlabel('R/S (x: data; solid: fit)')
  42.    ylabel('logd')
  43.  
  44.    subplot(223)
  45.    loglog(w,exp(diag_d(2,:)),'x',w,ga2);
  46.    title('D22(s)')
  47.    xlabel('R/S (x: data; solid: fit)')  
  48.    ylabel('logd')
  49.       
  50.    subplot(224)
  51.    loglog(w,exp(diag_d(3,:)),'x',w,ga3);
  52.    title('D33(s)')
  53.    xlabel('R/S (x: data; solid: fit)')
  54.    ylabel('logd')
  55.    ptid = input(' Do you want a hardcopy ? (1=yes,0=no)');
  56.    if ptid == 1
  57.      print
  58.    end
  59.    pause
  60.  
  61.    subplot
  62.    subplot(221)
  63.    plot(t,x1_ipw1);grid;
  64.    title('x1');       xlabel('Sec')
  65.  
  66.    subplot(222)
  67.    plot(t,x2_ipw1);grid;
  68.    title('x2 (z)');   xlabel('Sec');
  69.  
  70.    subplot(223)
  71.    plot(t,u_ipw1); grid;
  72.    title('Control (u)'); xlabel('Sec');
  73.  
  74.    subplot(224)
  75.    text(0.6,0.4,'Impulse Response @ M1','sc');
  76.    text(0.6,0.35,'Sensor Noise: 0.001*sin(100t)','sc')
  77.    text(0.65,0.3,'Dashed: k = 0.5','sc');
  78.    text(0.65,0.25,'Solid:  k = 1.0','sc');
  79.    text(0.65,0.2,'Dotted: k = 2.0','sc');
  80.    pause
  81.    ptid = input(' Do you want a hardcopy ? (1=yes,0=no)');
  82.    if ptid == 1
  83.      print
  84.    end   
  85.  
  86.    subplot
  87.    subplot(221)
  88.    plot(t,x1_ipw2);grid;
  89.    title('x1');  xlabel('Sec');
  90.  
  91.    subplot(222)
  92.    plot(t,x2_ipw2);grid
  93.    title('x2 (z)');   xlabel('Sec');
  94.  
  95.    subplot(223)
  96.    plot(t,u_ipw2); grid;
  97.    title('Control (u)'); xlabel('Sec');
  98.  
  99.    subplot(224)
  100.    text(0.6,0.4,'Impulse Response @ M2','sc');
  101.    text(0.6,0.35,'Sensor Noise: 0.001*sin(100t)','sc')
  102.    text(0.65,0.3,'Dashed: k = 0.5','sc');
  103.    text(0.65,0.25,'Solid:  k = 1.0','sc');
  104.    text(0.65,0.2,'Dotted: k = 2.0','sc');
  105.    pause
  106.    ptid = input(' Do you want a hardcopy ? (1=yes,0=no)');
  107.    if ptid == 1
  108.      print
  109.    end
  110. %
  111. subplot
  112. subplot(221)
  113. semilogx(w,gf);title('Controller F(s)');
  114. xlabel('Rad/Sec'); ylabel('Gain (db)')
  115.  
  116. subplot(223)
  117. semilogx(w,pf);xlabel('Rad/Sec');ylabel('Phase (deg)')
  118.  
  119. subplot(222)
  120. semilogx(w,gl); title('Loop TF G*F'); xlabel('Rad/Sec');
  121. text(0.002,-50,['Min. GM: ',num2str(gmin),' db']);
  122. text(0.002,-150,['Max. GM: ',num2str(gmax),' db']);
  123.  
  124. subplot(224)
  125. semilogx(w,pl);
  126. xlabel('Rad/Sec (k = 0.5(- -), 1(-), 2(.))');ylabel('Phase (deg)')
  127. text(0.002,max(min(pl))+100,['Min. PM: ',num2str(pmin),' deg']);
  128. text(0.002,max(min(pl)),['Max. PM: ',num2str(pmax),' deg']);
  129. pause
  130.  
  131. ptid = input(' Do you want a hardcopy ? (1=yes,0=no)');
  132.    if ptid == 1
  133.      print
  134.    end
  135. %
  136. clc
  137. disp(' ');
  138. disp(' ');
  139. disp('  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *')
  140. disp('  *                                                         *')
  141. disp('  *      Your design is accomplished ..                     *')
  142. disp('  *              Controller: (af,bf,-cf,-df).               *')
  143. disp('  *                                                         *')
  144. disp('  *       (strike a key to go back to the main maneu)       *')
  145. disp('  *                                                         *')
  146. disp('  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *')
  147. pause
  148. %
  149. % ----------- End of MUPLT.M % RYC/MGS %