An Illustrated Matrix Problem with LinMath
Below you will find a common problem and several ways of approaching it with LinMath. Throughout the execution of the program, three windows are visible on the screen – however only the one active at a particular time will be shown. You may notice slight variations in graphics across different version of LinMath - however, functionality remains the same. The Problem Linear Mathematics, 3rd edition, Stephen E. Newman, p55 problem 21 21. Solve the following system of equations x1 + x2 – 2x3 = 1 x1 + 2x2 – x3 = -1 -x1 + x2 +3x3 = 2 The Solution First, select Matrix | New Matrix. Then, in the input frame, enter the number of rows and columns you would like to have in the new matrix. Press Create when finished.
Select Matrix | New Matrix
The input frame will look like the following, use it to enter rows and columns.
If “Augment” is not selected, you will not get an augmented matrix. Press create to create.
2 Now that you’ve created a matrix, the input frame will have changed to contain a single button, and you will see a series of fields with 0.0’s. Use those fields to enter the data in the system.
The matrix window, before data is entered.
The new status of the input window.
Now, enter the data for the matrix. When you are done entering data, press the enter button on input frame. We do enter an error in row 1, column 3.
Data Entered – ignore the error for now.
Press Enter to Continue.
Now that we’ve entered our data, let’s say we notice that we entered in row one, column three, incorrectly. Do we need to restart, and go through the whole process again? No, we can simply edit the matrix and change the data. Editing a matrix is very similar to the step above. Simply select Matrix | Edit Matrix and then change whatever data you like.
The matrix, after being entered incorrectly. Select Matrix|Edit Matrix to fix.
The Action Completed state of the input frame, which it enters when needing no input.
Correct any errors you can see.
Press enter to continue, as before.
Now that we’ve fixed the error, we can go on to pivoting the matrix. Select Matrix | Pivot Matrix. Pivoting can be done graphically or by entering coordinates.
Select Matrix |Pivot Matrix After selecting Pivot Matrix, you will see a new state of the input window. Also, you will notice that if you move your cursor around the matrix, the backgrounds of the numbers changes to either red or green. Red signifies an invalid pivot, and green a valid one. Clicking on a green pivot will pivot there, but clicking on a red pivot does nothing.
The matrix window while pivoting – note the red background, because the last column of an augmented matrix is not a valid pivot column.
The input window for entering pivot positions numerically. Row 1, Column 1 is the upper left corner.
While pivoting, you may pivot as many times as you like – until you select another option from the menu, in which case you will need to select pivot again to repeat the process. Since we’re solving the system of equations, we’ll start pivoting in the upper left hand corner, by clicking on that element.
As you can see, the first element is a valid pivot point, because of the green background. Click on that item to pivot. You will see the resulting matrix from a click on the position below. Now, we will move on to pivoting by coordinates – which produces the exact same result as pivoting graphically.
The matrix, after clicking. Now, we will pivot in the first row, third column, by entering the coordinates in the input window, and pressing the pivot button.
Enter any valid set of coordinates, and press pivot to pivot – if you are pivoting
As you can see, the matrix has been pivoted on the first row, third column.
6 graphically, you can ignore this window. As you no doubt noticed, that was probably not the best place to pivot. With LinMath, we can undo that action by pressing File | Undo
Now, select File | Undo to go back to the previous matrix.
As you can see, we’re back at the matrix we were before making that ill-fated pivot. Now what about the system of equations that lies behind this matrix? If you would like to see that system of equations, select Matrix | Show Equations, and a small window will appear with the equations displayed in it. As you make changes to the matrix, this window will be updated.
The Matrix menu, with Show Equations Selected.
7 The equation screen, which will be updated as the matrix changes.
Continue pivoting until the matrix is in a reduced form. In a conservation effort, screen shots of this process will not be provided here. You’ll notice that the equation frame is updated as you pivot. Now that we’re at an answer, it would be nice to check the solution to the original matrix as automatically solved by the program. We can restore the original matrix, prior to any changes, by selecting File | Restore Original. Note, however, that this includes the edit we performed in order to match the matrix in the book. If you performed this edit, you will need to perform it again. After selecting restore original, that process is exactly the same as it was above, and is therefore not repeated here. Please refer to the section above for screenshots and detailed instructions on editing.
Select File | Restore Original to go back to the start
The equations for the reduced matrix.
Now that we are back to the original matrix, select Matrix | Solve | Solve Automatic to view the automatic solution. Remember to repeat the edit you performed earlier, because otherwise you will get a different answer. The other option, Reduce Matrix, is exactly the same as Solve Automatic, but the results are not reported. You will notice that the equation frame for the reduced matrix and the results reported by the automatic solve are very similar, the only difference being that automatic solve gives the type of solution.
The matrix, restored to the original, and edited to remove the error. Note – This matrix has been edited to correct the error, exactly as was done above.
Select Solve, Automatic Solve to solve the matrix automatically.
Throughout this tutorial, you may have noticed that next to menu items you will often see Ctrl+Letter. This is called a hotkey, a method for the user to access a menu item through the keyboard. For example, you may pivot by holding down the control key and pressing p. For more information about hotkeys, and a list, see the Hotkey appendix, or look at the menus during program execution – any hotkey available is listed to the right of the menu item, and does the exact same thing as selecting that menu item.
The reduced matrix, after automatic solve has been executed.
The solution to the matrix, and the type of that solution.
This is only one of the many things you can do with LinMath, however most of the functions are used similarly. One important feature of LinMath, not discussed in this text, is the dynamic help frame. This frame, found in the lower right hand corner of the screen offers feedback throughout the execution of the program. For example, in the screen shot below, instructions are given for how to pivot. The contents of this window change throughout the execution of the program, similar to the manner in which the contents of the input frame change.
The Help Frame, for a pivot. Now that we’re done working with LinMath for the day, press File | Exit.