tools for exploring linear systems
what is a System of linear equations
takes systems of linear equations in augmented matrix notation and find if the systems have: no solution, one solution, infinite solutions. if there is a solution defines it.
##find if the systems has: no solution, one solution, infinite solutions
what is a solving a system of linear equationsof linear equations
- (switch) switch 2 rows positions
- (scaling) multiply every entry in a row by a non-zero constant
- (rowReplacement) replace a row with its sum and a multiple of a different row and a non-zero constant
const intObject = [
[2,3,0,5],
[0,0,1,20],
[0,-2,0,5]
]
const solution = LinearSystemSolution(intObject);
return a description of the systems solution (or lack of one)
initializeSystem
- the left most non-zero column is the pivot column
- the top row position of the pivot column is the pivot row
foreach row: a. partialPivoting on the pivotColumn - largest to top b. zeroAllRowsUnderThePevot() - row replacement operations to "zero" all entry under the pivot c. pivot.row++, pivot.column++ 3. foreach row: a. zeroAllRowsAboveThePivot(), scalePivotToOne b. pivot.row--, pivot--
switchRows(system, rowNumberOne, rowNumberTwo) exchange the location of 2 rows
scaling(system, rowNumber, scaleNumber) scales all entries in row by a non-zero number
rowReplacement(system, rowToBeReplaced, differentRowNumber, scaleNumberForOtherRow) replaces the row in rowToBeReplaced with the the product of the row in differentRowNumber and scaleNumberForOtherRow
iterate over all entries below the pivot, use rowReplacementRemover on each
iterate over all entries above the pivot, use rowReplacementRemover on each
zeros out the entry using rowReplacement and the pivot
uses scaling on the row of pivot to scale the entry in the pivot position to 1
rearranges rows to move the largest absolute value to the top of the column row to the top. this is sometimes called partial pivoting
returns a bool indicating if the matrix is in echelon form
returns a bool indicating if the matrix is in reduced echelon form
after solved a nice chart to look at if, low enough number of dimensions
ui element that shows system and animates switching, adding, scaling
find cases that are easy examples where skipping one or more steps doesn't affect the solution or an approximation of it
many checks for non-zero numbers in code check like:
Math.abs(x) > 0
could also be
!isNaN(parseFloat(num)) && isFinite(num);
not sure how or if linear algebra handle infinite, or how could relate to the js version of infinity
there are many ways, check them out...... If you want me to list resources make an issue