You are on page 1of 3

# MAT 461 Spring 2015

What to turn in: For this project you will need to turn in a printout of your published m-file.
Use a YourName_MATH461_Proj2.m file to save your code in an .m file. Use the command
PUBLISH(FILE,FORMAT) (or similar) to publish your work in word or pdf format (while you are at it,
play to see what other formats you can get). Make sure that you have enough comments and results
shown so that another person (me or the TA) can understand what you are doing.
Use %% notation to differentiate in cells the problems in this homework. This way you can even
run/debug one problem at a time.
The instructions about working in teams from Project 1 apply.
Remember to use the command lookfor *&% when trying to find the MATLAB command whose
description contains *&%.

MATLAB PROJECT 2
The goals of this project are: (1) to learn more about how to quickly generate matrices using
MATLAB functions; (2) practice different ways of computing the inverse and the determinant of
a matrix; (3) practice your understanding of the properties of the inverse and the determinant of a
matrix; (4)see how you can check that some vectors are linearly independent and last but not
least (5)interpret and explain the results generated by MATLAB.
PROBLEM 1: (3 points ) Use MATLAB commands to efficiently (i.e. without keying each
0 4 0 0 0
0 0 1 0 0
entry) enter the matrix: = 0 0 0 2 0 . Hint: Try help diag.
0 0 0 0 3
[0 0 0 0 0]
Compute Sk for k=2,3,4,5,6. Describe in words what happens when computing Sk.

2 4 6
PROBLEM 2: (3 points) Let = [4 5 7].
3 3 1
Find the first and third column of A-1 without computing the second column. Display the result as
a matrix with entries rational (not decimal) fractions.
Hint: You could obtain the reduced echelon form for a 3x5 augmented matrix or solve two
different systems. Review the algorithm for finding A-1 on pp 107, section 2.2. For the required
format, search for the correct syntax using help format.
Page 1 of 3

PROBLEM 3: (5 points) We know that if the determinant of the square matrix A, det A, is close
to zero, the matrix of A is singular (non-invertible). Does this mean that if det A is close to zero,
the matrix A is nearly singular? Lets investigate for the matrix
M= [4 0 -3 -7;-6 9 9 9;7 -5 10 19;-1 2 4 -1].
a. Compute the determinant of M2=.01*M. Is M2 singular?
b. Compute the determinant of M3=10*M. Is M3 singular?
c. How do det M2 and det M3 compare with det M? What property of determinants does
this illustrates?
d. Answer now the initial question: If det A is close to zero, does it mean that the matrix A
is nearly singular?
e. The condition number (computed by the MATLAB function cond) is proposed to you as
an alternate measure of whether a matrix is nearly singular. Compute the condition
number for M, M2 and M3 and discuss your result.
PROBLEM 4: (4 points) Consider = {1, sin , sin3 , sin4 }.
We would like to show that B is a linearly independent set of vectors in the space of all functions
defined on R. For that, start by assuming that a linear combination of the functions in B is zero
(for any t), that is:
1 1 + 2 sin + 3 sin3 + 4 sin4 = 0 (1)

Choose several values of t (say t=0, 12 , 6 , 4 , 3 , 2 , 12 , , 6 , ) and substitute in Eq. (1) until
you get a system of enough numerical equations to determine that all the weights 1 , , 4 of the
linear combination.
a) Define the coefficient matrix A for the numerical system generated through these
substitutions, for MATLAB to display. For example, if you type sin(pi), Matlab would
know that you are trying to compute sin( ) and it will happily evaluate it for you.
b) If the matrix A is invertible, then the equation A x=0 has only the trivial solution. Lets
use two methods to determine whether A is invertible. First compute its reduced echelon
form. What do you conclude about A? What does it mean about the set of functions in B?
c) Second, compute det(A). What do you conclude about A? What does it mean about the set
of functions in B?
d) Repeat your calculations at points (a)-(c) for a different set of values of t. What is your
final conclusion about the set of functions in B?
Hint: While introducing a 4x4 matrix manually is possible, you might be better served in the
long run by learning how to generate a vector of numbers equally spaced (try linspace) then
computing its sin function. For example, if T is your vector of values for t, then sin(T) would
return a vector of sines for t, (sin (T)).^2 would return the vector of squares of sines for t etc.
Page 2 of 3

. 0130
PROBLEM 5: ( 10 points) Let D=[. 0050
. 0020
. 0010

. 0050
. 0100
. 0040
. 0020

. 0020
. 0040
. 0100
. 0050

. 0010
. 0020] be a flexibility matrix for an
. 0050
. 0130

elastic beam such as the one in Example 3 pp 104, with four points at which force is applied.
Units are centimeters per newton of force.
a) Using MATLAB, find DT, the transpose of D.
b) Compute D- DT. Is it true that D= DT ? Matrices for which such a property is true are
called symmetric matrices.
c) Find D-1, the inverse of D.
d) Find the forces that produce a deflection of 1 at the first point and zero everywhere else.
(That is solve the system Df=y for y=[1;0;0;0] ). How does the found force compares
with the entries of D-1 ?
e) Test your explanation of point (d) by repeating the calculations for a deflection of 1 at the
second point and zero everywhere else.
f) Determine the forces that produce a deflection of .5 at the first point of the beam, with