Thread Subject: Frequency Response between SS coded by Matlab and Result in Time

Subject: Frequency Response between SS coded by Matlab and Result in Time

From: Pakorn

Date: 11 Sep, 2008 11:57:59

Message: 1 of 3

Hi All,

I try to validate the frequency response of my state-space model with the result from time domain simulation. Let me tell you what I have done:

1. My state-space model (named ss_Mo) is coded by Matlab and it is MIMO (4 inputs, 4 outputs). To get the frequency response I use command >>bode(ss_Mo). Then I will get the 32 graphs (16 for gain in decibel, 16 for phase). Each input provides 4-gain and 4-phase curves.

Q1.If I want to choose only one gain and one phase, how can I use command to select only the interesting curves and replot them? Gain should be in decibel and the range of frequency 10^0 to 10^3.
           ...................................

2. The other model is done by time-domain simulator. I select the result of input and output signal to plot the frequency response by using command

>>data=iddata(Output,Input,Ts);
>>Idloop=spafdr(data);
>>bode(Idloop)

Q2.The gain of this plot is not in decibel unit. How can I change to decible unit? It seems like I have to select the gain and the phase and replot again.
              ...................................

3. The last step, I want to comapare the results of item1 and item2 in the same gain and phase curve to check the accuracy of my model in item1. Which command should I use?

Please help me for this, I have tried to solve for 2 weeks but still cannot get the result.
I would like to say thank you very much in advance for your help.

Regards
Pakorn

Subject: Frequency Response between SS coded by Matlab and Result in Time Domain

From: Pascal Gahinet

Date: 12 Sep, 2008 02:27:31

Message: 2 of 3

Hi Pakorn

Q1: To plot the response of a particular I/O transfer, say, from input 1 to
output 2, use

bode(ss_Mo(2,1))

Q2: Not sure how to change it on this particular plot, but you can always do

bode(frd(Idloop)) % convert to FRD to use the BODE command in Control
System Toolbox

Q3: Try

bode(ss_Mo(2,1),frd(Idloop))

or with custom colors:

bode(ss_Mo(2,1),'b',frd(Idloop),'r--')

HTH
- pascal

"Pakorn" <pakorn.thepparat@siemens.com> wrote in message
news:8687282.1221134309125.JavaMail.jakarta@nitrogen.mathforum.org...
> Hi All,
>
> I try to validate the frequency response of my state-space model with the
> result from time domain simulation. Let me tell you what I have done:
>
> 1. My state-space model (named ss_Mo) is coded by Matlab and it is MIMO (4
> inputs, 4 outputs). To get the frequency response I use command
> >>bode(ss_Mo). Then I will get the 32 graphs (16 for gain in decibel, 16
> for phase). Each input provides 4-gain and 4-phase curves.
>
> Q1.If I want to choose only one gain and one phase, how can I use command
> to select only the interesting curves and replot them? Gain should be in
> decibel and the range of frequency 10^0 to 10^3.
> ...................................
>
> 2. The other model is done by time-domain simulator. I select the result
> of input and output signal to plot the frequency response by using command
>
>>>data=iddata(Output,Input,Ts);
>>>Idloop=spafdr(data);
>>>bode(Idloop)
>
> Q2.The gain of this plot is not in decibel unit. How can I change to
> decible unit? It seems like I have to select the gain and the phase and
> replot again.
> ...................................
>
> 3. The last step, I want to comapare the results of item1 and item2 in the
> same gain and phase curve to check the accuracy of my model in item1.
> Which command should I use?
>
> Please help me for this, I have tried to solve for 2 weeks but still
> cannot get the result.
> I would like to say thank you very much in advance for your help.
>
> Regards
> Pakorn


Subject: Frequency Response between SS coded by Matlab and Result in

From: Pakorn

Date: 12 Sep, 2008 14:15:03

Message: 3 of 3

Your answer are very helpful. Thank you very much, Pascal.

Hive a nice weekend.

Pakorn

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com