Definition CS. Consistent System.
A system of linear equations is consistent if it has at least one solution. Otherwise, the system is called inconsistent.
.pivot()
to quickly and easily identify the pivot columns of the reduced row-echelon form of a matrix. Notice that we do not have to row-reduce the matrix first, we just ask which columns of a matrix \(A\) would be the pivot columns of the matrix \(B\) that is row-equivalent to \(A\) and in reduced row-echelon form. By Definition IDV, the indices of the pivot columns for an augmented matrix of a system of equations are the indices of the dependent variables. And the remainder are free variables. But be careful, Sage numbers columns starting from zero and mathematicians typically number variables starting from one.[,]
) create a new list. The items in the list will be values of the variable index
. range(7)
is another list, integers starting at 0
and stopping just before 7
. (While perhaps a bit odd, this works very well when we consistently start counting at zero.) So range(7)
is the list [0,1,2,3,4,5,6]
. Think of these as candidate values for index
, which are generated by for index in range(7)
. Then we test each candidate, and keep it in the new list if it is not in the list dependent
.free
, \(f\) is index
, and \(D\) is dependent
, and we make the 0/1 counting adjustments. This ability to construct sets in Sage with notation so closely mirroring the mathematics is a powerful feature worth mastering. We will use it repeatedly.consistent()
function we designed above?.pivot()
to easily identify the pivot columns of a matrix. Let us use Archetype E as an example.aug.pivots()
. Since aug
has 5 columns, the final column is numbered 4
, which is present in the list of pivot columns, as we expect.lambda
is the word that indicates we are making a new function, the input is temporarily named A
(think A
ugmented), and the name of the function is consistent
. Everything following the colon will be evaluated and reported back as the output.consistent
function will be defined and available. Now give it a try (after making sure to have run the code above that defines aug
). Note that the output of consistent()
will be either True
or False
.consistent()
command works by simply checking to see if the last column of A
is not in the list of pivots. We can now test many different augmented matrices, such as perhaps changing the vector of constants while keeping the coefficient matrix fixed. Again, make sure you execute the code above that defines coeff
and const
.A.solve_right(b)
will provide information about solutions to the linear system of equations with coefficient matrix A
and vector of constants b
. The reason for the “right” (and the corresponding command named with “left”) will have to wait for Sage MVP. For now, it is generally correct in this course to use the “right” variant of any Sage linear algebra command that has both “left” and “right” variants..solve_right()
command to a system with no solutions, in particular Archetype E. We have already seen in Sage RCLS that this system is inconsistent.matrix equation has no solutions
. We can debate whether or not this is really an error, but that is the design decision taken in Sage — we just need to be aware of it, the .solve_right()
is really only valuable when there is a solution.._solve_right_general()
and then .solve_right()
. With time and practice, these mysterious messages will become more and more helpful, so spend some time reading them in tandem with locating the real source of any problems you encounter..solve_right()
do with a system that does have solutions? Let us take a look at Example ISSI again, as we did in Sage FDV.