Search   Memberlist   Usergroups
 Page 1 of 1 [8 Posts]
Author Message
Peter Nachtwey

Joined: 06 Nov 2005
Posts: 68

Posted: Thu Jul 13, 2006 8:21 pm    Post subject: Re: Fit a transfer function to gain and phase data

Jan C. Hoffmann wrote:
 Quote: "Peter Nachtwey" schrieb im Newsbeitrag news:3oOdnfDxmcYJ0yvZnZ2dnUVZ_ridnZ2d@comcast.com... "Jan C. Hoffmann" wrote in message news:44b61da6\$0\$26257\$9b4e6d93@newsread2.arcor-online.net... | How do you find the coefficients C and D of the system to be controlled? | | e.g. (C2*s^2+C1*s+C0)*(D2*s^2+D1*s+D0) I have know idea what | e.g. (C2*s^2+C1*s+C0)*(D2*s^2+D1*s+D0) is supposed to be. I don't know what you are asking for. Gid is the resulting transfer function -->Gid Gid = 2 2.8143084 + 0.1316710s + 1.9930258s --------------------------------------------------- 2 3 4 0.7009256 + 1.1251421s + 1.8071075s + 1.2745791s + s Sorry for being unprecise in asking. Let's assume you have an existing system in a power plant. You apply a step function to get information about the system to be controlled. What is the approach to find the coeffients Ci of e.g. C3*s^3+C2*s^2+C1*s+C0=0, if degree 3 is (for some reason) applicable? First, C3*s^3+C2*s^2+C1*s+C0=0 is not a transfer function with poles.

See http://www.controlguru.com how to find a simple FOPDT transfer
function.

For more sophisticated systems I use the CO and PV, not the gain and
phase. I then start with a simple model. I find the coefficients for
that model using a minimization program like what can be found in
Mathcad ( Minerr ) or Scilab ( lsqrsolve) . I then try a different
model. After I have tried all probable models I choose the one with
the best fit. This choice must be tempered by a sanity check. I get
much better results than the gain and phase with frfit above.

Note the gain can and probably will be non-linear. It is possible to
compute Gp(PV) using these non-linear minimization techniques.

lsqrsolve.
Get Modeling and Simulation in Scilab/Scicos
http://www.amazon.com/gp/product/0387278028/104-7658175-3679138?v=glance&n=283155
Jan C. Hoffmann
science forum beginner

Joined: 13 Jul 2006
Posts: 2

Posted: Thu Jul 13, 2006 6:12 pm    Post subject: Re: Fit a transfer function to gain and phase data

"Peter Nachtwey" <pnachtwey@comcast.net> schrieb im Newsbeitrag
news:3oOdnfDxmcYJ0yvZnZ2dnUVZ_ridnZ2d@comcast.com...
 Quote: "Jan C. Hoffmann" wrote in message news:44b61da6\$0\$26257\$9b4e6d93@newsread2.arcor-online.net... | How do you find the coefficients C and D of the system to be controlled? | | e.g. (C2*s^2+C1*s+C0)*(D2*s^2+D1*s+D0) I have know idea what | e.g. (C2*s^2+C1*s+C0)*(D2*s^2+D1*s+D0) is supposed to be. I don't know what you are asking for. Gid is the resulting transfer function -->Gid Gid = 2 2.8143084 + 0.1316710s + 1.9930258s --------------------------------------------------- 2 3 4 0.7009256 + 1.1251421s + 1.8071075s + 1.2745791s + s

Sorry for being unprecise in asking.

Let's assume you have an existing system in a power plant. You apply a step
function to get information about the system to be controlled.

What is the approach to find the coeffients Ci of e.g.
C3*s^3+C2*s^2+C1*s+C0=0, if degree 3 is (for some reason) applicable?

--
Regards / Gruss Jan C. Hoffmann
Peter Nachtwey

Joined: 06 Nov 2005
Posts: 68

 Posted: Thu Jul 13, 2006 1:45 pm    Post subject: Re: Fit a transfer function to gain and phase data "Jan C. Hoffmann" wrote in message news:44b61da6\$0\$26257\$9b4e6d93@newsread2.arcor-online.net... | How do you find the coefficients C and D of the system to be controlled? | | e.g. (C2*s^2+C1*s+C0)*(D2*s^2+D1*s+D0) I have know idea what | e.g. (C2*s^2+C1*s+C0)*(D2*s^2+D1*s+D0) is supposed to be. I don't know what you are asking for. Gid is the resulting transfer function -->Gid Gid = 2 2.8143084 + 0.1316710s + 1.9930258s --------------------------------------------------- 2 3 4 0.7009256 + 1.1251421s + 1.8071075s + 1.2745791s + s Peter Nachwey
Jan C. Hoffmann
science forum beginner

Joined: 13 Jul 2006
Posts: 2

Posted: Thu Jul 13, 2006 10:16 am    Post subject: Re: Fit a transfer function to gain and phase data

"Peter Nachtwey" <peter@deltacompsys.com> schrieb im Newsbeitrag
 Quote: The example program for Scilab's frfit function would be a good place to start. w=0.01:0.01:2;s=poly(0,'s'); G=syslin('c',2*(s^2+0.1*s+2), (s^2+s+1)*(s^2+0.3*s+1)); fresp=repfreq(G,w); Gid=frfit(w,fresp,4); frespfit=repfreq(Gid,w); bode(w,[fresp;frespfit])

How do you find the coefficients C and D of the system to be controlled?

e.g. (C2*s^2+C1*s+C0)*(D2*s^2+D1*s+D0)

--
Regards / Gruss Jan C. Hoffmann
Peter Nachtwey

Joined: 06 Nov 2005
Posts: 68

