MATH 461, Spring 2015: Linear Algebra for Scientists and Engineers
News
- The FINAL EXAM will be on Friday, May 15, 8:00am-10:00am in our usual room.
No calculators allowed.
You can bring a CHEAT SHEET: letter size, 2-sided, must be hand-written.
- practice problems
solutions
- Assignment 2, solution
- CHEAT SHEET for MATH461 (updated with Jordan normal form, symmetric matrices and quadratic forms)
- Solution of Exam 2, exam 2
- Exam 2 will be on Thu, April 23.
It will cover least squares problems, the determinant and eigenvalue problems, see
the "Cheat sheet for MATH461".
Practice problems for exam 2
Solution
- Read the notes about the determinant.
- Read the new material about Gram-Schmidt orthogonalization and the QR decomposition (starting on page 5)
- Look at the examples for curve fitting
Fitting with linear function,
Fitting with quadratic function
and try to understand the Matlab code.
- Read
- Practice problems for exam 1
Solution
- EXAM 1 will be on Tuesday, March 10
- Assignment 1:
Problem 1: 10 points ,
Problem 2: 10 points ,
Problem 3: 20 points ,
Problem 4: 30 points ,
Problem 5: 30 points
- Please read Linear systems of m equations for n unknowns
- Solution of Assignment 1,
Matlab for Problem 4, m-file
Matlab for Problem 5, m-file
- Assignment 1 is due on Thursday, Feb. 12, 9pm.
Hints:
Problem 2: For (ii) show that you can write each of the remaining vectors
as a linear combination of the ones which you selected.
Problem 3: Stop the Gaussian elimination if you encounter a column where
all pivot candidates are zero (do NOT continue to obtain a row echelon form like I did in class on Tuesday).
Problems 4 and 5:
How to plot graphs for linear equations in R2 and
R3
Problem 4(b): For (i) you should make one plot showing two lines together. Mark the intersection point (if there is one). Similarly for (ii), (iii).
Problem 5(b): For (i) you should make one plot showing three planes together. Mark the intersection points (if there are any). Similarly for (ii). Show the plot from a nice angle (see instructions below) so that one can clearly see whether there is only one intersection point, or more than one intersection point.
- You need to know how to run and publish m-files. Please try this now:
- make sure that Matlab is installed on your computer
- run and publish the m-file sample.m
- download the files
plotpoints.m ,
label.m ,
fillpoints.m ,
nice3d.m ,
stretch.m ,
and put them in the same directory as your other m-files.
- Then run and publish the m-file ex2d1.m
- Run the m-file ex3d1.m, note that you can rotate the graph by draggin with the mouse. Publish this m-file.
- If you have not used Matlab before or would like to review the basics:
- Gentle introduction to Matlab (also explains how to use the Matlab interface, how to publish)
- The Matlab Primer
gives a concise summary of the most important Matlab commands (but it was written for an older version of Matlab)
Additional Course Material (Required
Reading)
- CHEAT SHEET for MATH461 (updated with Jordan normal form, symmetric matrices and quadratic forms)
- Introduction to scalars, vectors, matrices
- Example for lines in 2D, m-file
- Example for planes in 3D, m-file
- Linear systems of n equations for n unknowns, inverse matrix
- How to solve a linear system in Matlab (if there is a unique solution):
[L,U,p] = lu(A,'vector') % perform elimination to find L,U,p
y = L\b(p) % use forward substitution to find y
x = U\y % use back substitution to find x
or you can simply use x=A\b.
- How to solve a linear system using symbolic Matlab commands:
A = sym([2 -1 -1; -1 2 -1; -1 -1 2]);
b = sym([1;-3;2]); % define A and b as symbolic arrays
xp = A\b % particular solution
V = null(A); % columns of V span null space
The general solution is given by xp plus any linear combination of the columns of V.
- For a symbolic matrix in Matlab:
Finding a basis for the null space of A: V = null(A)
Finding a basis for the range (column space) of A: V = colspace(A)
The columns of the matrix V form the basis. Note that there are many possible choices for the basis of a subspace.
- Linear systems of m equations for n unknowns
- Application example with masses and springs to illustrate the meaning of null(A) and null(AT).
- Dot product and least squares problems, Gram-Schmidt orthogonalization, QR decomposition
-
Example: Finding the angle between two vectors, m-file (you need to download arrow3.m)
-
Example: Finding the point on a plane which is closest to a given point, m-file (you need to download arrow3.m)
- Examples for curve fitting:
- How to solve the least squares problem ||Ac-b||=min in Matlab:
- Method 1: normal equations
M=A'*A; g=A'*b; c=M\g;
- Method 2: QR-decomposition (Gram-Schmidt orthogonalization)
[Q,R]=qr(A,0); d=Q'*b; c=R\d
Shortcut which works only for numerical matrices, not for symbolic matrices:
c=A\b
- The determinant
includes topics, office hours, grading policy
- You have to write an m-file for each problem. (Typing commands at the >> prompt and printing this out is not allowed!)
Running this m-file generates some text output and graphics.
Example: Running the m-file sample.m generates this text output
and this graph.
- You have to hand in the m-file together with the output and graphics.
The easiest way is to use the publish command in Matlab:
- All numerical output and all graphics must be clearly labeled.
Print only values asked for in the problem
(make sure you have a semicolon at the end of every line, unless you want to print something out)
- Hand in additional pages (can be handwritten) answering all the questions in the problem
(you can include some answers as comments in the m-file).
How to show 3D graphics in the published file from a nice angle:
- Run the Matlab code which generates the figure
- Click on "Rotate" icon
in the toolbar of the figure window
- Rotate the graph with the mouse into desired position - note the Az and El values displayed in lower left corner
- Insert view(Az,El) after your plotting commands (where Az and El are the values from step 3.)
Matlab Information