Exercises for lectures 19 Polynomial methods

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "Exercises for lectures 19 Polynomial methods"

Transcription

1 Exercie for lecture 19 Polynomial method Michael Šebek Automatic control

2 Diviion of polynomial with and without remainder Polynomial form a circle, but not a body. (Circle alo form integer, in comparion to body that form rational number, rational function, etc.). Generally, it i not poible to divide polynomial without remainder. Polynomial can be divided without remainder only with o called one, that are polynomial with 0 degree, i.e. nonzero real number. But ometime it i poible to divide without remainder: If a() divide c() without remainder, we denote it a () c () Then exit uch b(), that c( ) a( ) b( ) Then a() i divior of c(), and c() i a multiple of a() If a() divide c(), d(), then a() i a common divior of c(), d() The greatet common divior i the one with the highet degree Example For c( ) ( 1)( 1) a( ) 1 d( ) i a () c () d( ) c( )

3 Greatet common divior greatet (left) common divior = největší polečný dělitel For i g ( ) gcd a( ), b( ) a( ) p( ) b( ) q( ) g( ) a( ) v( ) b( ) w( ) 0 and the matrix i unimodular (= it determinant i non-zero contant) p( ) q( ) U() v( ) w( ) >> pformat rootr >> a=(+1)^*(-1)*(+) a = (+)(^++1)(-1) >> b=(+1)*(-1)*(-) b = (+1)(-1)(-) >> g=grd(a,b) g = (+1)(-1) >> [g,u]=grd(a,b) g = (+1)(-1) U = ( ) -0.94(-) 0.94(+)(+1) >> U*[a; b] an = (+1)(-1) 0 3

4 Diviion with remainder Euklid of Alexandria ( ~ 300 BCE) introduced diviion with remainder For given polynomial a(), b()ǂ0 there exit polynomial q(), r(), uch that a bq r, deg r deg b quotient remainder Therefore polynomial form o-called Euclidean circle. >> a=prand(5,'int'),b=prand(3,'int') a = ^ - ^3 + 3^4 + 4^5 b = ^ - 6^3 >> [q,r] = rdiv(a,b) q = ^ r = ^ >> a-(b*q+r) an = 0 4

5 A neceary and ufficient condition for olvability Lemma: Equation a( ) x( ) b( ) y( ) c( ) ha olution if and only if gcd a, b c Diophantu of Alexandria Greek mathematician 3. century A.D. Proof Neceity ( only if ): Let ax ' by ' c and denote gcd( a, b) g, a ga, b gb Then g( ax ' by ') c and hence g c Sufficiency ( if ) Let ( a, b) c and denote ( a, b) g, c gc Then alway exit p, q, uch that ap bq g Multiplying by c we obtain a( pc ) b( qc ) c and we obtained the olution x pc, y qc 5

6 Example: Solvability >> c=(+1)*(+); >> a=(+1)^*(-1); b=(+1)*(-); >> g=gld(a,b) g = (+1) >> pol(c/g) an = (+.0000) >> [x,y]=axbyc(a,b,c) x = y = (+1.500) >> a*x+b*y-c an = 0 >> c=(-1)*(+) c = (+)(-1) >> c/g an = (+)(-1)/(+1) >> pol(c/g)??? Error uing ==> frac.pol Argument i not convertible to polynomial. 6

7 Example: interpretation of condition of olvability Tranfer function without 1 ( 3) hidden mode y( ) u( ) (no cancellation) ( 1)( ) ( 3) u 1 ( 1)( ) y b () a( ) ( 1)( )( 3) y( ) u( ) a () b( ) ( 3) Characteritic polynomial i a( ) x( ) b( ) y( ) ( 1)( )( 3) x( ) ( 3) y( ) ( 3) d( ) So no FB regulator change uncontrollable part Michael Šebek 7 1 ( 3) >> pformat rootr >> a=(-1)*(+)*(+3),b=+3 a = ( )(+.0000)( ), b = (+3) >> x=prand();y=prand();c=a*x+b*y c = 0.877(+3.069)( )( )(^ ) >> x=prand();y=prand();c=a*x+b*y c = 0.758( )( )( )(^ ) >> x=prand();y=prand();c=a*x+b*y c = ( )(+.411)(+0.806)( )( )

