The conjugate_gradient command uses the conjugate gradient algorithm to solve a linear system of equations.
We can solve the system {
2x+y=1 |
x+5y=0 |
by entering one of the following commandlines.
conjugate_gradient([[2,1],[1,5]],[1,0]) |
|
conjugate_gradient([[2,1],[1,5]],[1,0],[0.55,-0.11],1e-2) |
|
conjugate_gradient([[2,1],[1,5]],[1,0],[0.55,-0.11],1e-10) |
|