[Ece438] Re: Problem with function rlocfind

Geoffrey A. Williamson williamson@iit.edu
Thu, 11 Mar 2004 10:19:19 -0600


--=====================_506605750==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Typing "help rlocfind" yields the following.  Below this I give an example.

  RLOCFIND  Find root locus gains for a given set of roots.

     [K,POLES] = RLOCFIND(SYS)  is used for interactive gain
     selection from the root locus plot of the SISO system SYS
     generated by RLOCUS.  RLOCFIND puts up a crosshair cursor
     in the graphics window which is used to select a pole location
     on an existing root locus.  The root locus gain associated
     with this point is returned in K and all the system poles for
     this gain are returned in POLES.

     [K,POLES] = RLOCFIND(SYS,P)  takes a vector P of desired root
     locations and computes a root locus gain for each of these
     locations (i.e., a gain for which one of the closed-loop roots
     is near the desired location).  The j-th entry of the vector K
     gives the computed gain for the location P(j), and the j-th
     column of the matrix POLES lists the resulting closed-loop poles.

Example:

Consider the root locus for   1 + K (1/s) = 0.   The root locus (for K>0) 
starts at s=0, and goes left along the negative real axis to infinity.  To 
put the root at s=-a requires that K = a.   Here are some matlab commands 
(in bold, with what matlab displays also in bold), with some of my comments.

Use of rlocfind to find the value of gain K to put a closed loop pole at s=-10
 >> G  = tf(1,[1 0])

Transfer function:
1
-
s

 >> [K,poles] = rlocfind(G,-10)

K =

     10



poles =

    -10

Note that matlab finds, as we expected, that K=10.  If we want to try to 
place the pole at s = -10 + j, we type
 >> [K,poles] = rlocfind(G,-10+j)

K =

    10.0499



poles =

   -10.0499

Note that the closed loop pole doesn't come out at -10+j, because that is 
impossible.  Matlab decides that a pole location that is close, and is 
possible, is s = -10.0499, and finds that K=10.0499 achieves that location.

Often we specify the desired pole location by selecting the point off a 
plot of the root locus.  One does this in matlab by first drawing the root 
locus, then executing rlocfind without the second argument.  Here's an 
example where I selected the point -0.8 by clicking near that location on a 
plot of the root locus.
 >> rlocus(G)
 >> [K,poles] = rlocfind(G)
Select a point in the graphics window

selected_point =

   -0.8187 + 0.0714i



K =

     0.8218



poles =

    -0.8218

Notice that I tried to click on the real axis near s = -0.8, but I missed a 
little bit.  Matlab tells me where it is that I clicked, what the point on 
the locus is that is closest to where I clicked, and what gain K it takes 
to get the poles to the point that matlab chose.


At 02:56 AM 3/11/2004 -0600, you wrote:
>Hi professor, could you give an example of the use of rlocfind?
>I am not sure about the syntax of argument P in: RLOCFIND(SYS,P) is.I 
>tried to write it this way: RLOCFIND(h1,[1-j]), but I'm not sure about it...
>Thank you
>Alexandre Duvert

--
Geoffrey A. Williamson, Ph.D.
Associate Professor
Department of Electrical and Computer Engineering
Illinois Institute of Technology
3301 S. Dearborn St.
Chicago, IL  60616
voice:  +1-312-567-5960
fax:    +1-312-567-8976
email:  williamson@iit.edu

--=====================_506605750==_.ALT
Content-Type: text/html; charset="us-ascii"

