[Scilab-users] System Identification for First order delay and dead time

Tim Wescott tim at wescottdesign.com
Tue Sep 27 18:31:34 CEST 2016


First, you're not doing what I recommended you do.  Yet you are
addressing me for help with your solution, when I've already suggested
two.  Why?

Second, your prototype transfer function is 11th order, and you instruct
time_id to find the best fit to a second-order transfer function.  You
are surprised that get a transfer function in return that's not a good
fit.  Why?

Third, you've been told that Scilab does not have a pre-packaged way of
doing a fit to a system with pure time delay, and you've been given more
than one suggestion for how to roll your own.  You don't seem to have
taken any of these suggestions.  Why?

On Tue, 2016-09-27 at 07:30 -0700, Fukashiimo wrote:
> Dear Tim, 
> 
> Thank you for yor advise. 
> 
> However, u is the step signal, such as 50% ==>60% ==> 50%. 
> u and y are sampled with constant interval, such as one second. 
> 
> 
> 
> I made following Scilabe code, using time_id: 
> 
> // 
> z=poly(0,'z'); 
> h=(0.065/(z-0.934))*(1/z^10)//    <== 10 Sampling period dead time 
> u=zeros(1,100); 
> for i=10:1:100 
>     u(1,i)=2.0; 
> end 
> t=1:1:100; 
> rep=flts(u,tf2ss(h)); 
> plot(t,rep,t,u)//  <== We can see the step type process input with
> amplitude=2 and its process response with 10 sampling period dead
> time. 
> k=find(rep<>0,1) //here the threshold has to be improved in case of
> noisy signal 
> //H=time_id(1,"step",rep(k:$)) 
> H=time_id(2,u,rep) 
> rep=flts(u,tf2ss(H));     
> plot(t,rep,'.r')// <== We can see the process response by identified
> model. 
> H 
> 
> 
> h  = 
>   
>        0.065       
>     -----------   
>           10  11   
>   - 0.934z + z 
> 
> 
> H  = 
>   
>       0.0265880     
>     -------------   
>   - 0.9779092 + z 
> 
> 
> h is the discreate transfer function to provide operation data. 
> H is the identified transfer function obtained from the opeartion data
> using time_id. 
> 
> I have two issues. 
> 1. H is not similar to h even the data doesn't include any noise. How
> I can obtain transfer function nearly same as h? 
> 2. I would like to have continuous transfer function. How I should
> convert the discreate transfer function to continuous transfer
> function. 
> 
> 
> I am lokking for a solution for these two issues. 
> May I ask your advise again? 
> 
> 
> Thanks. 
> 
> 
> ----- 元のメッセージ ----- 
> 差出人: "Tim Wescott [via Scilab / Xcos - Mailing Lists Archives]"
> <[hidden email]> 
> 宛先: "Fukashiimo" <[hidden email]> 
> 送信済み: 2016年9月26日(月曜日) 04:07:52 
> 件名: Re: System Identification for First order delay and dead time 
> 
> Heh.  I just realized a better way to do this: 
> 
> I assume that you've sampled u and y at a constant rate, and that you 
> have captured some reasonable amount of the response.  This will be 
> perfect if u is periodic. 
> 
> If u is periodic, then for some integer number of periods, take U = 
> fft(u) and Y = fft(y).  If u isn't periodic, then take FFT's of u and
> y 
> after windowing them both with identical windows. 
> 
> Now calculate the frequencies for each bin of the above fft's. 
> 
> Define H(w) = ( K ./ (%i * tau * w + 1) ) .* exp(-%i * w * T). 
> 
> Calculate Ymodel = U .* H(w) 
> 
> Now, thanks to the magic of Parseval's Theorem, 
> norm(Y - Ymodel) is the same as, or just a constant multiplier away
> from 
> being, norm(y - ymodel) -- but you never actually have to compute 
> ymodel. 
> 
> So optimize on tau and T as described before.  You should only have
> to 
> take your FFTs once at the beginning -- the rest will be repeatedly 
> calculating H(w) for the various values of tau and T (and K, if you
> want 
> to be lazy and just toss it into optim, although it'll be much faster
> to 
> determine it using least-squares fit). 
> 
> On Sun, 2016-09-25 at 01:07 -0700, Fukashiimo wrote: 
> 
> > Thank you for your suggestion. However, I am not sure how I should 
> > formulate my Laplace domain equation. Could you please advise me
> more 
> > specifically? 
> > 
> > Thanks. 
> > 
> > 
> > 2016/09/25 午前9:33 "Tim Wescott [via Scilab / Xcos - Mailing Lists 
> > Archives]" <[hidden email]>: 
> >         I suggest that you roll your own cost function, and use 
> >         optim. 
> >         
> >         Where possible, with optim, if part of the problem is 
> >         nonlinear and part 
> >         is linear, it's good to use a plain old linear
> least-squares 
> >         fit for the 
> >         plain old linear part.  In your case, that's K.  Tau and Td 
> >         will have to 
> >         be determined by optim. 
> >         
> >         The cost function should generate a vector for ymodel with K
> = 
> >         1, then 
> >         find the best fit for K with 
> >         
> >         K = y / ymodel; 
> >         
> >         then return a cost 
> >         
> >         cost = norm(y - K * ymodel); 
> >         
> >         wrap that all up in NDCost and then optim, and away you'll 
> >         go. 
> >         
> >         On 2016-09-24 06:59, Fukashiimo wrote: 
> >         
> >         > Hello, 
> >         > 
> >         > I am looking for a Scilab software which is similar to 
> >         Matlab System ID 
> >         > tool 
> >         > box. 
> >         > 
> >         > I would like to obtain values of parameters, Tau, K and
> Td 
> >         for 
> >         > following 
> >         > first order delay + Dead time model from time series
> data. 
> >         > ymodel = (K/(Tau*s+1))*exp(-Td*s)*u 
> >         > ymodel: process output, u: process input 
> >         > SISO continuous time 
> >         > 
> >         > Object function: Min ( (y-ymodel)^2) 
> >         > 
> >         > Could you please tell me which package I should use to
> solve 
> >         this 
> >         > issue? 
> >         > 
> >         > Best Regards, 
> >         > 
> >         > 
> >         > 
> >         > -- 
> >         > View this message in context: 
> >         > 
> >
> http://mailinglists.scilab.org/System-Identification-for-First-order-delay-and-dead-time-tp4034608.html  
> >         > Sent from the Scilab users - Mailing Lists Archives
> mailing 
> >         list 
> >         > archive at Nabble.com. 
> >         > _______________________________________________ 
> >         > users mailing list 
> >         > [hidden email] 
> >         > http://lists.scilab.org/mailman/listinfo/users  
> >         _______________________________________________ 
> >         users mailing list 
> >         [hidden email] 
> >         http://lists.scilab.org/mailman/listinfo/users  
> >         
> >         
> >         
> >
> ______________________________________________________________ 
> >         If you reply to this email, your message will be added to
> the 
> >         discussion below: 
> >
> http://mailinglists.scilab.org/System-Identification-for-First-order-delay-and-dead-time-tp4034608p4034619.html   
> >         To unsubscribe from System Identification for First order 
> >         delay and dead time, click here. 
> >         NAML 
> > 
> > 
> >
> ______________________________________________________________________ 
> > View this message in context: Re: System Identification for First 
> > order delay and dead time 
> > Sent from the Scilab users - Mailing Lists Archives mailing list 
> > archive at Nabble.com. 
> > _______________________________________________ 
> > users mailing list 
> > [hidden email] 
> > http://lists.scilab.org/mailman/listinfo/users 
> -- 
> 
> Tim Wescott 
> www.wescottdesign.com 
> Control & Communications systems, circuit & software design. 
> Phone: 503.631.7815 
> Cell:  503.349.8432 
> 
> 
> _______________________________________________ 
> users mailing list 
> [hidden email] 
> http://lists.scilab.org/mailman/listinfo/users  
> 
> 
> 
> 
> 
> If you reply to this email, your message will be added to the
> discussion below:
> http://mailinglists.scilab.org/System-Identification-for-First-order-delay-and-dead-time-tp4034608p4034622.html  
> To unsubscribe from System Identification for First order delay and
> dead time, click here . 
> NAML 
> 
> 
> ______________________________________________________________________
> View this message in context: Re: System Identification for First
> order delay and dead time
> Sent from the Scilab users - Mailing Lists Archives mailing list
> archive at Nabble.com.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-- 

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432





More information about the users mailing list