100% found this document useful (1 vote)
536 views38 pages

SciLab Manual - UE18MA251 PDF

This document provides a Scilab manual for a linear algebra course. It outlines 9 classes covering topics such as Gaussian elimination, LU decomposition, inverse matrices, eigenvectors and eigenvalues, and the power method. It includes example problems and solutions for each topic. The manual was compiled by an associate professor to aid students in learning linear algebra concepts using the Scilab programming language.

Uploaded by

Darshan H M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
536 views38 pages

SciLab Manual - UE18MA251 PDF

This document provides a Scilab manual for a linear algebra course. It outlines 9 classes covering topics such as Gaussian elimination, LU decomposition, inverse matrices, eigenvectors and eigenvalues, and the power method. It includes example problems and solutions for each topic. The manual was compiled by an associate professor to aid students in learning linear algebra concepts using the Scilab programming language.

Uploaded by

Darshan H M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

DEPARTMENT OF SCIENCE & HUMANITIES

SCILAB MANUAL
LINEAR ALGEBRA- UE18MA251
IV Semester - B. Tech
January-May 2020

Compiled by

Mrs. GEETHA SHANKAR


Associate Professor in Mathematics
Department of Science & Humanities
PES University, RR Campus
Bangalore

1
Contents
SCILAB SYLLABUS ......................................................................................5
ABOUT SCILAB.............................................................................................6
Overview of Scilab .......................................................................................6
How to get and install Scilab........................................................................7
The general environment and the console....................................................7
The graphics window ...................................................................................9
Programming ................................................................................................9
Variables, assignment and display .............................................................10
CLASS NUMBER - 1 ....................................................................................14
Topic: Gaussian Elimination ......................................................................14
Practice Problems .......................................................................................16
CLASS NUMBER - 2 ....................................................................................17
Topic: LU decomposition of a matrix ........................................................17
Practice Problems .......................................................................................19
CLASS NUMBER – 3 ...................................................................................20
Topic: The Gauss - Jordan method of calculating A-1 ..............................20
Practice Problems: ......................................................................................22
CLASS NUMBER – 4 ...................................................................................23
Topic: Span of the Column Space of A .....................................................23
Practice Problems: ......................................................................................24
CLASS NUMBER –5 ....................................................................................25
Topic: The Four Fundamental Subspaces ..................................................25
Practice Problems: ......................................................................................27
CLASS NUMBER - 6 ....................................................................................28
Topic: Projections by Least Squares ..........................................................28

2
Practice Problems: ......................................................................................29
CLASS NUMBER -7 .....................................................................................30
Topic: The Gram- Schmidt Orthogonalization ..........................................30
Practice Problems: ......................................................................................31
CLASS NUMBER - 8 ....................................................................................32
Topic: Eigen values and Eigen vectors of a given square matrix ..............32
Practice Problems: ......................................................................................33
CLASS NUMBER - 9 ....................................................................................34
Topic: Numerically Largest Eigen value of A - The Power Method ........34
Practice Problems: ......................................................................................37

3
Table of Figures
Figure I - Gaussian Elimination - Example 1................................................................ 14
Figure II - Gaussian Elimination – Output 1 ................................................................. 15
Figure III - Gaussian Elimination - Example 2 ............................................................. 15
Figure IV - Gaussian Elimination - Output 2 ................................................................ 16
Figure V - LU decomposition of a matrix - Example 3 ................................................ 17
Figure VI - LU decomposition of a matrix - Output 3 .................................................. 18
Figure VII - LU decomposition of a matrix - Example 4 ............................................. 18
Figure VIII - LU decomposition of a matrix - Output 4 ............................................... 19
Figure IX - The Gauss - Jordan method of calculating A-1- Example 5 ....................... 20
Figure X - The Gauss - Jordan method of calculating A-1- Output 5 ............................ 21
Figure XI - The Gauss - Jordan method of calculating A-1- Example 5A .................... 21
Figure XII - The Gauss - Jordan method of calculating A-1- Output 5A ..................... 22
Figure XIII - Span of the Column Space of A - Example 6.......................................... 23
Figure XIV - Span of the Column Space of A - Output 6............................................. 24
Figure XV - The Four Fundamental Subspaces - Example 7 ....................................... 25
Figure XVI - The Four Fundamental Subspaces - Output 7 - 1 .................................... 26
Figure XVII - The Four Fundamental Subspaces - Output 7 - 2 .................................. 26
Figure XVIII - Projections by Least Squares - Example 8 ........................................... 28
Figure XIX - Projections by Least Squares - Output 8 ................................................. 29
Figure XX - The Gram- Schmidt Orthogonalization - Example 9................................ 30
Figure XXI - The Gram- Schmidt Orthogonalization - Output 9 ................................. 31
Figure XXII - Eigen values and Eigen vectors of a given square matrix - Example 10
....................................................................................................................................... 32
Figure XXIII - Eigen values and Eigen vectors of a given square matrix - Output 10 33
Figure XXIV - Numerically Largest Eigen value of A - The Power Method - Example
11 ................................................................................................................................... 34
Figure XXV - Numerically Largest Eigen value of A - The Power Method - Output 11
- 1................................................................................................................................... 35
Figure XXVI - Numerically Largest Eigen value of A - The Power Method - Output
11 - 2.............................................................................................................................. 36
Figure XXVII - Numerically Largest Eigen value of A - The Power Method - Output
11 – 3 ............................................................................................................................. 37

