Path: news.mathworks.com!not-for-mail
From: "Pascal Gahinet" <pascal@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Frequency Response between SS coded by Matlab and Result in Time Domain
Date: Thu, 11 Sep 2008 22:27:31 -0400
Organization: The MathWorks, Inc.
Lines: 64
Message-ID: <gack2k$76b$1@fred.mathworks.com>
References: <8687282.1221134309125.JavaMail.jakarta@nitrogen.mathforum.org>
NNTP-Posting-Host: vpn-client-122-58-ah.mathworks.com
X-Trace: fred.mathworks.com 1221186452 7371 144.212.122.58 (12 Sep 2008 02:27:32 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 12 Sep 2008 02:27:32 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
Xref: news.mathworks.com comp.soft-sys.matlab:489912



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