Homework 10

Final homework

HW
Due: Fri, Apr 24, 11:59 pm

Linear Algebra in Action

Introduction

This homework asks you to explore three major ideas from linear algebra computationally. You will study a spring-mass system using matrix methods, use SVD to compress an image, and apply PCA to a real dataset. The goal is not just to get numerical answers, but to interpret what those answers mean.

You may use any language or software you like (MATLAB, Mathematica, Python, Julia, R, etc. are all fine).

Part 1: A Two-Mass Spring System and a \(4\times 4\) Matrix ODE

Consider two identical masses connected by springs in a line:

  • Each mass has mass \(m=1\).
  • Each spring has spring constant \(k=1\).
  • The left end of the first spring is attached to a wall.
  • The right end of the second spring is attached to a wall.
  • There is also a spring connecting the two masses.

Let \(x_1(t)\) and \(x_2(t)\) denote the displacements of the two masses from equilibrium.

Physical Model

Using Newton’s second law and Hooke’s law, the motion is described by

\[ \begin{aligned} x_1'' &= -2x_1 + x_2 \\ x_2'' &= x_1 - 2x_2 \end{aligned} \]

In matrix form, this is

\[ \mathbf{x}''(t) = -K \mathbf{x}(t), \]

where

\[ \mathbf{x}(t)= \begin{bmatrix} x_1(t) \\ x_2(t) \end{bmatrix}, \qquad K= \begin{bmatrix} 2 & -1 \\ -1 & 2 \end{bmatrix}. \]

Now define the state vector

\[ \mathbf{y}(t)= \begin{bmatrix} x_1(t) \\ x_2(t) \\ x_1'(t) \\ x_2'(t) \end{bmatrix}. \]

Then the system becomes the first-order matrix ODE

\[ \mathbf{y}'(t)=A\mathbf{y}(t), \]

where

\[ A= \begin{bmatrix} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ -2 & 1 & 0 & 0 \\ 1 & -2 & 0 & 0 \end{bmatrix}. \]

Tasks

  1. Use software to compute the eigenvalues and eigenvectors of \(A\).
  2. Use software to compute \(e^{At}\). The result should simplify to a real matrix, even if complex numbers appear during the computation.
  3. Solve the same system directly with a differential equation solver.
  4. Compare the two answers and explain how they are related to each other.

Part 2: Image Compression with SVD

Take a grayscale image and represent it as a matrix whose resolution is at least \(1024\times 1024\). You may use a photo that you take yourself, or any image that you are allowed to use.

  1. Compute the singular value decomposition of the image matrix.
  2. Create low-rank approximations of the image using at least three different ranks, such as \(k=5\), \(k=20\), and \(k=50\). If your image is much smaller, choose other reasonable values.
  3. Display the original image and the approximations. Briefly describe how image quality changes as the rank increases.
  4. Make a plot of the singular values, or report how much of the matrix “information” is captured by each approximation.

Part 3: PCA on Real Data

Choose a real dataset with at least 4 numerical variables and at least 50 observations. The dataset should be something you find interesting. Possible examples include sensor data, weather data, car specifications, sports statistics, material properties, or other engineering-related data.

  1. State the source of your dataset. Clean the data if necessary, and standardize the numerical variables before applying PCA.
  2. Compute the principal components.
  3. Create a scatter plot of the data projected onto the first two principal components.
  4. Explain what the first principal component seems to represent.

Part 4: Final Course Evaluation (AUevaluate)

Here is the link for our course evaluation.

I sincerely hope many of you will take a few minutes to complete the evaluation.

In my experience, evaluations often reflect the most extreme opinions (either very happy or very frustrated students), which can sometimes give a misleading picture. Hearing from a broader range of students makes a meaningful difference.

Since this was my first class at Auburn, your feedback is especially important to me. It helps future students understand the course, helps me improve how I teach, and is also an important part of how my teaching is evaluated.

I also know there are unofficial platforms like RateMyProfessor or Coursicle. While these are completely optional, I appreciate any feedback you choose to share—for the benefit of future students.

On my end, teaching this class has been a much better experience than I anticipated. Thank you for being respectful, engaged, and positive. I truly felt the spirit and energy of Auburn students, and it made this class very enjoyable for me. I hope you carry that with you moving forward.

For credit, simply indicate in your submission that you have completed the evaluation. I will trust your response.

Submission

  • Submit a short report with your results, figures, screenshots, code, and explanations.
  • Upload your work to the Canvas assignment Homework 10.
  • Any format is fine, including a ZIP file containing your report and code.

Grading

  • 4 points — Part 1: eigenvalues, matrix exponential, and solution
  • 4 points — Part 2: SVD computation, visualizations, and discussion
  • 4 points — Part 3: PCA analysis, plots, and interpretation
  • 4 points — Part 4: AUevaluate

The maximum score is capped at 12 points. For example, you could complete Parts 1, 2, and 4 for full credit.

Notes

  • You may use built-in software functions such as eig, svd, and pca, or their equivalents in your software.
  • You may discuss ideas with classmates, but your submission must be your own work.
  • Your explanations should be written in your own words.