Scott Steffan Hmwk #7 11/4/99

advertisement
Scott Steffan
Hmwk #7
11/4/99
7.1.4d
The linfinity, matrix norm for the following matrix was determined using Maple V:
 4


A :=  -1


 -7
7


0


0
-1
4
4
This was done by summing the absolute values of each j of row i. The norm is the max
of this set:
A   max 1in
n
a
j 1
ij
> a[1,j]:=abs(4)+abs(-1)+abs(7);
a[1, j] := 12
> a[2,j]:=abs(-1)+abs(4)+abs(0);
a[2, j] := 5
> a[3,j]:=abs(-7)+abs(0)+abs(4);
a[3, j] := 11
A   max 12, 5,11  12
7.2.11
A.) Maple V was used to find the real eigenvalues and the associated eigenvectors of
matrix A below:





A := 





0
1
2
0
0
0
1
3
6



0



0

> evalf(Eigenvals(A,B));
[ .49999997.86602533 I, .49999997.86602533 I, .99999999 ]
> evalm(B);
-2.8739075
 5.0460023


-1.4665060
 -2.5059384


-.0056873916 .96781977
-7.7172258


-3.8586130


-1.2862038
There is one real eigenvalue:  = 1
The third column in the matrix above represents the eigenvector associated with the one
real eigenvalue. By normalizing the third portion of the vector to 1 (dividing each term
by -1.2862038), the eigenvector becomes:
(6, 3, 1)t
B.) In order to maintain a sample population of constant proportion in each group from
year to year, the initial population should be (6, 3, 1)t or any multiple of this vector.
7.3.5f
Successive Over-Relaxation was used to find the first two iterations with  = 1.1 and
x(0) = 0 for the following linear system:
4 x1 1x 2  0 x3 1x 4  0 x5  0 x6  0
 1x1  4 x 2 1x3  0 x 4 1x5  0 x6  5
0 x1 1x 2  4 x3  0 x 4  0 x5 1x6  0
 1x1  0 x 2  0 x3  4 x 4 1x5  0 x6  6
0 x1 1x 2  0 x3 1x 4  4 x5  1 x6   2
0 x1  0 x 2 1x3  0 x 4 1x5  4 x6  6
Algorithm 7.3 in Maple V was used:
> alg073();
This is the SOR Method for Linear Systems.
The array will be input from a text file in the order:
A(1,1), A(1,2), ..., A(1,n+1), A(2,1), A(2,2), ...,
A(2,n+1),
..., A(n,1), A(n,2), ..., A(n,n+1)
Place as many entries as desired on each line, but separate entries with at least one blank.
The initial approximation should follow in same format.
Input the file name in the form - drive:\name.ext
for example: A:\DATA.DTA
> c:\Numerical_Analysis\Hmwk7\735f.dta
Input the number of equations - an integer.
>6
Input the tolerance.
>1
Input maximum number of iterations.
>2
Input parameter w (omega)
> 1.1
Choice of output method:
1. Output to screen
2. Output to text file
Please enter 1 or 2.
>1
SOR ITERATIVE METHOD FOR LINEAR SYSTEMS
Two iterations of the SOR method gives the following result:
(.8318750 1.647766 .9189856 1.791281 .8712129 1.959155)t
Download