Example 3.3.3

This notebook contains a manipulation which illustrates example 3.3.3 from the text, showing how the solution to a near-parallel system of lines changes as one of the coefficients changes.  Specifically it shows the solution to the system

({{({{.23671x+y=.00633
(.23647+R)x+y=.04353}})}})

where the number R varies from 0 (representing a solution to the almost-parallel system   ({{.23671x+y=.00633, (.23647+R)x+y=.04353}}) ) to .00021.  A slider is provided to let you change the value of R over this range.  Two graphs are shown.  The left graphic shows the solution to the system when R=0 (in red) along with the solution to the system for the current value of R (in blue).  The right graphic shows you the grph of the distance between the two solutions as a function of R, along with a vertical line to display the current value of R from the slider.

SolutionPlot[r_]:= Block[{originalsolution,currentsolution,r1solution,distance,pointgraphics,errorplot, pointplot,x,y,r1},
r1solution={x,y}/. Solve[ {23671/100000x+y==633/100000,(23647/100000+r1)x+y==4353/100000},{x,y}][[1]];
originalsolution= {x,y}/.Solve[ {23671/100000x+y==633/100000,(23647/100000)x+y==4353/100000},{x,y}][[1]];
currentsolution=r1solution/. r1->r;
distance=Norm[r1solution-originalsolution];
pointgraphics=Graphics[{PointSize[.04],Red, Point[originalsolution],Blue,Point[currentsolution], Green, Line[{originalsolution, currentsolution}]}];
errorplot=Show[ Plot[ distance,{r1,0,.00021}, PlotRange-> {{0,.00021},{0,900}}, Axes->False, Frame-> True, FrameLabel-> {"R", "distance between the two solutions"}, Ticks->{.001 Range[4], 50 Range[5]}], Graphics[{Line[{{r,0},{r,900}}]}], AspectRatio->1];
pointplot=Show[pointgraphics, PlotRange->{{-1000,-150},{0,250}}, Axes->True,  AxesLabel->{x,y}, AspectRatio->1, ImageSize->250];
Return[ Show[GraphicsArray[ {{Show[pointplot, AxesOrigin->{-1000,0}],errorplot}}]]]
]

Manipulate[SolutionPlot[r],{{r,0},0,.00021,.000001}, SaveDefinitions->True]