4
SCILAB SYLLABUS
Gaussian Elimination , The LU Decomposition, Inverse of a Matrix by the Gauss-
Jordan Method, The Span of Column Space of a Matrix, The Four Fundamental
Subspaces, Projections by Least Squares, The Gram-Schmidt Orthogonalization, Eigen
values and Eigen Vectors of a Matrix, The Largest Eigen Value of a Matrix by the Power
Method.

Lesson Plan:

Class Number Topic

1 Gaussian Elimination

2 The LU Decomposition

3 Inverse of a Matrix by the Gauss- Jordan Method

4 The Span of Column Space of a Matrix

5 The Four Fundamental Subspaces

6 Projections by Least Squares

7 The Gram-Schmidt Orthogonalization

8 Eigen values and Eigen Vectors of a Matrix

9 The Largest Eigen Value of a Matrix by the Power Method

10-11 In Semester Assessment

5
ABOUT SCILAB

Overview of Scilab

Scilab is a programming language associated with a rich collection of numerical


algorithms covering many aspects of scientific computing problems. From the software
point of view, Scilab is an interpreted language. This generally allows to get faster
development processes, because the user directly accesses a high-level language, with
a rich set of features provided by the library. The Scilab language is meant to be
extended so that user-defined data types can be defined with possibly overloaded
operations. Scilab users can develop their own modules so that they can solve their
particular problems. The Scilab language allows to dynamically compile and link other
languages such as Fortran and C: this way, external libraries can be used as if they were
a part of Scilab built-in features. Scilab also interfaces LabVIEW, a platform and
development environment for a visual programming language from National
Instruments. From the license point of view, Scilab is a free software in the sense that
the user does not pay for it and Scilab is an open source software, provided under the
Cecill license. The software is distributed with source code, so that the user has an access
to Scilab’s most internal aspects. Most of the time, the user downloads and installs a
binary version of Scilab, since the Scilab consortium provides Windows, Linux and Mac
OS executable versions. Online help is provided in many local languages. From the
scientific point of view, Scilab comes with many features. At the very beginning of
Scilab, features were focused on linear algebra. But, rapidly, the number of features
extended to cover many areas of scientific computing.
The following is a short list of its capabilities:
• Linear algebra, sparse matrices
• Polynomials and rational functions
• Interpolation, approximation
• Linear, quadratic and non-linear optimization
• Ordinary Differential Equation solver and Differential Algebraic Equations solver
• Classic and robust control, Linear Matrix Inequality optimization
• Differentiable and non-differentiable optimization
• Signal processing
• Statistics
6
Scilab provides many graphics features including a set of plotting functions which allow
us to create 2D and 3D plots as well as user interfaces. The Xcos environment provides
a hybrid dynamic systems modeler and simulator.
How to get and install Scilab
Whatever the platform is (i.e. Windows, Linux or Mac), Scilab binaries can be
downloaded directly from the Scilab homepage http://www.scilab.org or from the
Download area http://www.scilab.org/download. Scilab binaries are provided for both
32 and 64-bit platforms so that they match the target installation machine. Scilab can
also be downloaded in source form, so that we can compile Scilab by ourselves and
produce our own binary. Compiling Scilab and generating a binary is especially
interesting when we want to understand or debug an existing feature, or when we want
to add a new feature. To compile Scilab, some prerequisites binary files are necessary,
which are also provided in the Download center. Moreover, a Fortran and a C compiler
are required.

