Exercie for lecture 19 Polynomial method Michael Šebek Automatic control 016 15-4-17
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( )
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.0833-0.0833(+5.0000) -0.94(-) 0.94(+)(+1) >> U*[a; b] an = (+1)(-1) 0 3
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 = -8-7 + 3^ - ^3 + 3^4 + 4^5 b = 6 + 3 + 6^ - 6^3 >> [q,r] = rdiv(a,b) q = -1. - 1. - 0.67^ r = -1 + 3.5 + 18^ >> a-(b*q+r) an = 0 4
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
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 = 1.3333 y = -1.3333(+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
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 = (+3.0000)(+.0000)(-1.0000), b = (+3) >> x=prand();y=prand();c=a*x+b*y c = 0.877(+3.069)(+3.0000)(+1.6799)(^-3.307+3.0550) >> x=prand();y=prand();c=a*x+b*y c = 0.758(+3.0000)(+1.4780)(+1.1711)(^-1.9064+1.4597) >> x=prand();y=prand();c=a*x+b*y c = -0.833(+3.0000)(+.411)(+0.806)(-0.6043)(-1.4946)
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
Example: General olution Some olution a=(+1)^*(-1) a = -1 - + ^ + ^3 >> b=(+1)*(-) b = - - + ^ >> c=(+1)*(+) c = + 3 + ^ >> [x,y]=axbyc(a,b,c) x = 1.3333 y = -1.7-1.3 >> [x,y,v,w]=axbyc(a,b,c) x = 1.3333 y = -1.7-1.3 v = 0.76-0.38 w = -0.38 + 0.38^ Other olution >> t=1- t = 1 >> xnew=x+v*t,ynew=y+w*t xnew =.1-1.1 + 0.38^ ynew = - - 0.96 + 0.38^ - 0.38^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
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
Example: Solution of minimum degree Data >> a=prand(3),b=prand(),c=prand(5) a = 0.6 - + 1.5^ + 0.43^3 b = 0.47 + 1.3 + 0.64^ c = 1.3-0.91 -.3^ + 1.8^3 + 0.39^4 + 0.0^5 >> [x,y,b_bar,a_bar]=axbyc(a,b,c); b_bar,a_bar b_bar = -0.19-0.51-0.5^ a_bar = 0.5-0.4 + 0.61^ + 0.17^3 Solution of min. degree y Solution of min. degree x >> [x,y]=axbyc(a,b,c) x = 1.9 +.4 + 0.047^ y = 0.34-1.9-1.1^ >> [x,y]=axbyc(a,b,c,'miny') x = 1.9 +.4 + 0.047^ y = 0.34-1.9-1.1^ >> [x,y]=axbyc(a,b,c,'minx') x = 1.8 +.3 y = 0.38 - - ^ + 0.03^3 11
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
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 = -1.5 + 0. - 1.4^ - 0.84^3 b = 0.76 + 0.38-1.3^ c1 = 1 >> [x,y]=axbyc(a,b,c1,'minx') x = -0.43 + 0.11 y = 0.45 + 0.13-0.071^ >> [x,y]=axbyc(a,b,c1,'miny') x = -0.43 + 0.11 y = 0.45 + 0.13-0.071^ >> c=prand(6) c = -0.71+0.51-0.4^+0.3^3-0.96^4-0.15^5+0.74^6 >> [x,y]=axbyc(a,b,c,'minx') x = 0.49-0.8 y = 0.064-0.064 + 0.56^ - 0.046^3-0.55^4 >> [x,y]=axbyc(a,b,c,'miny') x = -0.8-0.16 + 1.6^ - 0.89^3 y = -1.5 + 1. - 0.99^ Michael Šebek 13
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. 3 3 1 1 3 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
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
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 0 1 0 v w 16
Example: Solution by a polynomial reduction 1 x( ) 1 y( ) Step 1 and 1 1 0 1 0 1 Step 3 1 1 0 1 1 g ( ) 1 c() 1 ½ ½ 1 1 0 1 0 1 1 1 1 Step 4 x () y () 1 x( ) t( ) 1 y( ) t( ) 17
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 0 1 0 1 0 1 0 1 0 1 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 0 0 0 0 0 1 0 1 0 0 1 0 1 1 0 0 1 1 1 1 We will olve thi matrix equation, and obtain x0, y0, x1, y1. Then we compoe the earched reult. x( ) x x, y( ) y y 0 1 0 1 18
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 0 0 1 1 x y 0 1 0 0 1 1 1 1 1 x( ) t( ) 1 y( ) t( ) 1 1 x( ), y( ) 19
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 1 0 0 1 0 1 1 1 x 0.5, y 10.5 >> a=1+^,b=(1+)^,c=a+b-1 a = 1 + ^ b = 1 + + ^ c = 1 + + ^ >> S=ylv([a;b],0),C=c{0:} S = 1 0 1 1 1 C = 1 >> XY=C/S XY = 0.5000 1.0000 >> XY*S==C an = 0 0 0 >> [x,y]=axbyc(a,b,c) x = -0.5 y = 1 + 0.5 0
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 = 0.0670 a = 0.017 + 0.0079 + 0.0011^ p = q = 15 + 3 c1 = a*p + b*q c1 = 1 + 0. + 0.0079^ + 0.0011^3 >> root(c1) an = -1.1476 +13.653i -1.1476-13.653i -4.8866 + 0.0000i >> c=(+5)*(+1+j)*(+1-j) c = 10 + 1 + 7^ + ^3 1
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+0 + 9.1e+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 = 909.0909 y = 1.5e+0-5 -.7^ >> p = x*, q =y p = 9.1e+0 q = 1.5e+0-5 -.7^ 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
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 = 1 - + ^ b = c = 1 + + ^ >> [x,y]=axbyc(a,b,c) x = 1.0000 y = 4.0000 Other example: Proper regulator exit. Thi i a generic cae. >> c=prand(,'ta') c = 0.86 +.6 + ^ >> [x,y]=axbyc(a,b,c) x = 0.8573 y = 4.4 + 0.14 3
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-19-013 4
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
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
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( ) 1 1 1 7
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 = 0.3 + 0.6 / 0.3 + 0.6 + 0.3^ >> tep(tf(t/),tf(1/),5) a( ) p( ) b( ) q( ) m( ) f ( ) t( ) b( ) r( ) m( ) p( ) q( ) r( ) 1 8
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 1 1 4 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
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 = 1 + + ^ p3 = 0 >> w=1;x4=x3+w*b; p4=x4*f,q4=q3-w*a*f p4 = ^ + ^3 q4 = 1 + + ^4 30 4
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 + / 1 + + ^ >> T1DOF= q4*coprime(b/m) T1DOF = 1 + + ^4 / 1 + + ^ >> perdof=tf((tdof)/^); per1dof=tf(t1dof/^); impule(perdof,per1dof,tf(1/ ^),3) 31
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-19-013 3
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-19-015 33
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