/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/ /* [ Created with wxMaxima version 0.8.3a ] */ /* [wxMaxima: title start ] Lösen eines linearen Gleichungssystems (n=m=3) mithilfe des Gauss-Algorithmus und graphische Darstellung [wxMaxima: title end ] */ /* [wxMaxima: comment start ] A. Filler, Humboldt-Universität zu Berlin [wxMaxima: comment end ] */ /* [wxMaxima: section start ] Eingabe der Koeffizienten [wxMaxima: section end ] */ /* [wxMaxima: comment start ] Geben Sie die Koeffizienten eines linearen Gleichungssystems (LGS) der Form a111*x + a112*y + a113*z = b11 a121*x + a122*y + a123*z = b12 a131*x + a132*y + a133*z = b13 ein. Wichtig: Der Koeffizient a111 muss von Null verschieden sein. Falls in Ihrem LGS dieser Koeffizient Null ist, vertauschen Sie die erste Gleichung mit einer Gleichung, in welcher der Koeffizient vor x ungleich Null ist. Geben Sie in jede Eingabezelle SHIFT+ENTER ein, damit Maxima die Eingaben verarbeitet bzw. die eingegebenen Befehle ausführt. (Eingabezellen sind diejenigen Bereiche des Blattes, die mit einem roten Pfeil --> beginnen und die links durch eine Klammer zusammengehalten sind. Jeder dieser Bereiche muss mit SHIFT+ENTER abgeschlossen werden.) [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ a111 : 3/2 $ a112 : 4 $ a113 : -2 $ a121 : 2 $ a122 : -2 $ a123 : -9/2 $ a131 : 1 $ a132 : -3 $ a133 : 1 $ b11 : 1 $ b12 : -1/2 $ b13 : 2 $ /* [wxMaxima: input end ] */ /* [wxMaxima: subsect start ] Ausgabe der Gleichungen [wxMaxima: subsect end ] */ /* [wxMaxima: input start ] */ Gl11 : a111*x + a112*y + a113*z = b11; Gl12 : a121*x + a122*y + a123*z = b12; Gl13 : a131*x + a132*y + a133*z = b13; /* [wxMaxima: input end ] */ /* [wxMaxima: section start ] Graphische Darstellung der Gleichungen durch Ebenen [wxMaxima: section end ] */ /* [wxMaxima: comment start ] Nach Eingabe des folgenden Befehls öffnet sich (nach wenigen Sekunden) ein Fenster, in dem die durch die drei Gleichungen des LGS beschriebenen Ebenen dargestellt werden. Mit der Maus können Sie die Darstellung drehen und so aus unterschiedlichen Richtungen betrachten. Die Darstellung erfolgt in dem Bereich, der durch die x-, y- und z-Werte -5 und 5 begrenzt wird. Sie können den Darstellungsbereich verändern, indem Sie die Werte in "x,-5,5,y,-5,5,z,-5,5" (für alle drei Gleichungen) anpassen. [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ load(draw)$ draw3d( axis_3d = true, enhanced3d = false, surface_hide = true, zrange = [-5,5], xyplane = 0, x_voxel = 10, y_voxel=10, z_voxel=10, color = grey , implicit(Gl11,x,-5,5,y,-5,5,z,-5,5), color = blue , implicit(Gl12,x,-5,5,y,-5,5,z,-5,5), color = red , implicit(Gl13,x,-5,5,y,-5,5,z,-5,5) )$ /* [wxMaxima: input end ] */ /* [wxMaxima: section start ] Durchführung des Gauss-Algorithmus [wxMaxima: section end ] */ /* [wxMaxima: subsect start ] 1. Schritt [wxMaxima: subsect end ] */ /* [wxMaxima: input start ] */ a211:a111$ a212:a112$ a213:a113$ b21:b11$ a221:a121-a111*a121/a111$ a222:a122-a112*a121/a111$ a223:a123-a113*a121/a111$ b22:b12-b11*a121/a111$ a231:a131-a111*a131/a111$ a232:a132-a112*a131/a111$ a233:a133-a113*a131/a111$ b23:b13-b11*a131/a111$ Gl21 : a211*x + a212*y + a213*z = b21; Gl22 : a221*x + a222*y + a223*z = b22; Gl23 : a231*x + a232*y + a233*z = b23; /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] Graphische Darstellung des LGS nach dem 1. Schritt des Gauss-Algorithmus [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ load(draw)$ draw3d( axis_3d = true, enhanced3d = false, surface_hide = true, zrange = [-5,5], xyplane = 0, x_voxel = 10, y_voxel=10, z_voxel=10, color = grey , implicit(Gl21,x,-5,5,y,-5,5,z,-5,5), color = blue , implicit(Gl22,x,-5,5,y,-5,5,z,-5,5), color = red , implicit(Gl23,x,-5,5,y,-5,5,z,-5,5) )$ /* [wxMaxima: input end ] */ /* [wxMaxima: subsect start ] 2. Schritt (Dreiecksform) [wxMaxima: subsect end ] */ /* [wxMaxima: input start ] */ a311:a211$ a312:a212$ a313:a213$ b31:b21$ a321:a221$ a322:a222$ a323:a223$ b32:b22$ a331:a231-a221*a232/a222$ a332:a232-a222*a232/a222$ a333:a233-a223*a232/a222$ b33:b23-b22*a232/a222$ Gl31 : a311*x + a312*y + a313*z = b31; Gl32 : a321*x + a322*y + a323*z = b32; Gl33 : a331*x + a332*y + a333*z = b33; /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] Graphische Darstellung des LGS nach dem 2. Schritt des Gauss-Algorithmus [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ load(draw)$ draw3d( axis_3d = true, enhanced3d = false, surface_hide = true, zrange = [-5,5], xyplane = 0, x_voxel = 10, y_voxel=10, z_voxel=10, color = grey , implicit(Gl31,x,-5,5,y,-5,5,z,-5,5), color = blue , implicit(Gl32,x,-5,5,y,-5,5,z,-5,5), color = red , implicit(Gl33,x,-5,5,y,-5,5,z,-5,5) )$ /* [wxMaxima: input end ] */ /* [wxMaxima: subsect start ] 3. Schritt [wxMaxima: subsect end ] */ /* [wxMaxima: input start ] */ a411:a311$ a412:a312$ a413:a313$ b41:b31$ a421:a321-a331*a323/a333$ a422:a322-a332*a323/a333$ a423:a323-a333*a323/a333$ b42:b32-b33*a323/a333$ a431:a331$ a432:a332$ a433:a333$ b43:b33$ Gl41 : a411*x + a412*y + a413*z = b41; Gl42 : a421*x + a422*y + a423*z = b42; Gl43 : a431*x + a432*y + a433*z = b43; /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] Graphische Darstellung des LGS nach dem 3. Schritt des Gauss-Algorithmus [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ load(draw)$ draw3d( axis_3d = true, enhanced3d = false, surface_hide = true, zrange = [-5,5], xyplane = 0, x_voxel = 10, y_voxel=10, z_voxel=10, color = grey , implicit(Gl41,x,-5,5,y,-5,5,z,-5,5), color = blue , implicit(Gl42,x,-5,5,y,-5,5,z,-5,5), color = red , implicit(Gl43,x,-5,5,y,-5,5,z,-5,5) )$ /* [wxMaxima: input end ] */ /* [wxMaxima: subsect start ] 4. Schritt (Diagonalform) [wxMaxima: subsect end ] */ /* [wxMaxima: input start ] */ a511:a411-a421*a412/a422-a431*a413/a433$ a512:a412-a422*a412/a422-a432*a413/a433$ a513:a413-a423*a412/a422-a433*a413/a433$ b51:b41-b42*a412/a422-b43*a413/a433$ a521:a421$ a522:a422$ a523:a423$ b52:b42$ a531:a431$ a532:a432$ a533:a433$ b53:b43$ Gl51 : a511*x + a512*y + a513*z = b51; Gl52 : a521*x + a522*y + a523*z = b52; Gl53 : a531*x + a532*y + a533*z = b53; /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] Graphische Darstellung des LGS nach dem 4. Schritt des Gauss-Algorithmus [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ load(draw)$ draw3d( axis_3d = true, enhanced3d = false, surface_hide = true, zrange = [-5,5], xyplane = 0, x_voxel = 10, y_voxel=10, z_voxel=10, color = grey , implicit(Gl51,x,-5,5,y,-5,5,z,-5,5), color = blue , implicit(Gl52,x,-5,5,y,-5,5,z,-5,5), color = red , implicit(Gl53,x,-5,5,y,-5,5,z,-5,5) )$ /* [wxMaxima: input end ] */ /* [wxMaxima: section start ] Zur Kontrolle: Lösung des LGS mithilfe des solve-Befehls von Maxima [wxMaxima: section end ] */ /* [wxMaxima: input start ] */ L1 : solve([Gl11,Gl12,Gl13],[x,y,z]); /* [wxMaxima: input end ] */ /* [wxMaxima: comment start ] Eine weitere Möglichkeit besteht darin, das LGS mithilfe von Matrizenoperationen zu lösen. Dazu invertiert man die einfache Koeffizientenmatrix und multipliziert die Inverse mit dem Spaltenvektor der absoluten Glieder. [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ A1 : matrix([a111,a112,a113],[a121,a122,a123],[a131,a132,a133]); b1 : matrix([b11],[b12],[b13]); L2 : invert(A1).b1; /* [wxMaxima: input end ] */ /* Maxima can't load/batch files which end with a comment! */ "Created with wxMaxima"$