Become familiar with Scilab

The useful workspace in Scilab consists of several window:

 The console for making calculations


 The editor for writing programs
 The graphics windows for displaying graphics
 The embedded help

The general environment and the console


After double clicking the icon to launch Scilab, the Scilab environment by default
consists of the following docked windows: The console, files and variables browsers
and the command history. In the console, after the prompt

-->

Just type a command and press the Enter key (Windows and Linux) or the Return key
(Mac OS X) in the keyboard to obtain the corresponding result.

7
The menu bar
The menus listed below are particularly useful.

Applications

• The command history allows us to find all the commands from previous
sessions to the current session.
• The variables browser allows us to find all variables previously used during
the current session.

Edit
Preferences (in Scilab menu under Mac OS X) allows us to set and customize colours,
fonts and font size in the console and in the editor, which is very useful for screen
projection. Clicking on Clear Console clears the entire content of the console. In this
case, the command history is still available and calculations made during the session
remain in memory. Commands that have been erased are still available through the
keyboard’s arrow keys.

The Editor

Typing directly into the console has two disadvantages: it is not possible to save the
commands and it is not easy to edit multiple lines of instruction. The editor is the
appropriate tool to run multiple instructions.

Opening the Editor

To open the editor from the console, click on the first icon in the toolbar or on
Applications  SciNotes in the menu bar. The editor opens with a default file named
“Untitled 1 “.

Saving

Any file can be saved by clicking on File  Save as

The extension “.sce “at the end of a file name will launch automatically Scilab when
opening it (except under Linux and Mac OS X).

Copying into the console, executing a program

In clicking on Execute in the menu bar, three options are available:

8
• Execute “…file with no echo “(Ctrl+Shift+E under Windows and Linux, Cmd+Shift+
E under Mac OS X): the file is executed without writing the program in the console
(saving the file first is mandatory).

• Execute “… file with echo “(Ctrl+L under Windows and Linux, Cmd+L under Mac
OS X): rewrites the file into the console and executes it.

• Execute “…until the caret, with echo “(Ctrl+E under Windows and Linux, Cmd+E
under Mac OS X): rewrites the selection chosen with the mouse into the console and
executes it or executes the file data until the caret position defined by the user.
Standard copy/paste can also be used.

The graphics window


Opening a graphics window

A graphics window opens automatically when making any plot. It is possible to plot
curves, surfaces and sequences of points.

Online help

To access the online help, click on ? Scilab Help in the menu bar, or type in the
console:

 help

To get help with any function, type help in the console followed by the name of the
appropriate function. For example:

 help sin

displays help for sine function.

Programming
In the examples given in this manual, any line preceded by “ --> “ is a command, the
other lines are the returns from commands (calculation results, error messages…). Do
not write “ --> “ in the editor. They are introduced here to make the distinction between
command lines and calculation results as it is displayed in the console after
copying/pasting. When presented in a table (without “ > “ and no calculation result), the
commands are depicted exactly as they should be typed in the editor.

9
Variables, assignment and display
Variables

Scilab is not a computer algebra system. It calculates only with numbers. All
calculations are done with matrices, although this may go unnoticed. Even if the concept
of matrices is unknown, vectors and sequences of numbers can explain it, as they are,
in fact, matrices of dimension 1 × nor n × 1 and a number is itself a matrix of dimension
1 × 1. Variables do not need to be declared in advance, but any variable must have a
value. For example, obtaining the value of a variable which has not been given a value
produces an error.

-->a
! --error 4
Undefined variable: a
If a value is assigned to the variable a, there is no longer an error:
--> a=%pi/4
a=
0.7853982
--> a
a=
0.7853982
Variables may take any name that is not already defined by the system:
--> Piby2=%pi/2
Piby2 =
1.5707963
The result of a calculation that is not assigned to a variable is automatically assigned
to the variable called ans:
-->3*(4-2)
ans =
6.
-->ans
ans =
6.

10
Functions
Functions are the easiest and most natural way to make computations from variables a
nd for obtaining results from variables.
A function definition begins with function and ends with endfunction.
Requesting the assignment of a variable
Assignment is made easily using the “= “operator.