<html>
Typing &quot;help rlocfind&quot; yields the following.&nbsp; Below this I
give an example.<br><br>
&nbsp;RLOCFIND&nbsp; Find root locus gains for a given set of 
roots.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp; [K,POLES] = RLOCFIND(SYS)&nbsp; is used for
interactive gain <br>
&nbsp;&nbsp;&nbsp; selection from the root locus plot of the SISO system
SYS <br>
&nbsp;&nbsp;&nbsp; generated by RLOCUS.&nbsp; RLOCFIND puts up a
crosshair cursor <br>
&nbsp;&nbsp;&nbsp; in the graphics window which is used to select a pole
location <br>
&nbsp;&nbsp;&nbsp; on an existing root locus.&nbsp; The root locus gain
associated <br>
&nbsp;&nbsp;&nbsp; with this point is returned in K and all the system
poles for <br>
&nbsp;&nbsp;&nbsp; this gain are returned in POLES.&nbsp; <br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp; [K,POLES] = RLOCFIND(SYS,P)&nbsp; takes a vector P of
desired root <br>
&nbsp;&nbsp;&nbsp; locations and computes a root locus gain for each of
these <br>
&nbsp;&nbsp;&nbsp; locations (i.e., a gain for which one of the
closed-loop roots<br>
&nbsp;&nbsp;&nbsp; is near the desired location).&nbsp; The j-th entry of
the vector K<br>
&nbsp;&nbsp;&nbsp; gives the computed gain for the location P(j), and the
j-th <br>
&nbsp;&nbsp;&nbsp; column of the matrix POLES lists the resulting
closed-loop poles.<br><br>
Example:<br><br>
Consider the root locus for&nbsp;&nbsp; 1 + K (1/s) = 0.&nbsp;&nbsp; The
root locus (for K&gt;0) starts at s=0, and goes left along the negative
real axis to infinity.&nbsp; To put the root at s=-a requires that K =
a.&nbsp;&nbsp; Here are some matlab commands (in bold, with what matlab
displays also in bold), with some of my comments.<br><br>
Use of rlocfind to find the value of gain K to put a closed loop pole at
s=-10<br>

<dl><b>
<dd>&gt;&gt; G&nbsp; = tf(1,[1 0])
<dd>&nbsp;
<dd>Transfer function:
<dd>1
<dd>-
<dd>s
<dd>&nbsp;
<dd>&gt;&gt; [K,poles] = rlocfind(G,-10)<br><br>

<dd>K =<br><br>

<dd>&nbsp;&nbsp;&nbsp; 10<br><br>
<br><br>

<dd>poles =<br><br>

<dd>&nbsp;&nbsp; -10<br><br>
</b>
</dl>Note that matlab finds, as we expected, that K=10.&nbsp; If we want
to try to place the pole at s = -10 + j, we type<br>

<dl><b>
<dd>&gt;&gt; [K,poles] = rlocfind(G,-10+j)<br><br>

<dd>K =<br><br>

<dd>&nbsp;&nbsp; 10.0499<br><br>
<br><br>

<dd>poles =<br><br>

<dd>&nbsp; -10.0499<br><br>
</b>
</dl>Note that the closed loop pole doesn't come out at -10+j, because
that is impossible.&nbsp; Matlab decides that a pole location that is
close, and is possible, is s = -10.0499, and finds that K=10.0499
achieves that location.<br><br>
Often we specify the desired pole location by selecting the point off a
plot of the root locus.&nbsp; One does this in matlab by first drawing
the root locus, then executing rlocfind without the second
argument.&nbsp; Here's an example where I selected the point -0.8 by
clicking near that location on a plot of the root locus.<br>

<dl><b>
<dd>&gt;&gt; rlocus(G)
<dd>&gt;&gt; [K,poles] = rlocfind(G)
<dd>Select a point in the graphics window<br><br>

<dd>selected_point =<br><br>

<dd>&nbsp; -0.8187 + 0.0714i<br><br>
<br><br>

<dd>K =<br><br>

<dd>&nbsp;&nbsp;&nbsp; 0.8218<br><br>
<br><br>

<dd>poles =<br><br>

<dd>&nbsp;&nbsp; -0.8218<br><br>
</b>
</dl>Notice that I tried to click on the real axis near s = -0.8, but I
missed a little bit.&nbsp; Matlab tells me where it is that I clicked,
what the point on the locus is that is closest to where I clicked, and
what gain K it takes to get the poles to the point that matlab
chose.<br><br>
<br>
At 02:56 AM 3/11/2004 -0600, you wrote:<br>
<blockquote type=cite class=cite cite>Hi professor, could you give an
example of the use of rlocfind? <br>
I am not sure about the syntax of argument P in: RLOCFIND(SYS,P) is.I
tried to write it this way: RLOCFIND(h1,[1-j]), but I'm not sure about
it...<br>
Thank you<br>
Alexandre Duvert</blockquote>
<x-sigsep><p></x-sigsep>
--<br>
Geoffrey A. Williamson, Ph.D.<br>
Associate Professor<br>
Department of Electrical and Computer Engineering<br>
Illinois Institute of Technology<br>
3301 S. Dearborn St.<br>
Chicago, IL&nbsp; 60616<br>
voice:<x-tab>&nbsp;&nbsp;</x-tab>+1-312-567-5960<br>
fax:<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>+1-312-567-8976<br>
email:<x-tab>&nbsp;&nbsp;</x-tab>williamson@iit.edu<br>
</html>

--=====================_506605750==_.ALT--