Posted: Mon Jul 10, 2006 10:22 pm    Post subject: Re: Fit a transfer function to gain and phase data

The example program for Scilab's frfit function would be a good place
to start.

w=0.01:0.01:2;s=poly(0,'s');
G=syslin('c',2*(s^2+0.1*s+2), (s^2+s+1)*(s^2+0.3*s+1));
fresp=repfreq(G,w);
Gid=frfit(w,fresp,4);
frespfit=repfreq(Gid,w);
bode(w,[fresp;frespfit])

The above was copied out of the Scilab documentation. It generates the
data which is in a complex form. The OP would have to convert the
magnitude and phase to complex numbers but then the rest looks so easy.
The Gid is the identified tranfer function.
The last two lines just print out the source transfer function and the
resulting 'ID' for comparison.

Peter Nachtwey
Fred Stevens
science forum beginner

Joined: 29 Apr 2005
Posts: 32

Posted: Mon Jul 10, 2006 5:34 pm    Post subject: Re: Fit a transfer function to gain and phase data

Tim Wescott wrote:
 Quote: Roza.Mahmoodian@gmail.com wrote: I have the gain and phase data for which I want to find a transfer function. None of the results that I get using "invfreqs" really matches the actual bode plot of the data. Any ideas? I also get the warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 4.362258e-030. Thanks! If you're using MatLab it's a good idea to say so. I _assume_ that's where the 'invfreqs' comes from. The warning sounds like what you'd get if you've asked for too high an order of transfer function -- there's probably a linear matrix problem embedded in there that needs sufficient data to get a good answer. Having said all that -- I'm not a big advocate of extracting a transfer function from measured data, particularly gain and phase data. The sensible thing to to with extracted transfer functions is to do some sort of pole-placement design -- and this is is really only useful and safe if you're being ultra conservative or if you already have solid domain knowledge. Unless you're going to use some robust design technique with your extracted transfer function, and that technique requires things in polynomial form, I would suggest that you just use the measured data directly to do your design the old fashioned way using Bode and Nyquist plots. Assuming your measurements are good this leaves little to chance, and gives you a good probability of getting a safe effective controller tuning, or at least an understanding of why you _can't_ get a good safe effective controller tuning. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html

Don't forget that there are actually two functions; invfreqs for
continuous time data and invfreqz for discrete time data. Make sure you
are using the correct one. Also, make sure that you have points over a
wide enough frequency range. Check that you have the correct relative
degree of the transfer function or the algorithm will complain in the
way you describe.

fred.
Tim Wescott
science forum Guru Wannabe

Joined: 03 May 2005
Posts: 292

Posted: Sun Jul 09, 2006 8:24 pm    Post subject: Re: Fit a transfer function to gain and phase data

 Quote: I have the gain and phase data for which I want to find a transfer function. None of the results that I get using "invfreqs" really matches the actual bode plot of the data. Any ideas? I also get the warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 4.362258e-030. Thanks! If you're using MatLab it's a good idea to say so. I _assume_ that's

where the 'invfreqs' comes from.

The warning sounds like what you'd get if you've asked for too high an
order of transfer function -- there's probably a linear matrix problem
embedded in there that needs sufficient data to get a good answer.

Having said all that -- I'm not a big advocate of extracting a transfer
function from measured data, particularly gain and phase data. The
sensible thing to to with extracted transfer functions is to do some
sort of pole-placement design -- and this is is really only useful and
safe if you're being ultra conservative or if you already have solid
domain knowledge.

Unless you're going to use some robust design technique with your
extracted transfer function, and that technique requires things in
polynomial form, I would suggest that you just use the measured data
directly to do your design the old fashioned way using Bode and Nyquist
plots. Assuming your measurements are good this leaves little to
chance, and gives you a good probability of getting a safe effective
controller tuning, or at least an understanding of why you _can't_ get a
good safe effective controller tuning.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
Roza.Mahmoodian@gmail.com
science forum beginner

Joined: 07 Jul 2006
Posts: 1

 Posted: Fri Jul 07, 2006 5:05 pm    Post subject: Fit a transfer function to gain and phase data I have the gain and phase data for which I want to find a transfer function. None of the results that I get using "invfreqs" really matches the actual bode plot of the data. Any ideas? I also get the warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 4.362258e-030. Thanks!

 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 Page 1 of 1 [8 Posts]
 The time now is Fri Feb 22, 2019 2:51 am | All times are GMT
 Jump to: Select a forum-------------------Forum index|___Science and Technology    |___Math    |   |___Research    |   |___num-analysis    |   |___Symbolic    |   |___Combinatorics    |   |___Probability    |   |   |___Prediction    |   |       |   |___Undergraduate    |   |___Recreational    |       |___Physics    |   |___Research    |   |___New Theories    |   |___Acoustics    |   |___Electromagnetics    |   |___Strings    |   |___Particle    |   |___Fusion    |   |___Relativity    |       |___Chem    |   |___Analytical    |   |___Electrochem    |   |   |___Battery    |   |       |   |___Coatings    |       |___Engineering        |___Control        |___Mechanics        |___Chemical

 Topic Author Forum Replies Last Post Similar Topics Generating function for Mathieu functions cosmicstring@gmail.com Math 1 Fri Jul 21, 2006 8:39 am Choice function over finite sets Peter Webb Math 5 Fri Jul 21, 2006 3:28 am Function from Taylor series? Nathan Urban Research 1 Thu Jul 20, 2006 12:48 am Function not in L_1 {[0,1]}, but satisfies ...? atkrunner@hotmail.com Math 12 Thu Jul 20, 2006 12:46 am modelling method for categorical data Arby Math 1 Wed Jul 19, 2006 12:09 pm