Display
Writing
Typing the name of a variable displays its value, except when there is “; “at the end of
the command line.
Brackets
Matrices are defined using square brackets.
As mentioned before, matrix computation is the basis of calculations in Scilab. A spac
e or comma is used to separate columns and semicolons are used to separate rows.
To define a column vector and obtain a column display:
-->v=[3;-2;5]
v=
3.
- 2.
5.
To define a row vector and obtain a row display:
--> v = [3,-2,5]
v=
3. - 2. 5.
To define a matrix and obtain a tabular display:
--> m = [1 2 3;4 5 6;7 8 9]
m=
1. 2. 3.
4. 5. 6.
7. 8. 9.

11
disp function

The disp must always be used with parentheses. With the vector v previously defined:
-->v(2)
ans =
- 2.
-->disp(v(2))
- 2.
To display a string (usually a sentence), put it between quotes:
-->disp("The solution is") will display the following
The solution is

Additional information on matrices and vectors

Accessing elements

Square braces are used to define matrices. A space or a comma is used to switch from
one column to another and semicolons are used to switch from one line to another.
-->m= [1 2 3;4 5 6]
m=
1. 2. 3.
4. 5. 6.
Parentheses are used to access elements or to modify them.
-->m(2,3)
ans =
6.
-->m(2,3)=23
m =
1. 2. 3.
4. 5. 23.
The “ : “ operator is used to designate all the rows or all columns of a matrix.
To view the second row of the matrix m, type:
-->m(2,:)
ans =
4. 5. 23.
To view the third column:
-->m(:,3)
ans =
3.
23.

12
To obtain the transpose of a matrix or a vector use the single quote symbol “ ' “:
-->m'
ans =
1. 4.
2. 5.
3. 23.

Operations

The operations * “, “/ “are matrix operations. To make element wise operations, we


need to put dot before the operating sign: “.* “, “. / “.

Solving linear systems

To solve the linear system AX = Y, in which A is a square matrix, use the backslash
“\ “
X = A \ Y.
Be cautious, the operation Y / A will give
(only if the dimensions are correct) another result, that is to say the matrix Z for which
Z A = Y.

Length

The length function returns the number of coordinates for a vector. The size function
returns the dimensions (rows, columns) for a matrix.
-->U=[1:10]
U=
1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
-->length(U)
ans =
10.
-->m=[1 2 3;4 5 6];
-->size(U)
ans =
2. 3.

13
CLASS NUMBER - 1
Topic: Gaussian Elimination
Procedure: Given a system of n equations in n unknowns we use the method of
pivoting to solve for the unknowns. The method starts by subtracting multiples of the
first equation from the other equations. The aim is to eliminate the first unknown from
the second equation onwards. We use the coefficient of the first unknown in the first
equation as the first pivot to achieve this. At the end of the first stage of elimination,
there will be a column of zeros below the first pivot. Next, the pivot for the second stage
of elimination is located in the second row second column of the system. A multiple of
the second equation will now be subtracted from the remaining equations using the
second pivot to create zeros just below it in that column. The process is continued until
the system is reduced to an upper triangular one. The system can now be solved
backward bottom to top.

Example 1: Solve the system of equations 2x + 4y + 6z = 14, 3x -2 y + z = -3 and


4x + 2y – z = -4 using Gaussian Elimination. Also, identify the pivots.

Solution:

Figure I - Gaussian Elimination - Example 1

14
Output:

Figure II - Gaussian Elimination – Output 1

Example 2: Solve the system of equations 2x + 3y –z = 5, 4x + 4y -3 z = 3 and


-2x + 3y –z = 1 by Gaussian Elimination.
Solution:

Figure III - Gaussian Elimination - Example 2

15
Output:

Figure IV - Gaussian Elimination - Output 2

Practice Problems
Solve the following system of equations by Gaussian Elimination. Identify the pivots
in each case.

1. 2x + 5y + z = 0 , 4x + 8y + z = 2, y –z = 3
2. 2x + 3y + z = 8 , 4x + 7y + 5z = 20, -2y + 2z = 0
3. 2x – 3y = 3, 4x – 5y + z = 7, 2x – y – 3z = 5.

16
CLASS NUMBER - 2
Topic: LU decomposition of a matrix
Procedure: Given a square matrix A, we can factorize A as a product of two matrices
L and U. The matrix U is upper triangular with pivots on the main diagonal and the
matrix L is lower triangular with 1’s on the main diagonal and the multipliers in their
respective positions. The factorization is carried out using the method of Gaussian
Elimination.

