Professional Documents
Culture Documents
1. Student is aware
with requirement Set (P2) 3
and use of apparatus
involved in Experiment.
Psychomotor
2. Student has conducted the
experiment by practicing 70%
the hands-on skills as per
Instructions. Guided Response 11
3. Student has achieved (P3)
required accuracy in
performance.
Total 20
Page 1 of 15
EXPERIMENT # 3
Objective:
1. To be familiar with Matrix Partitioning with insight about Partitioned (Block) Matrix
appearance in most modern applications of Linear Algebra such as Computational Fluid
Dynamics (CFD), Mathematical Modeling of Physical systems and Matrix calculations of
High-speed Computers.
2. To be familiar with basics of Matrix Partitioning with MATLAB.
Theory:
A key feature of work on matrices has been the ability to regard a matrix A as a list of column
vectors rather than just a rectangular array of numbers. This point of view has been so useful
that we wish to consider other partitions of A, indicated by horizontal and vertical dividing
rules, as in Example 1 below.
In Linear algebra, a block matrix or a partitioned matrix is a matrix that is interpreted as having
been broken into sections called blocks or submatrices. Intuitively, a matrix interpreted as a
block matrix can be visualized as the original matrix with a collection of horizontal and vertical
lines, which break it up, or partition it, into a collection of smaller matrices. Any matrix may
be interpreted as a block matrix in one or more ways, with each interpretation defined by how
its rows and columns are partitioned.
1.1 Example 1:
The Matrix
1.2 Applications:
Partitioned matrices appear in most modern applications of linear algebra because the
notation highlights essential structures in matrix analysis, as in the application of
partitioned matrix on aircraft design given below.
Page 2 of 15
1.2.1 Computers Model in Aircraft Design /Computational Fluid Dynamics
(CFD):
To design the next generation of commercial and military aircraft, engineers at
Boeing’s Phantom Works use 3D modeling and computational fluid dynamics
(CFD). They study the airflow around a virtual airplane to answer important design
questions before physical models are created. This has drastically reduced design
cycle times and cost—and linear algebra plays a crucial role in the process.
The virtual airplane begins as a mathematical “wireframe” model that exists only
in computer memory and on graphics display terminals. (Model of a Boeing 777 is
shown.) This mathematical model organizes and influences each step of the design
and manufacture of the airplane— both the exterior and interior. The CFD analysis
concerns the exterior surface.
Although the finished skin of a plane may seem smooth, the geometry of the surface
is complicated. In addition to wings and a fuselage, an aircraft has nacelles,
stabilizers, slats, flaps, and ailerons. The way air flows around these structures
determines how the plane moves through the sky. Equations that describe the
airflow are complicated, and they must account for engine intake, engine exhaust,
and the wakes left by the wings of the plane. To study the airflow, engineers need
a highly refined description of the plane’s surface.
The process for finding the airflow around the plane involves repeatedly solving a
system of linear equations Ax=b that may involve up to 2 million equations and
variables. The vector b changes each time, based on data from the grid and solutions
of previous equations. Using the fastest computers available commercially, a
Phantom Works team can spend from a few hours to several days setting up and
solving a single airflow problem. After the team analyzes the solution, they may
make small changes to the airplane surface and begin the whole process again.
Thousands of CFD runs may be required.
The Applied Linear Algebra (ALA) lab presents two important concepts that assist
in the solution of such massive systems of equations:
Page 3 of 15
Matrix factorizations: Even when written with partitioned matrices, the system of
equations is complicated. To further simplify the computations, the CFD software
at Boeing uses what is called an LU factorization of the coefficient matrix. Next
Lab discusses LU and other useful matrix factorizations.
Page 4 of 15
and column sums using ‘B=magic(3)’. Another example is a 3-by-2 rectangular matrix
of random integers using ‘C=randi(10,3,2)’; In this case the first input to randi describes
the range of possible values for the integers, and the second two inputs describe the
number of rows and columns.
A column vector is an m-by-1 matrix, a row vector is a 1-by-n matrix, and a scalar is a
1-by-1 matrix. To define a matrix manually, use square brackets [ ] to denote the
beginning and end of the array. Within the brackets, use a semicolon ; to denote the end
of a row. In the case of a scalar (1-by-1 matrix), the brackets are not required. For
example, these statements produce a column vector, a row vector, and a scalar:
U = [3; 1; 4]
V=[2 0 -1] or [2, 0, -1]
S= 7
Note: Addition and subtraction require both matrices to have compatible dimensions.
If the dimensions are incompatible, an error results.
3. A row vector and a column vector of the same length can be multiplied in either
order. The result is either a scalar, called the inner product, or a matrix, called the
outer product:
Page 5 of 15
MATLAB uses the apostrophe operator (') to perform a complex conjugate transpose,
and the dot-apostrophe operator (.') to transpose without conjugation. For matrices
containing all real elements, the two operators return the same result.
The example matrix A = pascal(3) is symmetric, so A' is equal to A. However, B =
magic(3) is not symmetric, so B' has the elements reflected along the main diagonal:
Page 6 of 15
MATLAB uses an asterisk to denote matrix multiplication, as in C = A*B. Matrix
multiplication is not commutative; that is, A*B is typically not equal to B*A:
5. Generally accepted mathematical notation uses the capital letter I to denote identity
matrices, matrices of various sizes with ones on the main diagonal and zeros
elsewhere. These matrices have the property that AI = A and IA = A whenever the
dimensions are compatible.
The original version of MATLAB could not use I for this purpose because it did not
distinguish between uppercase and lowercase letters and ‘i’ already served duty as a
subscript and as the complex unit. So, an English language pun was introduced. The
function eye(m,n) returns an m-by-n rectangular identity matrix and eye(n) returns an
n-by-n square identity matrix.
Page 7 of 15
7. The colon ‘:’ is one of the most useful operators in MATLAB. It can create vectors,
subscript arrays, and specify for iterations. It has following syntax:
8. In MATLAB, there are three primary approaches to accessing array elements based on
their location (index) in the array. These approaches are indexing by position, linear
indexing, and logical indexing. We will discuss Indexing with element position.
Page 8 of 15
9. You can create a multidimensional array by creating a 2-D matrix first, and then
extending it. For example, first define a 3-by-3 matrix as the first page in a 3-D array.
Now add a second page. To do this, assign another 3-by-3 matrix to the index value 2
in the third dimension. The syntax A(:,:,2) uses a colon in the first and second
dimensions to include all rows and all columns from the right-hand side of the
assignment.
Page 9 of 15
LAB SESSION
Lab Task:
1. To be familiar with Matrix Partitioning with MATLAB.
1. To know how to make a program using MATLAB for Matrix Partitioning
Apparatus:
Laptop
MATLAB
Experimental Procedure:
1. Start MATLAB by double-click on the icon on your desktop. It will open following
different windows in your PC as shown in image.
Page 10 of 15
3. Split A into four 2x2 partitioned matrices, say sA1, sA2, sA3 and sA4, using Array
command.
sA1=A(1:2,1:2),sA2=A(1:2,3:4),sA3=A(3:4,1:2),sA4=A(3:4,3:4)
4. Now we split same Matrix A using MATLAB program. For this Purpose, use Editor for
writing command and first Enter a matrix ‘A’ through user input by below command.
A=input('Enter any Matrix: ');
[r,c]=size(A);
Page 11 of 15
8. Calculate number of splitted matrix.
nr=floor(r/rs);
nc=floor(c/cs);
for i=1:nr
for j=1:nc
sA(:,:,1)=A(1:rs,1:cs);
end
end
10. Now initialize all required splitted Matrix say ‘say sA1, sA2, sA3 and sA4.’ In separate
pages of a 3D multidimensional array Matrix.
sA(rs,cs,nr*nc)=0;
z=1;
for i=1:nr
for j=1:nc
sA(:,:,z)=A((i-1)*rs+1):1:rs*i,((j-1)*cs+1):cs*j);
z=z+1;
end
end
11. Now get all partitioned Matrices by writing ‘sA’ in command window and press
enter.
Observations:
(Follow Similar procedure and partitioned the 4x4 Magic matrix )
Page 12 of 15
LAB REPORT
Prepare the Lab Report below:
TITLE:
OBJECTIVE:
APPARATUS:
PROCEDURE:
(Note: Use all steps you studied in LAB SESSION of this tab to write procedure and
to complete the experiment)
Page 13 of 15
Page 14 of 15
DISCUSSION:
Q1.: How you describe Partitioned Matrix application in Computational Fluid Dynamics
(CFD)?
Conclusion /Summary:
Page 15 of 15