Basen im Funktionen-Vektorraum 1. Polynom
Transcription
Basen im Funktionen-Vektorraum 1. Polynom
Basen im Funktionen-Vektorraum Prof. Dr. Dörte Haftendorn, MuPAD 4, http://haftendorn.uni-lueneburg.de Aug.06 Automatische Übersetzung aus MuPAD 3.11, Mrz 06 Update 22.04.06 Es fehlen nocht textliche Änderungen, die MuPAD 4 direkt berücksichtigen, das ist in Arbeit. Web: http://haftendorn.uni-lueneburg.de www.mathematik-verstehen.de +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1. Polynom-Vektorräume PVR(n) der Polynome bis zum Grad n 1a. PVR(2) Vektorraum der Parabeln und Geraden 1b. PVR(3) Vektorraum der Polynome bis zum 3. Grad 1b (i) Lagrange Interpolations-Polynom 1b (ii) Newton Interpolations-Polynom 1b (iii) Bernstein-Polynome, Bezér-Splines 2. Sin-Cos-Vektorraum 3. VR beliebiger Funktionen und DGLn ############################################ 1a. PVR(2) Vektorraum der Parabeln und Geraden -------------------------------------------------------------------------------e0:=x->1: e1:=x->x: e2:=x->x^2: e0(x),e1(x), e2(x) 1, x, x2 Die Standardbasis im PVR(2) Jede Parabel oder Gerade lässt sich eindeutig als Linearkombination der Standardbasis beschreiben: p:=x->a0*e0(x)+a1*e1(x)+a2*e2(x); p(x) () () () x ® a0 × e0 x + a1 × e1 x + a2 × e2 x a2 × x2 + a1 × x + a0 p(1) a0 + a1 + a2 Es kann auch repräsentiert werden durch pv:=matrix([a0,a1,a2]) a0 a1 a2 Ã! r*p(x); expand(%); r*pv; 1 r*pv; r × a2 × x2 + a1 × x + a0 ( ) a2 × r × x2 + a1 × r × x + a0 × r à ! a0 × r a1 × r a2 × r Hier sieht man, dass das r-fache eines Polynoms repräsentiert wird durch das r-fache des zugehörigen Vektors. pi:=x->-p(x); pi(x) x ® -p x () () () - a2 × x2 - a1 × x - a0 N:=x->p(x)+pi(x); N(x) x ® p x + pi x 0 (q+N)(x)-q(x) 0 Nullpolynom ist die Null-Funktion, die jedem x die Zahl 0 zuordnet, deren Graph ist die x-Achse. Summe von zwei Polynomen q:=x->b0*e0(x)+b1*e1(x)+b2*e2(x); q(x); qv:=matrix([b0,b1,b2]) () () () x ® b0 × e0 x + b1 × e1 x + b2 × e2 x b2 × x2 + b1 × x + b0 à ! b0 b1 b2 (p+q)(x) a0 + b0 + a2 × x2 + b2 × x2 + a1 × x + b1 × x pplusq:=x->p(x)+q(x); pplusq(x) () () x®p x +q x 2 () () x®p x +q x a0 + b0 + a2 × x2 + b2 × x2 + a1 × x + b1 × x Man sieht, dass in MuPAD die Summe zweier Funktionen richtig gebildet wird. In (p+q)(x) ist das + schon im VR der Polynome gebildet, während in p(x)+q(x) das + in den reellen Zahlen gebildet wird. --------------------------------------------------------------------------------------------------Linearkombination und lineare Unabhängigkeit r*p(x) +s*q(x); collect(expand(%),x) r × a2 × x2 + a1 × x + a0 + s × b2 × x2 + b1 × x + b0 ( ( ) ( ) a2 × r + b2 × s × x2 + a1 × r + b1 × s × x + a0 × r + b0 × s ) ( ) Dies ist eine Linearkombination aus zwei Vektoren. Es werden Skalar mit den Vektoren multipliziert und dann diese Produkte addiert. Eine Menge von Vektoren heißt linear unabhängig, wenn aus der Information, dass einne Linearkombination dieser Vektoren den Nullvektor ergibt, geschlossen werden kann, dass sämtliche Skalare Null sind. --------------------------------------------Beh.: Die Standardbasis ist linear unabhängig. Zu zeigen ist: p(x); [p(0)=0,p(1)=0,p(2)=0] //drei beliebige Einsetzungen a2 × x2 + a1 × x + a0 [ {[ ] a0 = 0, a0 + a1 + a2 = 0, a0 + 2 × a1 + 4 × a2 = 0 solve({p(0)=0,p(1)=0,p(2)=0},{a0,a1,a2}) a0 = 0, a1 = 0, a2 = 0 ]} ############################################### 1b. PVR(3) Vektorraum der Polynome bis zum 3. Grad ------------------------------------------------------------------------------------e0:=x->1: e1:=x->x: e2:=x->x^2: e3:=x->x^3: e0(x),e1(x), e2(x),e3(x) 1, x, x2, x3 3 Die Standardbasis im PVR(2) Jede Parabel oder Gerade lässt sich eindeutig als Linearkombination der Standardbasis beschreiben: der Standardbasis beschreiben: p:=x->a0*e0(x)+a1*e1(x)+a2*e2(x)+a3*e3(x); p(x) () () () () x ® a0 × e0 x + a1 × e1 x + a2 × e2 x + a3 × e3 x a3 × x3 + a2 × x2 + a1 × x + a0 Alles andere gilt entsprechend Andere Basen im PVR(3) an Beispielen ++++++++++++++++++++++++++++++++++++++++++++ 1b. (i) Lagrange-Interpolationspoylnom Stützpunkte: datenPunkte:=[1,2], [2,1],[3,2],[5,3]; [ ][ ][ ][ ] 1, 2 , 2, 1 , 3, 2 , 5, 3 graphDatenPunkte:=plot::Listplot([datenPunkte], LinesVisible=FALSE, PointSize=3,Scaling=Constrained, GridVisible=TRUE,ViewingBox=[0..6,0..4]): plot(graphDatenPunkte): y4 3 2 1 0 0 1 2 3 4 5 6 x le0:=x->(x-2)*(x-3)*(x-5); le1:=x->(x-1)*(x-3)*(x-5); le2:=x->(x-1)*(x-2)*(x-5); le3:=x->(x-1)*(x-2)*(x-3); x® x-2 × x-3 × x-5 ( )( )( ) ( )( )( ) ( )( )( ) x® x-1 × x-3 × x-5 x® x-1 × x-2 × x-5 4 ( )( )( ) ( )( )( ) ( )( )( )( )( )( )( )( )( )( )( ) x® x-1 × x-2 × x-5 x® x-1 × x-2 × x-3 le0(x),le1(x),le2(x),le3(x) x-2 × x-3 × x-5 , x-1 × x-3 × x-5 , x-1 × x-2 × x-5 , x-1 × x-2 le0g:=plot::Function2d(le0(x),x=-1..6,LineColor=RGB::Blue): le1g:=plot::Function2d(le1(x),x=-1..6,LineColor=RGB::Magenta): le2g:=plot::Function2d(le2(x),x=-1..6,LineColor=RGB::Green): le3g:=plot::Function2d(le3(x),x=-1..6,LineColor=[0.5,0.5,0]): xachse:=plot::Function2d(0,x=-1..6,LineColor=[0,0.5,0.5]): plot(le0g,le1g,le2g,le3g,graphDatenPunkte,xachse, LineWidth=1, ViewingBox=[0..6,-3.1..4]) y 4 3 2 1 0 -1 -2 -3 0 1 2 3 4 5 6 x Man kann sich leicht überlegen, warum diese 4 Polynome linear unabhängig sind. Das blaue Polynom kann man nicht durch die anderen linear kombinieren, da alle Linearkombinationen von rot-grün-braun die Nullstelle x=1 haben werden, die das blaue P. aber nicht hat. Ebenso für alle anderen. p:=x->c0*le0(x)+c1*le1(x)+c2*le2(x)+c3*le3(x): p(x) ( )( )( ) ( )( )( ) ( )( )( ) c0 × x - 2 × x - 3 × x - 5 + c1 × x - 1 × x - 3 × x - 5 + c2 × x - 1 × x - 2 × x - 5 + c p(1)=0,p(2)=0,p(3)=0,p(5)=0 - 8 × c0 = 0, 3 × c1 = 0, - 4 × c2 = 0, 24 × c3 = 0 Ist p das Nullpolynom, dann sind alle ci=0. Nochmal: solve({p(1)=0,p(2)=0,p(3)=0,p(5)=0}) {[ ]} c0 = 0, c1 = 0, c2 = 0, c3 = 0 Soll aber p an der Stützstellen die Stützwerte erreichen, so ist 5 Soll aber p an der Stützstellen die Stützwerte erreichen, so ist zu lösen p(1)=2,p(2)=1,p(3)=2,p(5)=3 - 8 × c0 = 2, 3 × c1 = 1, - 4 × c2 = 2, 24 × c3 = 3 Man sieht es sofort. Nochmal: lp:=solve({p(1)=2,p(2)=1,p(3)=2,p(5)=3}) c0 = - 14 , c1 = 13 , c2 = - 12 , c3 = 18 lp[1][1] c0 = - 14 Damit ist das Lagrange-Interpolationspolynom: pl:=x->subs(p(x),lp[1][i]$i=1..4 ):pl(x) x-1 × x-2 × x-3 x-1 × x-2 × x-5 x-1 × x-3 × x-5 x-2 × + 8 2 3 plxg:=plot::Function2d(pl(x),x=-1..6,LineColor=[1,0,0]): plot(le0g,le1g,le2g,le3g,plxg,graphDatenPunkte,xachse, LineWidth=1, ViewingBox=[0..6,-3.1..4]) nh Å Å Å Å io Å ( ) ( ) ( ) ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ( ) ( ) ( ) ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ( ) ( ) ( ) ÅÅÅÅÅÅÅ ( )( ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ y 4 3 2 1 0 -1 -2 -3 0 1 2 3 4 5 6 x Das Interpolationspolynom (rot) verläuft, wie geplant, durch die Punkte ++++++++++++++++++++++++++++++++++++++++++++ 1b. (ii) Newton-Interpolationspoylnom für die Punkte ne0:=x->1; ne1:=x->(x-1); ne2:=x->(x-1)*(x-2); 6 ne2:=x->(x-1)*(x-2); ne3:=x->(x-1)*(x-2)*(x-3); x®1 x®x-1 ( )( ) ( )( )( ) x® x-1 × x-2 x® x-1 × x-2 × x-3 Newton-Basis Sukzessive Nullstellen an den ersten Stützstellen. q:=x->n0*ne0(x)+n1*ne1(x)+n2*ne2(x)+n3*ne3(x): q(x) ( ) ( )( ) ( )( )( ) 0B 1C @ A n0 + n1 × x - 1 + n2 × x - 1 × x - 2 + n3 × x - 1 × x - 2 × x - 3 Ist die "Newtonbasis" eine Basis: sind die Polynome linear unabhängig? matrix([q(1)=0,q(2)=0,q(3)=0,q(5)=0]) n0 = 0 n0 + n1 = 0 n0 + 2 × n1 + 2 × n2 = 0 n0 + 4 × n1 + 12 × n2 + 24 × n3 = 0 Ist q das Nullpolynom, dann sind alle ni=0, wie man sieht. Ja, sie sind l.u.. Nochmal: solve([q(1)=0,q(2)=0,q(3)=0,q(5)=0]) {[ ]} nh ÅÅÅio ( )( )( ) ( ) ( ) ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ( )( )( )( )( ) n0 = 0, n1 = 0, n2 = 0, n3 = 0 Soll aber q an der Stützstellen die Stützwerte erreichen, so ist zu lösen lq:=solve([q(1)=2,q(2)=1,q(3)=2,q(5)=3]) 7 n0 = 2, n1 = - 1, n2 = 1, n3 = - 24 ql:=x->subs(q(x),lq[1][i]$i=1..4 ):ql(x) x-1 × x-2 × x-3 ×7 x-1 × x-2 -x+3 24 ne0(x),ne1(x),ne2(x),ne3(x) 1, x - 1, x - 1 × x - 2 , x - 1 × x - 2 × x - 3 ne0g:=plot::Function2d(ne0(x),x=-1..6,LineColor=RGB::Blue): ne1g:=plot::Function2d(ne1(x),x=-1..6,LineColor=RGB::Magenta): ne2g:=plot::Function2d(ne2(x),x=-1..6,LineColor=RGB::Green): ne3g:=plot::Function2d(ne3(x),x=-1..6,LineColor=[0.5,0.5,0]): 7 qlxg:=plot::Function2d(ql(x),x=-1..6,LineColor=[1,0,0]): xachse:=plot::Function2d(0,x=-1..6,LineColor=[0,0.5,0.5]): plot(ne0g,ne1g,ne2g,ne3g,graphDatenPunkte,xachse, plot(ne0g,ne1g,ne2g,ne3g,graphDatenPunkte,xachse, LineWidth=1, ViewingBox=[0..6,-1..4]) y 4 3 2 1 0 -1 0 1 2 3 4 5 6 x plot(ne0g,ne1g,ne2g,ne3g,qlxg,graphDatenPunkte,xachse, LineWidth=1, ViewingBox=[0..6,-1..4]) y 4 3 2 1 0 -1 0 1 2 3 4 5 6 x Das Interpolationspolynom (rot) verläuft, wie geplant, durch die Punkte ############################################ Vergleich pl(x); ql(x); x-1 × x-2 × x-3 x-1 × x-2 × x-5 x-1 × x-3 × x-5 x-2 × + 8 2 3 ( ) ( ) ( ) ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ( ) ( ) ( ) ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ( ) ( ) ( ) ÅÅÅÅÅÅÅ ( )( ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ( )( )( ) ( ) ( ) ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ x-1 × x-2 × x-3 ×7 x-1 × x-2 -x+3 24 expand(pl(x)); 8 expand(pl(x)); expand(ql(x)); 3 2 173 + 27 - x24× 7 + 114× x - x ×24 4 ÅÅÅÅ ÅÅÅÅÅ ÅÅÅÅÅÅ ÅÅÅ ÅÅÅÅ ÅÅÅÅÅ ÅÅÅÅÅÅ ÅÅÅ 3 2 173 + 27 - x24× 7 + 114× x - x ×24 4 Das Auflösen der Klammern ist numerisch nicht sinnvoll, Es dient hier nur dem Vergleich in der Standardbasis. plot(graphDatenPunkte,LineWidth=1) y4 3 2 1 0 0 1 2 3 4 5 6 x ############################################# ++++++++++++++++++++++++++++++++++++++++++++ 1b. (iii) Bernstein-Poylnome sie sind die Grundlage der Beziér-Splines siehe Extraseite mit Herleitung B0:=t-> (1-t)^3: B1:=t->3*t* (1-t)^2: B2:=t->3*t^2*(1-t): B3:=t-> t^3: 3 ( ) ( ) ( ) - t-1 B0(t); B1(t); B2(t); B3(t); 3×t× t- 1 2 - 3 × t2 × t - 1 t3 dp:=datenPunkte; [ ][ ][ ][ ] 1, 2 , 2, 1 , 3, 2 , 5, 3 9 [ ][ ][ ][ ] 1, 2 , 2, 1 , 3, 2 , 5, 3 x0:=dp[1][1]:x1:=dp[2][1]:x2:=dp[3][1]:x3:=dp[4][1]: y0:=dp[1][2]:y1:=dp[2][2]:y2:=dp[3][2]:y3:=dp[4][2]: graphDatenPunkte:=plot::Listplot([datenPunkte], LinesVisible=FALSE, PointSize=3,Scaling=Constrained, GridVisible=TRUE,ViewingBox=[0..6,0..4]): Für eine Parameterdarstellung werden die Koordinaten der Datenpunkte direkt als Skalare in einer Linearkombination der Bernsteinpolynome verwendet. (Vektorieller Beweis auf der Extraseite) Das ist der Grund für die breite Verwendung der Bezierkurven in Computerwerkzeugen (Malprogramme, Notensatz, Schriften....) xb:=t->x0*B0(t)+x1*B1(t)+x2*B2(t)+x3*B3(t): yb:=t->y0*B0(t)+y1*B1(t)+y2*B2(t)+y3*B3(t): [xb(t),yb(t)] 5 × t3 + 6 × t × t - 1 2 - t2 × t - 1 × 9 - t - 1 3, 3 × t3 + 3 × t × t - 1 2 - t2 × t - 1 × 6 - t - 1 [ ( ) ( ) ( ) ( ) ( ) ( ) Beim Beziér-Spline werden von 4 Punkten zwei als Randpunkte und 2 als Steuerpunkte augefasst. grbez:=plot::Curve2d([xb(t),yb(t)],t=0..1, LineWidth=1, LineColor=[1,0,0]): tang1:=plot::Line2d([x0,y0],[x1,y1],LineWidth=0.5): tang2:=plot::Line2d([x2,y2],[x3,y3],LineWidth=0.5): plot(grbez,graphDatenPunkte,tang1,tang2) y4 3 2 1 0 0 1 2 3 4 5 6 x Dieses Beispiel sollte auf denselben Datenpunkten Basieren wie die obigen Interpolationspolynome. Darum seien beide nun verglichen: plg:=plot::Function2d(pl(x),x=0..6, LineWidth=0.5, LineColor=[1,0,1]): plot(grbez,graphDatenPunkte,plg) y4 10 3 y4 3 2 1 0 0 1 2 3 4 5 6 x ####################################### 2. Sin-Cos-Vektorraum r*sin(x)+s*cos(x)=0 s × cos x + r × sin x = 0 () () Einsetzen von PI/2 und PI ergibt sofort r=0 und s=0. Die Funktionen f ung g mit spannen einen 2-Dimensionalen VR auf . Eine andere Basis in diesem VR wäre expand(sin(x+a)); expand(sin(x+b)); cos a × sin x + sin a × cos x () () () () () () () () cos b × sin x + sin b × cos x Dagegen ist kein Element dieses VR, denn gl:=sin(2*x)=r*sin(x)+s*cos(x); ( ) () () {[ ]} {[ ]} sin 2 × x = s × cos x + r × sin x solve(subs(gl, x = 0),{s,r}); solve(subs(gl, x = PI/2),{s,r}); r = z, s = 0 r = 0, s = z Sin(2x) lässt sich nicht in dieser Basis ausdrücken. 11 Sin(2x) lässt sich nicht in dieser Basis ausdrücken. Alle Funktionen dieses VR haben 2*PI als (minimale) Periode. Sie lassen sich auch schreiben als plotfunc2d(2*sin(x)+3*cos(x)) y 3 2 1 -5 -4 -3 -2 -1 1 2 3 4 -1 5 x -2 -3 ################################ 3. VR beliebiger Funktionen Bei der Lösung von lineare DGL belibiger Ordnung, hier 2. Ordnung mit der sogenannten Störfunktion g ist beim Lösungsverfahren ein Ansatz G zu machen, der ein allgemeines Element eines VR, dem g angehört, darstellt Daher lohnt sich die Kenntnis von Funktions-Vektorräumen. Weiteres zum Lösen von DGLn auf einer Extraseite 12 13