Example 3: Find the triangular factors L and U for the matrix A =


 3  0.1  0.2 
 
 0.1 7  0.3 
 0.3  0.2 10 
 

Solution:

Figure V - LU decomposition of a matrix - Example 3

17
Output:

Figure VI - LU decomposition of a matrix - Output 3

Example 4: Solve the system of equations 4x -2 y + 2z = 6, 4x -3 y -2 z = -8 and


2x + 3y –z = 5 by LU decomposition.
Solution:

Figure VII - LU decomposition of a matrix - Example 4

18
Output:

Figure VIII - LU decomposition of a matrix - Output 4

Practice Problems
1. Factorize the following matrices as A = LU
 2 3 1   2 3 0 
   
i) A= 4 7 5  ii) A= 4 5 1 
1 2 2  2 1  3 
  

2. Solve the system of equations by decomposing A as a product A = LU


i) 2x + 3y + z = 8 , 4x + 7y + 5z = 20, -2y + 2z = 0
ii) 2x – 3y = 3, 4x – 5y + z = 7, 2x – y – 3z = 5.

19
CLASS NUMBER – 3
Topic: The Gauss - Jordan method of calculating A-1
Procedure: To find the inverse of a non-singular matrix A, we begin with an
augmented system [ A I ] where I is an identity matrix of the size same as that of A
and reduce A to an upper triangular system by Gaussian Elimination. The system is
further reduced to a diagonal one with pivots on the main diagonal and finally to
[ I A-1 ].

1 1 1 
 
Example 5: Find the inverse of the matrix A =  4 3  1 

 3 5 3 


by Gauss – Jordan method.

Solution:


Figure IX - The Gauss - Jordan method of calculating A-1- Example 5

20
Output:

Figure X - The Gauss - Jordan method of calculating A-1- Output 5

Alternate Solution:

Figure XI - The Gauss - Jordan method of calculating A-1- Example 5A

21
Output:

Figure XII - The Gauss - Jordan method of calculating A-1- Output 5A

Practice Problems:
1. Find the inverse of the following matrices:

1 0 0   2 1 0   0 0 1 
     
1 1 1   1 2  1   0 1 1 
     
0 0 1   0 1 2 1 1 1 

22
CLASS NUMBER – 4
Topic: Span of the Column Space of A
Procedure: Given a matrix A, we reduce it to an upper triangular form using Gaussian
Elimination. The columns that contain the pivots span the column space of A.

Example 6: Identify the columns that are in the column space of A where
 4 5 9  2 
 
A =  6 5 1 12 
 3
 4 8  3 

Solution:

Figure XIII - Span of the Column Space of A - Example 6

23
Output:

Figure XIV - Span of the Column Space of A - Output 6

Practice Problems:
Identify the columns that span the column space of A in the following cases.
 1 3 3 2 
 
1. A =  2 6 9 7 
  1 3 4 
 3 

 2 4 6 4 
 

2. A = 2 5 7 6 
 2 
 2 3 5 

24
CLASS NUMBER –5
Topic: The Four Fundamental Subspaces
Procedure: Given a matrix A, we reduce it to row reduced form and find its rank by
identifying the columns that contain the pivots. We then find the four fundamental
subspaces viz, the column space C(A), the row space C(AT), the null space N(A) and
the left null space N(AT).

 0 1 0 
 
Example 7: Find the four fundamental subspaces of A =  0 0 1 
 1 
 0 0


Solution:

Figure XV - The Four Fundamental Subspaces - Example 7

25
Output:

Figure XVI - The Four Fundamental Subspaces - Output 7 - 1

Figure XVII - The Four Fundamental Subspaces - Output 7 - 2

26
Practice Problems:
1 2 0 1 
 
1. Find the four fundamental subspaces of A =  0 1 1 0 

1 2 0 1 



 1 3 3 2 
2. Find the four fundamental subspaces of A =  2 6 9 7 
 4 
 1 3 3

27
CLASS NUMBER - 6
Topic: Projections by Least Squares
Procedure: Suppose we do a series of experiments and expect the output b to be a linear
function of the input t. We look for a straight line b = C + Dt. If there are experimental
errors then we have a system of equations

C + Dt1 = b1

C + Dt2 = b2 and so on.

That is, we have the system of equations Ax = b. The best solution is obtained by
minimizing the error
2
E 2  b  Ax  (b1  C  Dt1)2  (b2  C  Dt2 )2  ....  (bm  C  Dtm )2

