Frdesign.m
上传用户:eighthdate
上传日期:2014-05-24
资源大小:270k
文件大小:2k
源码类别:

其他行业

开发平台:

Matlab

  1. function [numopen, denopen, denclsd]= frdesign(num, den)
  2. % Hadi Saadat, 1998
  3. clc
  4. discr=[
  5. '                                                                          '
  6. '  The function [numopen, denopen, denclsd] = frdesign(num, den) is used   '
  7. '  for the frequency response design of a linear control system. num & den '
  8. '  are row vectors of polynomial coefficients of the uncompensated open-   '
  9. '  loop plant transfer function. The controller transfer function and the  '
  10. '  frequency domain specifications before and after compensation are found.'
  11. '  The function returns the open-loop & the closed-loop numerator and      '
  12. '  denominators of the compensated system transfer function.               '
  13. '                                                                          '
  14. '               Compensator type                    Enter                  '
  15. '               ----------------                    -----                  '
  16. '               Gain Compensation                      1                   '
  17. '               Phase-lead                             2                   '
  18. '               Phase-lag                              3                   '
  19. '               PD  Controller                         4                   '
  20. '               PI  Controller                         5                   '
  21. '               PID Controller                         6                   '
  22. '               To quit                                0                   '];
  23. disp(discr)
  24. t = input(' Enter your choice  -> ');
  25. if t ==1; [numopen,denopen, denclsd]= frqp(num, den);
  26. elseif t ==2; [numopen,denopen, denclsd]= frqlead(num, den);
  27. elseif t ==3; [numopen,denopen, denclsd]= frqlag(num, den);
  28. elseif t ==4; [numopen,denopen, denclsd]= frqpd(num, den);
  29. elseif t ==5; [numopen,denopen, denclsd]= frqpi(num, den);
  30. elseif t ==6; [numopen,denopen, denclsd]= frqpid(num, den);
  31. elseif t ==0; exit, end