From news@unixg.ubc.ca  Sun Mar 15 13:55:47 1992
Received: from rodan.UU.NET by seq.uncwil.edu (5.61/1.35.cgs)
	id AA14040; Sun, 15 Mar 92 13:55:47 -0500
Received: from relay2.UU.NET by rodan.UU.NET with SMTP 
	(5.61/UUNET-mail-drop) id AA00972; Sun, 15 Mar 92 13:55:30 -0500
Received: from iskut.ucs.ubc.ca by relay2.UU.NET with SMTP 
	(5.61/UUNET-internet-primary) id AA02836; Sun, 15 Mar 92 13:55:19 -0500
Received: by iskut.ucs.ubc.ca (5.64+ida SGI beta/1.14)
	id AA15815; Sun, 15 Mar 92 18:55:15 GMT
Newsgroups: comp.sys.hp48,comp.sources.hp48
Path: stat656
From: stat656@unixg.ubc.ca (John Paul Morrison)
Subject: Re: WANTED: Root Locus Plotter
Message-Id: <1992Mar15.185512.15776@unixg.ubc.ca>
Sender: news@unixg.ubc.ca (Usenet News Maintenance)
Nntp-Posting-Host: chilko.ucs.ubc.ca
Organization: University of British Columbia, Vancouver, B.C., Canada
References: <1992Mar14.024137.2098@gn.ecn.purdue.edu>
Date: Sun, 15 Mar 1992 18:55:12 GMT
Apparently-To: comp-sources-hp48@uunet.uu.net
Status: OR

In article <1992Mar14.024137.2098@gn.ecn.purdue.edu> jess@gn.ecn.purdue.edu (Jess M Holle) writes:
>Does anyone know of a root locus plotter for the 48sx?
>
>Jess Holle

Root locus is pretty simple if you have Bill Wickes' PROOT progam,
which takes a vector of coefficients and solves the roots of the polynomial.

Here's my quick and dirty Root Locus plotter. To use it, you must find
a copy of PROOT (ftp from seq.uncwil.edu, in /hp48/math ). 


RTLOC

\<< { # 0h # 0h } PVIEW C SZE EVAL \-> a b \Ge n
  \<< a b
    FOR k k 'K' STO C KC k * + PROOT OBJ\-> DROP 2 n
      START PIXON
      NEXT \Ge
    STEP GRAPH
  \>>
\>>

CST @ this is  a custom menu you might find useful too

{ ERASE XRNG YRNG RTLOC C KC PROOT }


How to use:

example: you have a polynomial s^2 + (K+2)s + K

seperate the constant terms and the K terms into

s^2 + 2s + 0 and K(0s^2 + s + 1) which gives you the coefficient vectors:

C = [1 2 0] and KC = [0 1 1] (C and KC must be real, and the same dimension!)

store these vectors into 'C' and 'KC'

now put the range of K and epsilon on the stack and press RTLOC.
0 10 .1 RTLOC

You will now have a root locus plotting.
Adjust the X and Y ranges of the plotter in order to see diferrent views of
the complex plane. You will notice that I do not plot the axes; if I
did, a root loci that started on the s axis or jw axis would be obscured.


Usually you have 1 + KG(s)H(s) = 0
write this as 1 + K N(s)/D(s) = 0
and then D(s) + K N(s) = 0, where N and D are polynomials.
D(s) will be your C and N(s) will be KC

After plotting, you can scroll around and look at critical points.
Remember that you are looking at the s and jw axes, and you can't 
see what K is directly. To find K, just substitute the value of s
at the point you are interested in, and solve for K.

John Paul Morrison
--
__________________________________________________________________________
 John Paul Morrison                     |
 University of British Columbia, Canada |
 Electrical Engineering                 |   .sig closed for repairs 

