06.09.2021 Views

Linear Algebra, 2020a

Linear Algebra, 2020a

Linear Algebra, 2020a

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Topic<br />

Computer <strong>Algebra</strong> Systems<br />

The linear systems in this chapter are small enough that their solution by hand<br />

is easy. For large systems, including those involving thousands of equations,<br />

we need a computer. There are special purpose programs such as LINPACK<br />

for this. Also popular are general purpose computer algebra systems including<br />

Maple, Mathematica, orMATLAB, and Sage.<br />

For example, in the Topic on Networks, we need to solve this.<br />

i 0 − i 1 − i 2 = 0<br />

i 1 − i 3 − i 5 = 0<br />

i 2 − i 4 + i 5 = 0<br />

i 3 + i 4 − i 6 = 0<br />

5i 1 + 10i 3 = 10<br />

2i 2 + 4i 4 = 10<br />

5i 1 − 2i 2 + 50i 5 = 0<br />

Doing this by hand would take time and be error-prone. A computer is better.<br />

Here is that system solved with Sage. (There are many ways to do this; the<br />

one here has the advantage of simplicity.)<br />

sage: var('i0,i1,i2,i3,i4,i5,i6')<br />

(i0, i1, i2, i3, i4, i5, i6)<br />

sage: network_system=[i0-i1-i2==0, i1-i3-i5==0,<br />

....: i2-i4+i5==0, i3+i4-i6==0, 5*i1+10*i3==10,<br />

....: 2*i2+4*i4==10, 5*i1-2*i2+50*i5==0]<br />

sage: solve(network_system, i0,i1,i2,i3,i4,i5,i6)<br />

[[i0 == (7/3), i1 == (2/3), i2 == (5/3), i3 == (2/3),<br />

i4 == (5/3), i5 == 0, i6 == (7/3)]]<br />

Magic.<br />

Here is the same system solved under Maple. We enter the array of coefficients<br />

and the vector of constants, and then we get the solution.<br />

> A:=array( [[1,-1,-1,0,0,0,0],<br />

[0,1,0,-1,0,-1,0],<br />

[0,0,1,0,-1,1,0],<br />

[0,0,0,1,1,0,-1],<br />

[0,5,0,10,0,0,0],

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!