Example 3.3.4

This notebook contains a manipulation to illustrate Example 3.3.4 of the text.  This example explores how the solution to the system of linear equations

({{({{5x-2y+8z=15}, {-3x+9y+11z=-4}, {2x+7y+(18.7+R)z=20}})}})

changes as the value of R runs over the range -1 to 3.  We consider R=0 to be an "exact" system with an "exact" solution (({{(2947/39), (2395/39), -30}})), and nonzero values of R to have introduced an error into the system, resulting in an "approximate" solution.  The manipulation below allows you to vary the values of R from -1 to 3, and produces two graphs to illustrate what is happening.

The top graph shows the graph of the exact solution (in black) along with the graph of the approximate solution for the current value of R (in green).  To help visualize this, the solution to just the first two equations by themselves is shown as a line (in red).  The graph of just the third equation is shown as a mostly transparent plane.  The approximate solution is where the line intersects the plane. Changing the value for R changes the "tilt" of this plane slightly (you will need to change the value of R by a decent amount to see the "tilt" vary noticeably), shifting the point of intersection.  The 3-D graphic can be rotated inside the manipulation if you wish to see it from different angles.

The bottom graph is a graph of the distance between the exact solution and the approximate solution as R goes from -1 to 3.  A vertical line is placed at the current value of R to make it easier to match the top graphic with the bottom one - as the two points move apart, the value on the distance graph should become greater.

As noted in the text, the graph has a vertical asymptote at R=0.3; in the top graphic this corresponds to the tilt of the plane matching that of the line.  As the tilt gets closer and closer to a perfect match the approximate solution slides off to infinity.

Visualize334[rval_]:=
Block[{line, plane,generalsolution,point0, pointr,r,t, leftgraphic,rightgraphic,distance},
line= ParametricPlot3D[{t,(1/94) (-197+79 t),(1/94) (127-39 t)}, {t,-400,400}, PlotStyle-> {Thick, Red}];
plane=Plot3D[(20-2x-7y)/(18.7+rval), {x,-400,400},{y,-400,400}, Mesh->False, PlotStyle->Opacity[.3]];
generalsolution={-((8841-1270 r)/(39 (-3+10 r))),((5 (-1437+50 r))/(39 (-3+10 r))),(90/(-3+10 r))};
point0=generalsolution/. r->0;
pointr=generalsolution/. r->rval;
distance=Norm[generalsolution-point0];
leftgraphic=Show[line, plane, Graphics3D[ {PointSize[.03], Black, Point[point0], Green, Point[pointr]}], AxesLabel-> {"x","y","z"}];
rightgraphic=Show[Plot[distance,{r,-1,3}, PlotRange->{0,1000}, PlotLabel-> "Distance between solutions", AxesLabel->{"R"," "}], Graphics[Line[ {{rval,0},{rval,1000}}]]];
Show[GraphicsArray[{{leftgraphic},{rightgraphic}}], ImageSize->250]
];

Manipulate[Visualize334[r], {{r,-1},-1,3,.01, Appearance->"Labeled"}, SaveDefinitions->True]