8 General olution Lemma: General olution General olution x x bt where t i a random ha the form y y at polynomial parameter Proof: 1) It' a olution for every t: Simply ubtitute it into equation ax by ax abt by bat ax by ba ab t c ) There i no other olution: For any olution x, y and x,y it hold, that ax by c, ax ' by ' c Subtracting a( x x') b( y y') 0 and from it a( x x') ( y y') b Previouly defined polynomial ab, are relatively prime and ab ab Thu, hence for ome polynomial t i b x x ' a y y ' x x ' bt y y ' at Any uch olution of t we obtain by going through the et of all poible polynomial 8

9 Example: General olution Some olution a=(+1)^*(-1) a = ^ + ^3 >> b=(+1)*(-) b = ^ >> c=(+1)*(+) c = ^ >> [x,y]=axbyc(a,b,c) x = y = >> [x,y,v,w]=axbyc(a,b,c) x = y = v = w = ^ Other olution >> t=1- t = 1 >> xnew=x+v*t,ynew=y+w*t xnew = ^ ynew = ^ ^3 >> a*xnew+b*ynew-c an = 0 x ( ) x'( ) r( ) t( ) new y ( ) y '( ) v( ) t( ) new r( ) b( ) v( ) a( ) x( ) x '( ) b ( ) t( ) y( ) y '( ) a( ) t( ) 9

10 We take a general olution x x ' bt y y ' at by a diviion algorithm we reduce x' modulo b: The it hold that x r b ( t q) y y ' at By choice t = q we obtain a olution x, y of minimum degree in x. x r deg x deg b y y ' aq Similarly, we prove the exitence and unicity of olution of minimum degree in y. Thee two olution are generally different. Solution of minimum degree x ' bq r deg r deg b 10

11 Example: Solution of minimum degree Data >> a=prand(3),b=prand(),c=prand(5) a = ^ ^3 b = ^ c = ^ + 1.8^ ^ ^5 >> [x,y,b_bar,a_bar]=axbyc(a,b,c); b_bar,a_bar b_bar = ^ a_bar = ^ ^3 Solution of min. degree y Solution of min. degree x >> [x,y]=axbyc(a,b,c) x = ^ y = ^ >> [x,y]=axbyc(a,b,c,'miny') x = ^ y = ^ >> [x,y]=axbyc(a,b,c,'minx') x = y = ^ ^3 11

12 An important pecial cae occur when deg c deg a deg b Explanation (we expect relatively prime a, b) Coincidence x y c ax by c trictly proper, if it hold b a ab trictly proper, if ol. min deg x trictly proper, if ol. min deg y Right ide trictly proper either both fraction on the left are trictly proper or neither one i Right ide not trictly proper only one fraction on the left may be trictly proper If deg c deg a deg b, then both olution of minimum degree coincide and there i only one olution of minimum degree (which i minimal in both unknown at the ame time). If deg c deg a deg b, then there exit two different olution of minimum degree (one in x and the other one in y). 1

13 Example: Coincidence Ye. Both are the ame! So there i only one olution of minimum degree. No. They are different. >> a=prand(3),b=prand(),c1=1, c=prand(6) a = ^ ^3 b = ^ c1 = 1 >> [x,y]=axbyc(a,b,c1,'minx') x = y = ^ >> [x,y]=axbyc(a,b,c1,'miny') x = y = ^ >> c=prand(6) c = ^+0.3^3-0.96^4-0.15^5+0.74^6 >> [x,y]=axbyc(a,b,c,'minx') x = y = ^ ^3-0.55^4 >> [x,y]=axbyc(a,b,c,'miny') x = ^ ^3 y = ^ Michael Šebek 13

14 Elementary operation on polynomial matrix Row operation - 3 baic one row multiplication 1 by a non-zero contant row interchange 1 row addition of multiplied 1 polynomial to other row 1. row 3 row witch 1. row +.ord Column operation are dual. Elementary operation, except the multiplication, maintain the determinant. They correpond to multiplication by unimodular matrice (i.e. matrix with a contant non-zero determinant). 14

15 Solution by a polynomial reduction Solution of equation by polynomial reduction Step 1 Form a compoite matrix Step Reduce it by elementary operation to the form a ( ) 1 0 b ( ) 0 1 g( ) p( ) q( ) 0 v( ) w( ) Then p( ) a( ) q( ) b( ) g( ) v( ) a( ) w( ) b( ) 0 where gcd a( ), b( ) g ( ) gcd v( ), w( ) 1 Step 3 Extract g() z c() and obtain c( ) c ( ) g( ) If it doen t work, the equation doen t have a olution! 15

16 The reult: a the olution take x( ) c ( ) p( ) y( ) c ( ) q( ) Moreover, all olution are expreed a follow Solution by a polynomial reduction x( ) c ( ) p( ) v( ) t( ) y( ) c ( ) q( ) w( ) t( ) free polynomial parameter The procedure of calculation follow from the equality p q a 1 0 g p q v w b v w 16

17 Example: Solution by a polynomial reduction 1 x( ) 1 y( ) Step 1 and Step g ( ) 1 c() 1 ½ ½ Step 4 x () y () 1 x( ) t( ) 1 y( ) t( ) 17

18 Solution by a Sylveter matrix Example of nd order polynomial, a() a0 a1 a where we earch for x( ) x0 x1, y( ) y0 y1 b() b0 b1 b c() c0 c1 c Step 1: Subtituting polynomial with unknow coefficient into equation a a a x x b b b y y c c c a x b y c Comparing coefficient of identical power, a x b y a x b y c or in matrix form a a x b y a x b y c 0 a1 a 0 b ax1 b y1 0 0 b1 b 0 x0 y0 x1 y1 c0 c1 c 0 0 a0 a1 a 0 b0 b1 b We will olve thi matrix equation, and obtain x0, y0, x1, y1. Then we compoe the earched reult. x( ) x x, y( ) y y

19 1 x( ) 1 y( ) a( ) 1 b( ) 1 c() x() y() We got the minimum degree olution (in both unknown), other than that particular olution obtained earlier. The olution from the lat example i obtained from the general olution by chooing t() = 1 Example: Solution by a Sylveter matrix x x y 0 0 y x y x( ) t( ) 1 y( ) t( ) 1 1 x( ), y( ) 19

20 Beware of micalculation For equation we look for a olution of 0 degree (knowing that it might be wrong) and try to olve the matrix equation that ha obviouly no olution. Still the polynomial equation ha a olution, of higher degree, e.g. Thi i a typical example a 1, b (1 ) 1, c 1 x y x 0.5, y 10.5 >> a=1+^,b=(1+)^,c=a+b-1 a = 1 + ^ b = ^ c = ^ >> S=ylv([a;b],0),C=c{0:} S = C = 1 >> XY=C/S XY = >> XY*S==C an = >> [x,y]=axbyc(a,b,c) x = -0.5 y =

21 Example: pole aignment Sytem motor Input voltage tranfer function Previouly deigned PI controller give a zero error to tep but not a good dynamic Let try better c b = a = ^ p = q = c1 = a*p + b*q c1 = ^ ^3 >> root(c1) an = i i i >> c=(+5)*(+1+j)*(+1-j) c = ^ + ^3 1

22 The olution i a general regulator of 1 t order. It enure good dynamic, but it Example: pole aignment >> [x1,y1]=axbyc(a,b,c) x = -1.7e e+0 y = 1.9e+0-3 doen t have an integrator and therefore it doen t enure zero error. Let try to force an integrator in the dynamic. (olving the equation we will make part of the ytem) We get a controller with good dynamic and zero teady-tate error but it i a PID, what we could expect. >> [x,y]=axbyc(a*,b,c) x = y = 1.5e ^ >> p = x*, q =y p = 9.1e+0 q = 1.5e ^ Remark: we have good control over dynamic (by appropriate election of CL pole) we can enure additional requirement but we have no control over the regulator order - it jut come out

23 Example: Proper controller Example: When the right ide of the equation doen t have a ufficiently high degree. There i only a mall chance for a proper controller. (It i not a generic cae.) >> a=(-1)^,b=,c=(+1)^ a = ^ b = c = ^ >> [x,y]=axbyc(a,b,c) x = y = Other example: Proper regulator exit. Thi i a generic cae. >> c=prand(,'ta') c = ^ >> [x,y]=axbyc(a,b,c) x = y =

24 We aume that a(), b() are relatively prime All tabilizing controller - explicitly Explicit parameterization of all tabilizing controller If c() i ome table polynomial and x(), y() i ome olution of a( ) x( ) b( ) y( ) c( ) then all tabilizing controller are given by q( ) y( ) d( ) a( ) t( ) p( ) x( ) d( ) b( ) t( ) Part of the parameterization are all poible reduction in the controller tranfer function. Proper controller i obtained under following condition: Proper ytem t. f. b( ) a( ) and deg c( ) deg a( ) 1 Proper fraction t( ) d( ) and p ( ) 0 t() i a random polynomial, d() i a random table pol. Michael Šebek ARI

25 What i the form of a characteritic polynomial? For t( ) 0, d( ) 1 All tabilizing controller q( ) y( ) a( ) p( ) b( ) q( ) a( ) x( ) b( ) y( ) c( ) p( ) x( ) Fort () random, d () random table (no reduction in cont. ) q( ) y( ) d( ) a( ) t( ) p( ) x( ) d( ) b( ) t( ) a( ) x( ) b( ) y( ) d( ) a( ) b( ) b( ) a( ) t( ) c( ) d( ) a( ) p( ) b( ) q( ) a( ) x( ) d( ) b( ) t( ) b( ) y( ) d( ) a( ) t( ) I there alway factor c ()? In thi cae it would not be a general table characteritic polynomial? No, it i not there: In ome cae, it get cancelled "in the controller already. 5

26 Cancellation (reduction) For parameter, that lead to cancellation (reduction) q () y( ) d( ) a( ) t( ) c( ) p( ) x( ) d( ) b( ) t( ) c( ) y( ) d( ) a( ) t( ) x( ) d( ) b( ) t( ) a( ) p( ) b( ) q( ) a( ) b( ) c( ) c( ) a( ) x( ) b( ) y( ) d( ) a( ) b( ) b( ) a( ) t( ) c( ) d( ) d () c( ) c( ) The reulting characteritic polynomial can be any table pol. When doe it happen? It ha to be: We olve one equation, the econd come out. Final controller ( after reduction ) q( ) v( ) y( ) d( ) a( ) t( ) c( ) v( ) x( ) d( ) b( ) t( ) c( ) w( ) y( ) d( ) c( ) v( ) a( ) t( ) x( ) d( ) c( ) w( ) b( ) t( ) p( ) w( ) 6

27 Sytem b( ) a( ) 1 i tabilized by a controller y1( ) x1( ) 1 with reulting char. polynomial and alo controller y( ) x( ) 1 11 with reulting char. polynomial Conider the firt controller and write the parametrization in the form We chooe parameter o that the "firt char. pol. i cancelled We olve the equation After ubtitution and we obtain a( ) x ( ) b( ) y ( ) 1 1 a( ) x ( ) b( ) y ( ) 1 Example q( ) d( ) t( ) p( ) d( ) t( ) y ( ) d( ) c( ) v( ) a( ) t( ) 1 v( ) t( ) 1 1 v( ) t( ) q( ) 1 1 p( )

28 Example: Tracking DOF a( ) 1 1 b( ) f ( ) f ( ) m( ) 1 >> a=(1+)*(1-), b=+, f=^, m=(+)*(+1)^ >> [p,q]=axbyc(a,b,m,'miny') p = -, q = + >> [t,r]=axbyc(f,b,m,'miny'); r r = 1 + >> T=coprime(b*r/(a*p+b*q)) T = / ^ >> tep(tf(t/),tf(1/),5) a( ) p( ) b( ) q( ) m( ) f ( ) t( ) b( ) r( ) m( ) p( ) q( ) r( ) 1 8

29 Deign for the ame aigned regulator 1DOF, o error control How to: electing from DOF controller From the olution of the previou p( ) w( )( ) q( ) w( )(1 ) tah elect uch that q( ) r( ) r( ) 1 v( ) Chooing w 1, v we get unatifactory p1 ( ) 0 q ( ) 1 r ( ) By other choice u 1, v 1 we obtain Tracking - 1DOF p ( ), q ( ) 1 r ( ) Thi olution i not proper, but i atifactory. Proper olution doe not exit. A expected, the denominator of 1DOF controller ha factor 9

30 1DOF controller i directly propoed by a olution of equation a( ) f ( ) x( ) b( ) q( ) m( ) and chooing p( ) f ( ) x( ) Becaue the olution of min. degree x3( ) p3( ) 0 q3( ) 1 i unatifactory, we have to find other fom a general olution x( ) 0 w( )( ) q( ) 1 w( )(1 ) For w 1 we obtain x ( ), p ( ) 4 4 q ( ) 1 4 Tracking - 1DOF >> [x3,q3]=axbyc(a*f,b,m), p3=x3*f x3 = 0 q3 = ^ p3 = 0 >> w=1;x4=x3+w*b; p4=x4*f,q4=q3-w*a*f p4 = ^ + ^3 q4 = ^4 30 4

31 DOF and 1DOF tracking comparion Notice, that DOF controller i proper but 1DOF controller i not. Thi i reflected in the CL tranfer function in repone to ramp ignal. q( ) r( ) 1, p( ) p( ) q4() 1 p ( ) 4 4 >> TDOF= r*coprime(b/m) TDOF = 1 + / ^ >> T1DOF= q4*coprime(b/m) T1DOF = ^4 / ^ >> perdof=tf((tdof)/^); per1dof=tf(t1dof/^); impule(perdof,per1dof,tf(1/ ^),3) 31

32 Phyical interpretation and comparion with 1DOF Condition for olvability have a nice interpretation: Stability gcd( ab, ) mean plant tabilizability gcd( f, b) 1 i general condition for the tracking, depend on zero def.: an not pa any (here untable) mode, which i equal to the zero f a i alo a natural ytem driven by an input that converge to zero and aymptotically follow jut uch an untable ignal, which i able to generate by itelf. If it i not fulfilled, the ytem can track only when we give up demand for a table input Comparion of two and one degree of freedom Special cae q = r i eay to differentiate. Equation have a olution q = r if ap f t ap bq m f t br m Claical tructure require, untable mode in ytem or controller tranfer function, even if the input can be untable. Michael Šebek ARI

33 Derivation Sytem cutomization y b () u a () q( ) r( ) u y u p( ) p( ) new y b( ) r( ) u a( ) p( ) b( ) q( ) new y g () u f() new b( ) r( ) g( ) a( ) p( ) b( ) q( ) f ( ) b ( ) r( ) g( ) a( ) p( ) b( ) q( ) f ( ) a( ) p( ) b( ) q( ) f ( ) b( ) t( ) b ( ) r( ) g( ) f ( ) b ( ) t( ) f ( ) r( ) g( ) t ( ) 1 r( ) g( ) t( ) Solvable: Alway. But if we want table olution the condition mut be met. Stability condition: f() table (of coure) and take table t () and gcd( ab, ) ha to be table. b() table: Thi mean that we can not change the untable zero! Michael Šebek ARI

34 Sytem and required t. f. Relatively prime factor We chooe and olve the equation Solution p( ) 3( 1), q( ) ( ). Feedforward i The controller i Verification b( ) ( 1)( 1) a( ) ( )( ) t ( ) 1 Example: Model matching b( ) ( 1)( 1) ( 1) b ( ) g( ) ( 1) 1 g( ) ( )( ) p( ) ( 1)( 1) q( ) ( ) ( 1) ( ) 1 u y u 3( 1) 3( 1) new g( ) 1 f ( ) ( ) r ( ) 1 ( 1)( 1) ( 1)( 1) ( 1) 3( )( )( 1) ( 1)( 1)( ) ( ) ( 1) ( ) 34