How do I call "frd" for discrete time?

조회 수: 5 (최근 30일)
Mark
Mark 2014년 11월 20일
댓글: Mark 2014년 11월 21일
Following along this example for mu analysis: Robust Performance Analysis
I have M, and blk from
[M,NDelta,blk] = lftdata(ClosedLoop);
Making a frequency vector and defining my discrete time step as:
freq=logspace(-1,2,100);
dt = 0.05;
I now want to call frd as:
M_g = frd(M,freq,dt);
but get the error: "The frequency units must be specified as one of the strings 'rad/TimeUnit', 'cycles/TimeUnit', 'rad/s', 'Hz', 'kHz', 'MHz', 'GHz', or 'rpm'."
I have no idea how to specify these units though... Help?!?

답변 (1개)

Sebastian Castro
Sebastian Castro 2014년 11월 20일
편집: Sebastian Castro 2014년 11월 20일
Hi Mark,
I think you may need to discretize the system M_g first using c2d before using the frd command.
The following commands worked for me:
M_disc = c2d(M,0.05);
M_g = frd(M_disc,freq,'rad/s');
After displaying M_g, at the very end I get the following:
Sample time: 0.05 seconds
Discrete-time frequency response.
Best,
Sebastian
  댓글 수: 1
Mark
Mark 2014년 11월 21일
Well, my system is already in discrete time with a sample time of 0.05 before I call lftdata, so the use of c2d is unnecessary. Unfortunately, calling
M_g = frd(M_disc,freq,dt)
yields the same error. I believe the third argument is required for discrete time. Calling
M_g = frd(M_disc,freq,dt,'rad/s')
also returns an invalid syntax error.

댓글을 달려면 로그인하십시오.

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by