Example 8: Find the solution x = ( C , D ) of the system Ax = b and the line of best
1  1 
fit C + Dt = b given 
 1

1  , b = ( 1, 1, 3 ).
A =  1 2 

Solution:

Figure XVIII - Projections by Least Squares - Example 8

28
Output:

Figure XIX - Projections by Least Squares - Output 8

Practice Problems:
1. Solve Ax = b by least squares where
1 0   1 
   
A=  0 1,b= 1 
   
1 1   0 

2. Find the line of best fit for the following system


1  1   4 
   C   
A x = 1 0    = b =  5 
  D   
 1 1 
  9 

3. Find the best straight line fit given b = ( 4, 3, 1, 0 ) at t = - 2 , - 1 , 0, 2.

4. Find a linear relationship between b and t that suits the following data the best:

b  2, 0,  3,  5 at t = - 1 , 0, 1 , 2.
29
CLASS NUMBER -7
Topic: The Gram- Schmidt Orthogonalization
Procedure: Given a set of mutually independent vectors, we produce a set of
orthonormal vectors by applying the Gram – Schmidt process.

Example 9: Apply the Gram – Schmidt process to the vectors ( 1, 0, 1 ) , ( 1, 0, 0, )


and ( 2, 1, 0 ) to produce a set of orthonormal vectors.

Solution:

Figure XX - The Gram- Schmidt Orthogonalization - Example 9

30
Output:

Figure XXI - The Gram- Schmidt Orthogonalization - Output 9

Practice Problems:
Apply the Gram – Schmidt process to the following set of vectors and find the
orthogonal matrix:
1. ( 1, 1, 0 ) , ( 1, 0, 1 ) , ( 0, 1, 1 )

2. ( 0, 0, 1 ) , ( 0, 1, 1 ) , ( 1, 1, 1 )

3. ( 1, 0, 1 ) , ( 1, 1, 0 ) , ( 2, 1, 1 )

31
CLASS NUMBER - 8
Topic: Eigen values and Eigen vectors of a given square matrix
Procedure: Given a square matrix A, we find the characteristic polynomial of A by
expanding the matrix equation | A – λ I |. The Eigen values of A are obtained solving
the characteristic equation | A – λ I | = 0. The corresponding Eigen vectors are
obtained by solving the system of equations Ax = λx.

Example 10: Find the Eigen values and the corresponding Eigen vectors of
 3 2 5 
 
A = 2 3 6 
 
 
 5 6 4 

Solution:

Figure XXII - Eigen values and Eigen vectors of a given square matrix - Example 10

32
Output:

Figure XXIII - Eigen values and Eigen vectors of a given square matrix - Output 10

Practice Problems:
Find the Eigen values and the corresponding Eigen vectors of the following matrices:

6 2  6 2  1 
1.    5   2 
8 2

  6 7  4   6 4  4   1
 3 1 
 2  2.   3.  
 4 3   2 4 0   1 2 2 

33
CLASS NUMBER - 9
Topic: Numerically Largest Eigen value of A - The Power Method
Procedure: Given a square matrix A and an initial vector x0, to find the numerically
largest Eigen value of A, we compute the product Ax0 and rewrite it in the form λ1 x1
where λ1 is the first approximation to the numerically largest Eigen value λ and x1 is the
corresponding Eigen vector which is the first approximation to the actual Eigen vector.
We then find Ax1 and rewrite it in the form λ2x2. This process is continued until we get
the two successive values of λ to be nearly the same.
 3 0 1 
 
Example 11: Find the largest Eigen value of A =  2 2 2  starting with an
 4 
 2 5 
initial approximation x = [ 1 1 1]T

Solution:


Figure XXIV - Numerically Largest Eigen value of A - The Power Method - Example 11

34
Output:

Figure XXV - Numerically Largest Eigen value of A - The Power Method - Output 11 - 1

35
Figure XXVI - Numerically Largest Eigen value of A - The Power Method - Output 11 - 2

36
Figure XXVII - Numerically Largest Eigen value of A - The Power Method - Output 11 – 3

Practice Problems:
Use the power method to compute the largest Eigen value and the corresponding
Eigen vector of the following matrices:

1 3 2 
1.  4 4  1  , x0 = ( 1, 0, 0 )

6 3 5 

1 6 1 

2. 1 2 0  , x0 = ( 1, 0, 0 )
0 0 3 

37
38

You might also like