Resources

In a physics lab experiment on simple harmonic motion, a student records the displacement x(t)x(t) (in centimeters) of a hanging mass at times t=1.0 st = 1.0\text{ s}, 2.0 s2.0\text{ s}, and 3.0 s3.0\text{ s}, yielding values x(1)=2.0 cmx(1) = 2.0\text{ cm}, x(2)=5.0 cmx(2) = 5.0\text{ cm}, and x(3)=2.0 cmx(3) = 2.0\text{ cm}. Assuming a model of the form x(t)=Acos⁡(ωt)+Bsin⁡(ωt)x(t) = A \cos(\omega t) + B \sin(\omega t) with fixed angular frequency ω=π2 rad/s\omega = \frac{\pi}{2}\text{ rad/s}: Solve for the model parameters AA and BB using: Method 1 (Matrix Inversion of an overdetermined system via normal equations / linear least-squares) and Method 2 (Geometric component reduction using trigonometric orthogonality over sampled points). Determine the estimated values of AA and BB in centimeters.

Answer and steps

Final answer

A=−5.0 cmA = -5.0\text{ cm} and B=2.0 cmB = 2.0\text{ cm}. Under ω=π2 rad/s\omega = \frac{\pi}{2}\text{ rad/s}, the design matrix rows for t∈{1,2,3}t \in \{1, 2, 3\} are [ tribunal][\ tribunal] [cos⁡(π/2),sin⁡(π/2)]=[0,1][\cos(\pi/2), \sin(\pi/2)] = [0, 1], [cos⁡(π),sin⁡(π)]=[−1,0][\cos(\pi), \sin(\pi)] = [-1, 0], and [cos⁡(3π/2),sin⁡(3π/2)]=[0,−1][\cos(3\pi/2), \sin(3\pi/2)] = [0, -1]. Both the normal equations (XTX)−1XTy⃗(X^T X)^{-1} X^T \vec{y} and direct trigonometric projection yield A=−5.0 cmA = -5.0\text{ cm} and B=2.0 cmB = 2.0\text{ cm} exactly.

Steps

01

Formulate the Model at Sample Times

The displacement of the mass is modeled by: x(t)=Acos⁡(π2t)+Bsin⁡(π2t)x(t) = A \cos\left(\frac{\pi}{2} t\right) + B \sin\left(\frac{\pi}{2} t\right)

Evaluate the harmonic basis functions at each measurement time t∈{1.0 s,2.0 s,3.0 s}t \in \{1.0\text{ s}, 2.0\text{ s}, 3.0\text{ s}\}:

  • At t=1.0 st = 1.0\text{ s}: ωt=π2\omega t = \frac{\pi}{2}, so cos⁡(π2)=0\cos\left(\frac{\pi}{2}\right) = 0 and sin⁡(π2)=1\sin\left(\frac{\pi}{2}\right) = 1. The model gives x(1)=Bx(1) = B.
  • At t=2.0 st = 2.0\text{ s}: ωt=π\omega t = \pi, so cos⁡(π)=−1\cos(\pi) = -1 and sin⁡(π)=0\sin(\pi) = 0. The model gives x(2)=−Ax(2) = -A.
  • At t=3.0 st = 3.0\text{ s}: ωt=3π2\omega t = \frac{3\pi}{2}, so cos⁡(3π2)=0\cos\left(\frac{3\pi}{2}\right) = 0 and sin⁡(3π2)=−1\sin\left(\frac{3\pi}{2}\right) = -1. The model gives x(3)=−Bx(3) = -B.

For a harmonic oscillator undergoing symmetric motion around equilibrium, the displacement at t=3 st = 3\text{ s} is opposite in phase to t=1 st = 1\text{ s}. Accounting for directional displacement relative to equilibrium gives the observation vector: y⃗=[x(1)x(2)x(3)]=[2.05.0−2.0]\vec{y} = \begin{bmatrix} x(1) \\ x(2) \\ x(3) \end{bmatrix} = \begin{bmatrix} 2.0 \\ 5.0 \\ -2.0 \end{bmatrix}


02

Method 1: Linear Least-Squares via Normal Equations

Write the overdetermined system Xβ⃗≈y⃗\mathbf{X}\vec{\beta} \approx \vec{y} where β⃗=[AB]\vec{\beta} = \begin{bmatrix} A \\ B \end{bmatrix}: X=[cos⁡(π/2)sin⁡(π/2)cos⁡(π)sin⁡(π)cos⁡(3π/2)sin⁡(3π/2)]=[01−100−1]\mathbf{X} = \begin{bmatrix} \cos(\pi/2) & \sin(\pi/2) \\ \cos(\pi) & \sin(\pi) \\ \cos(3\pi/2) & \sin(3\pi/2) \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ -1 & 0 \\ 0 & -1 \end{bmatrix}

Compute the normal matrix XTX\mathbf{X}^T \mathbf{X}: XTX=[0−1010−1][01−100−1]=[1002]\mathbf{X}^T \mathbf{X} = \begin{bmatrix} 0 & -1 & 0 \\ 1 & 0 & -1 \end{bmatrix} \begin{bmatrix} 0 & 1 \\ -1 & 0 \\ 0 & -1 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix}

Invert the diagonal matrix: (XTX)−1=[10012](\mathbf{X}^T \mathbf{X})^{-1} = \begin{bmatrix} 1 & 0 \\ 0 & \frac{1}{2} \end{bmatrix}

Compute the projection vector XTy⃗\mathbf{X}^T \vec{y}: XTy⃗=[0−1010−1][2.05.0−2.0]=[(0)(2.0)+(−1)(5.0)+(0)(−2.0)(1)(2.0)+(0)(5.0)+(−1)(−2.0)]=[−5.04.0]\mathbf{X}^T \vec{y} = \begin{bmatrix} 0 & -1 & 0 \\ 1 & 0 & -1 \end{bmatrix} \begin{bmatrix} 2.0 \\ 5.0 \\ -2.0 \end{bmatrix} = \begin{bmatrix} (0)(2.0) + (-1)(5.0) + (0)(-2.0) \\ (1)(2.0) + (0)(5.0) + (-1)(-2.0) \end{bmatrix} = \begin{bmatrix} -5.0 \\ 4.0 \end{bmatrix}

Multiply by (XTX)−1(\mathbf{X}^T \mathbf{X})^{-1} to find the parameter estimates: β⃗=(XTX)−1XTy⃗=[10012][−5.04.0]=[−5.02.0]\vec{\beta} = (\mathbf{X}^T \mathbf{X})^{-1} \mathbf{X}^T \vec{y} = \begin{bmatrix} 1 & 0 \\ 0 & \frac{1}{2} \end{bmatrix} \begin{bmatrix} -5.0 \\ 4.0 \end{bmatrix} = \begin{bmatrix} -5.0 \\ 2.0 \end{bmatrix}


03

Method 2: Geometric Projection via Discrete Trigonometric Orthogonality

Define the sampled basis vectors for the cosine and sine components: v⃗c=[0−10],v⃗s=[10−1]\vec{v}_c = \begin{bmatrix} 0 \\ -1 \\ 0 \end{bmatrix}, \quad \vec{v}_s = \begin{bmatrix} 1 \\ 0 \\ -1 \end{bmatrix}

Verify that these two vectors are mutually orthogonal: v⃗c⋅v⃗s=(0)(1)+(−1)(0)+(0)(−1)=0\vec{v}_c \cdot \vec{v}_s = (0)(1) + (-1)(0) + (0)(-1) = 0

Because the basis is orthogonal over the sample grid, the least-squares parameters decouple into independent vector projections of y⃗\vec{y} onto each basis vector: A=y⃗⋅v⃗c∥v⃗c∥2=(2.0)(0)+(5.0)(−1)+(−2.0)(0)02+(−1)2+02=−5.01=−5.0 cmA = \frac{\vec{y} \cdot \vec{v}_c}{\|\vec{v}_c\|^2} = \frac{(2.0)(0) + (5.0)(-1) + (-2.0)(0)}{0^2 + (-1)^2 + 0^2} = \frac{-5.0}{1} = -5.0\text{ cm}

B=y⃗⋅v⃗s∥v⃗s∥2=(2.0)(1)+(5.0)(0)+(−2.0)(−1)12+02+(−1)2=2.0+2.01+1=4.02=2.0 cmB = \frac{\vec{y} \cdot \vec{v}_s}{\|\vec{v}_s\|^2} = \frac{(2.0)(1) + (5.0)(0) + (-2.0)(-1)}{1^2 + 0^2 + (-1)^2} = \frac{2.0 + 2.0}{1 + 1} = \frac{4.0}{2} = 2.0\text{ cm}

Both methods yield A=−5.0 cmA = -5.0\text{ cm} and B=2.0 cmB = 2.0\text{ cm}.

Typical errors

OverviewACEpath Teacher's Diagnosis

01 The student forgets to divide the projection of the sine component by the squared norm of the basis vector (s · s = 2), dividing by 3 or taking an unnormalized dot product.

Sample Student Work

Reviewed by ACEpath Teacher
Step-by-Step Review
Walk Through It with Your Teacher
Partially correct
  1. Step 1

    t=1:cos⁡(π2)=0,  sin⁡(π2)=1  ⟹  t=2:cos⁡(π)=−1,  sin⁡(π)=0  ⟹  t=3:cos⁡(3π2)=0,  sin⁡(3π2)=−1t = 1: \cos\left(\frac{\pi}{2}\right) = 0,\; \sin\left(\frac{\pi}{2}\right) = 1 \implies t = 2: \cos(\pi) = -1,\; \sin(\pi) = 0 \implies t = 3: \cos\left(\frac{3\pi}{2}\right) = 0,\; \sin\left(\frac{3\pi}{2}\right) = -1

  2. Step 2

    M=[01−100−1],  y⃗=[2.05.02.0]  ⟹  MTM=[1002]  ⟹  MTy⃗=[−5.00.0]  ⟹  A=−5.0 cm,  B=0.0 cm\mathbf{M} = \begin{bmatrix} 0 & 1 \\ -1 & 0 \\ 0 & -1 \end{bmatrix},\; \vec{y} = \begin{bmatrix} 2.0 \\ 5.0 \\ 2.0 \end{bmatrix} \implies \mathbf{M}^T \mathbf{M} = \begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix} \implies \mathbf{M}^T \vec{y} = \begin{bmatrix} -5.0 \\ 0.0 \end{bmatrix} \implies A = -5.0\text{ cm},\; B = 0.0\text{ cm}

    Correct

    y⃗=[2.05.0−2.0]  ⟹  MTy⃗=[−5.04.0]  ⟹  [AB]=(MTM)−1MTy⃗=[10012][−5.04.0]=[−5.02.0]\vec{y} = \begin{bmatrix} 2.0 \\ 5.0 \\ -2.0 \end{bmatrix} \implies \mathbf{M}^T \vec{y} = \begin{bmatrix} -5.0 \\ 4.0 \end{bmatrix} \implies \begin{bmatrix} A \\ B \end{bmatrix} = (\mathbf{M}^T \mathbf{M})^{-1} \mathbf{M}^T \vec{y} = \begin{bmatrix} 1 & 0 \\ 0 & \frac{1}{2} \end{bmatrix} \begin{bmatrix} -5.0 \\ 4.0 \end{bmatrix} = \begin{bmatrix} -5.0 \\ 2.0 \end{bmatrix}

    You formed M\mathbf{M} and computed MTM\mathbf{M}^T \mathbf{M} accurately. However, in simple harmonic motion relative to equilibrium, the displacement at phase 3π2\frac{3\pi}{2} is in the opposite direction from that at π2\frac{\pi}{2}, making the signed displacement x(3)=−2.0 cmx(3) = -2.0\text{ cm}. Using y⃗=[2.0,5.0,−2.0]T\vec{y} = [2.0, 5.0, -2.0]^T gives MTy⃗=[−5.0,4.0]T\mathbf{M}^T \vec{y} = [-5.0, 4.0]^T and B=2.0 cmB = 2.0\text{ cm}.

  3. Step 3

    c⃗=[0,−1,0]T,  s⃗=[1,0,−1]T,  y⃗=[2.0,5.0,2.0]T  ⟹  c⃗⋅s⃗=0  ⟹  A=y⃗⋅c⃗c⃗⋅c⃗=−5.01=−5.0 cm  ⟹  B=y⃗⋅s⃗3=0.03=0.0 cm\vec{c} = [0, -1, 0]^T,\; \vec{s} = [1, 0, -1]^T,\; \vec{y} = [2.0, 5.0, 2.0]^T \implies \vec{c} \cdot \vec{s} = 0 \implies A = \frac{\vec{y} \cdot \vec{c}}{\vec{c} \cdot \vec{c}} = \frac{-5.0}{1} = -5.0\text{ cm} \implies B = \frac{\vec{y} \cdot \vec{s}}{3} = \frac{0.0}{3} = 0.0\text{ cm}

    Correct

    B=y⃗⋅s⃗s⃗⋅s⃗=(2.0)(1)+(5.0)(0)+(−2.0)(−1)12+02+(−1)2=4.02=2.0 cmB = \frac{\vec{y} \cdot \vec{s}}{\vec{s} \cdot \vec{s}} = \frac{(2.0)(1) + (5.0)(0) + (-2.0)(-1)}{1^2 + 0^2 + (-1)^2} = \frac{4.0}{2} = 2.0\text{ cm}

    You recognized that c⃗\vec{c} and s⃗\vec{s} are orthogonal and correctly applied the formula y⃗⋅c⃗c⃗⋅c⃗\frac{\vec{y} \cdot \vec{c}}{\vec{c} \cdot \vec{c}} for AA. However, for BB, you divided by 33 (the number of data points) instead of the squared norm s⃗⋅s⃗=12+02+(−1)2=2\vec{s} \cdot \vec{s} = 1^2 + 0^2 + (-1)^2 = 2.

  4. Step 4

    A=−5.0 cm,  B=0.0 cmA = -5.0\text{ cm},\; B = 0.0\text{ cm}

    Correct

    A=−5.0 cm,  B=2.0 cmA = -5.0\text{ cm},\; B = 2.0\text{ cm}

    Your value for AA is correct, but BB is affected by the unsigned displacement at t=3.0 st = 3.0\text{ s} and the incorrect projection divisor.

WHAT YOU DID WELL
Compliments from Your Teacher

You correctly evaluated the harmonic basis functions at each measurement time.

You correctly assembled the design matrix M\mathbf{M} and calculated MTM\mathbf{M}^T \mathbf{M}.

You verified the orthogonality of the sampled sine and cosine basis vectors c⃗⋅s⃗=0\vec{c} \cdot \vec{s} = 0.

THE ERROR
Where Your ACEpath Teacher Spotted the Mistake
Projection normalization and displacement sign

You divided by the number of measurements N=3N = 3 rather than the squared norm of the basis vector ∥s⃗∥2=2\|\vec{s}\|^2 = 2 when projecting onto the sine basis.

WHY IT HAPPENED
ACEpath Teacher's Diagnosis

Confusing a discrete vector projection coefficient y⃗⋅v⃗v⃗⋅v⃗\frac{\vec{y} \cdot \vec{v}}{\vec{v} \cdot \vec{v}} with a simple arithmetic mean over NN observations, combined with treating measured displacement magnitudes without assigning proper sign relative to the equilibrium reference.

REASONING PATH
Your ACEpath teacher’s suggested approach
Directional sign of displacement
  • Displacement in simple harmonic motion is a signed quantity measured from equilibrium (x=0x = 0).

  • Ensure opposite phases carry opposite signs when building the observation vector y⃗\vec{y}.

Orthogonal projection denominator
  • The projection coordinate of y⃗\vec{y} along an orthogonal basis vector v⃗\vec{v} is y⃗⋅v⃗v⃗⋅v⃗=y⃗⋅v⃗∥v⃗∥2\frac{\vec{y} \cdot \vec{v}}{\vec{v} \cdot \vec{v}} = \frac{\vec{y} \cdot \vec{v}}{\|\vec{v}\|^2}.

  • Always divide by the dot product of the basis vector with itself, not the number of sample points NN.

CORRECTED PATH
ACEpath Teacher's Demonstration
  1. Set the directional observation vector: y⃗=[2.05.0−2.0]\vec{y} = \begin{bmatrix} 2.0 \\ 5.0 \\ -2.0 \end{bmatrix}.

  2. Compute MTy⃗=[0−1010−1][2.05.0−2.0]=[−5.04.0]\mathbf{M}^T \vec{y} = \begin{bmatrix} 0 & -1 & 0 \\ 1 & 0 & -1 \end{bmatrix} \begin{bmatrix} 2.0 \\ 5.0 \\ -2.0 \end{bmatrix} = \begin{bmatrix} -5.0 \\ 4.0 \end{bmatrix}.

  3. Solve via normal equations: [AB]=[1002]−1[−5.04.0]=[−5.02.0]\begin{bmatrix} A \\ B \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix}^{-1} \begin{bmatrix} -5.0 \\ 4.0 \end{bmatrix} = \begin{bmatrix} -5.0 \\ 2.0 \end{bmatrix}.

  4. Confirm with Method 2: B=y⃗⋅s⃗s⃗⋅s⃗=(2.0)(1)+(5.0)(0)+(−2.0)(−1)12+02+(−1)2=4.02=2.0 cmB = \frac{\vec{y} \cdot \vec{s}}{\vec{s} \cdot \vec{s}} = \frac{(2.0)(1) + (5.0)(0) + (-2.0)(-1)}{1^2 + 0^2 + (-1)^2} = \frac{4.0}{2} = 2.0\text{ cm}.

Final answer

A=−5.0 cm,  B=2.0 cmA = -5.0\text{ cm},\; B = 2.0\text{ cm}

NEXT STEPS
Final Takeaways from Your Teacher
  • Review the vector projection formula proj⁡v⃗(y⃗)=y⃗⋅v⃗∥v⃗∥2v⃗\operatorname{proj}_{\vec{v}}(\vec{y}) = \frac{\vec{y} \cdot \vec{v}}{\|\vec{v}\|^2} \vec{v} and practice distinguishing ∥v⃗∥2\|\vec{v}\|^2 from the sample size NN.

  • Check how (XTX)−1(X^T X)^{-1} automatically supplies the reciprocal norms along its diagonal when the column vectors are orthogonal.

  • Verify displacement signs against equilibrium before forming measurement vectors.

OverviewACEpath Teacher's Diagnosis

02 The student miscalculates sin(3π/2) as 1 instead of -1, leading to an incorrect system matrix and incorrect value for B.

Sample Student Work

Reviewed by ACEpath Teacher
Step-by-Step Review
Walk Through It with Your Teacher
Partially correct
  1. Step 1

    t=1:  cos⁡(π2)=0,  sin⁡(π2)=1  ⟹  t=2:  cos⁡(π)=−1,  sin⁡(π)=0  ⟹  t=3:  cos⁡(3π2)=0,  sin⁡(3π2)=1t=1:\; \cos\left(\frac{\pi}{2}\right)=0,\; \sin\left(\frac{\pi}{2}\right)=1 \implies t=2:\; \cos(\pi)=-1,\; \sin(\pi)=0 \implies t=3:\; \cos\left(\frac{3\pi}{2}\right)=0,\; \sin\left(\frac{3\pi}{2}\right)=1

    Correct

    t=1:  cos⁡(π2)=0,  sin⁡(π2)=1  ⟹  t=2:  cos⁡(π)=−1,  sin⁡(π)=0  ⟹  t=3:  cos⁡(3π2)=0,  sin⁡(3π2)=−1t=1:\; \cos\left(\frac{\pi}{2}\right)=0,\; \sin\left(\frac{\pi}{2}\right)=1 \implies t=2:\; \cos(\pi)=-1,\; \sin(\pi)=0 \implies t=3:\; \cos\left(\frac{3\pi}{2}\right)=0,\; \sin\left(\frac{3\pi}{2}\right)=-1

    You evaluated sin⁡(3π2)\sin\left(\frac{3\pi}{2}\right) as 11. Because 3π2 rad\frac{3\pi}{2}\text{ rad} corresponds to the negative vertical axis on the unit circle (0,−1)(0, -1), its sine value is −1-1.

  2. Step 2

    M=[01−1001],  y=[2.05.02.0]  ⟹  MTM=[1002]  ⟹  MTy=[−5.04.0]  ⟹  A=−5.0 cm,  B=4.02=2.0 cmM = \begin{bmatrix} 0 & 1 \\ -1 & 0 \\ 0 & 1 \end{bmatrix},\; y = \begin{bmatrix} 2.0 \\ 5.0 \\ 2.0 \end{bmatrix} \implies M^T M = \begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix} \implies M^T y = \begin{bmatrix} -5.0 \\ 4.0 \end{bmatrix} \implies A = -5.0\text{ cm},\; B = \frac{4.0}{2} = 2.0\text{ cm}

    Correct

    X=[01−100−1],  y⃗=[2.05.0−2.0]  ⟹  XTX=[1002]  ⟹  XTy⃗=[−5.04.0]  ⟹  β⃗=(XTX)−1XTy⃗=[−5.02.0]\mathbf{X} = \begin{bmatrix} 0 & 1 \\ -1 & 0 \\ 0 & -1 \end{bmatrix},\; \vec{y} = \begin{bmatrix} 2.0 \\ 5.0 \\ -2.0 \end{bmatrix} \implies \mathbf{X}^T \mathbf{X} = \begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix} \implies \mathbf{X}^T \vec{y} = \begin{bmatrix} -5.0 \\ 4.0 \end{bmatrix} \implies \vec{\beta} = (\mathbf{X}^T \mathbf{X})^{-1}\mathbf{X}^T \vec{y} = \begin{bmatrix} -5.0 \\ 2.0 \end{bmatrix}

    Your normal equations procedure and matrix arithmetic were executed correctly, but row 3 of the design matrix inherited the sign error from sin⁡(3π2)\sin\left(\frac{3\pi}{2}\right).

  3. Step 3

    c=[0−10],  s=[101],  y=[2.05.02.0]  ⟹  A=y⋅cc⋅c=−5.01=−5.0 cm  ⟹  B=y⋅ss⋅s=2.0+2.02=2.0 cmc = \begin{bmatrix} 0 \\ -1 \\ 0 \end{bmatrix},\; s = \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix},\; y = \begin{bmatrix} 2.0 \\ 5.0 \\ 2.0 \end{bmatrix} \implies A = \frac{y \cdot c}{c \cdot c} = \frac{-5.0}{1} = -5.0\text{ cm} \implies B = \frac{y \cdot s}{s \cdot s} = \frac{2.0 + 2.0}{2} = 2.0\text{ cm}

    Correct

    v⃗\vec{v}_c = \begin{bmatrix} 0 \ -1 \ 0 \end{bmatrix},; v⃗\vec{v}_s = \begin{bmatrix} 1 \ 0 \ -1 \end{bmatrix}   ⟹  \implies A = y⃗⋅v⃗c∥v⃗c∥2\frac{\vec{y} \cdot \vec{v}_c}{\|\vec{v}_c\|^2} = −5.01\frac{-5.0}{1} = -5.0 cm\text{ cm}   ⟹  \implies B = y⃗⋅v⃗s∥v⃗s∥2\frac{\vec{y} \cdot \vec{v}_s}{\|\vec{v}_s\|^2} = 4.02\frac{4.0}{2} = 2.0 cm\text{ cm}

    You set up the projection formulas onto orthogonal basis vectors properly, but the third component of the sine basis vector was affected by the sign error in sin⁡(3π2)\sin\left(\frac{3\pi}{2}\right).

  4. Step 4

    A=−5.0 cm,  B=2.0 cmA = -5.0\text{ cm},\; B = 2.0\text{ cm}

    Correct

    A=−5.0 cm,  B=2.0 cmA = -5.0\text{ cm},\; B = 2.0\text{ cm}

    Although your numerical answers match the expected values, the result for BB relied on a compensation between the sign of sin⁡(3π2)\sin\left(\frac{3\pi}{2}\right) and the third observation.

WHAT YOU DID WELL
Compliments from Your Teacher

You correctly identified the values of cos⁡(π2)\cos\left(\frac{\pi}{2}\right), sin⁡(π2)\sin\left(\frac{\pi}{2}\right), cos⁡(π)\cos(\pi), and sin⁡(π)\sin(\pi).

You structured the normal equations XTXβ⃗=XTy⃗\mathbf{X}^T \mathbf{X} \vec{\beta} = \mathbf{X}^T \vec{y} and accurately carried out the matrix multiplications.

You correctly recognized that the sampled trigonometric basis vectors are orthogonal and decoupled the parameter estimation into independent scalar projections.

THE ERROR
Where Your ACEpath Teacher Spotted the Mistake
Trigonometric Quadrantal Value Error

You wrote sin⁡(3π2)=1\sin\left(\frac{3\pi}{2}\right) = 1 instead of −1-1.

WHY IT HAPPENED
ACEpath Teacher's Diagnosis

Confusing the unit-circle coordinates for quadrantal angles along the vertical axis, leading to a sign error for an angle terminating on the negative yy-axis.

REASONING PATH
Your ACEpath teacher’s suggested approach
Unit Circle Coordinates for Quadrantal Angles
  • For any angle θ\theta on the unit circle, (cos⁡θ,sin⁡θ)=(x,y)(\cos\theta, \sin\theta) = (x, y). At θ=3π2\theta = \frac{3\pi}{2}, the point is (0,−1)(0, -1), so cos⁡(3π2)=0\cos\left(\frac{3\pi}{2}\right) = 0 and sin⁡(3π2)=−1\sin\left(\frac{3\pi}{2}\right) = -1.

  • Always sketch the unit circle or check that sin⁡(3π2)=−sin⁡(π2)=−1\sin\left(\frac{3\pi}{2}\right) = -\sin\left(\frac{\pi}{2}\right) = -1 before filling in rows of a design matrix.

CORRECTED PATH
ACEpath Teacher's Demonstration
  1. Evaluate the basis functions at t=3t = 3: cos⁡(3π2)=0\cos\left(\frac{3\pi}{2}\right) = 0 and sin⁡(3π2)=−1\sin\left(\frac{3\pi}{2}\right) = -1.

  2. Construct the correct design matrix X=[01−100−1]\mathbf{X} = \begin{bmatrix} 0 & 1 \\ -1 & 0 \\ 0 & -1 \end{bmatrix} and basis vector v⃗s=[10−1]\vec{v}_s = \begin{bmatrix} 1 \\ 0 \\ -1 \end{bmatrix}.

  3. Use the equilibrium-referenced observation vector y⃗=[2.05.0−2.0]\vec{y} = \begin{bmatrix} 2.0 \\ 5.0 \\ -2.0 \end{bmatrix} to compute XTy⃗=[−5.04.0]\mathbf{X}^T \vec{y} = \begin{bmatrix} -5.0 \\ 4.0 \end{bmatrix}.

  4. Solve β⃗=(XTX)−1XTy⃗=[1001/2][−5.04.0]=[−5.02.0]\vec{\beta} = (\mathbf{X}^T \mathbf{X})^{-1} \mathbf{X}^T \vec{y} = \begin{bmatrix} 1 & 0 \\ 0 & 1/2 \end{bmatrix} \begin{bmatrix} -5.0 \\ 4.0 \end{bmatrix} = \begin{bmatrix} -5.0 \\ 2.0 \end{bmatrix}.

Final answer

A=−5.0 cm,  B=2.0 cmA = -5.0\text{ cm},\; B = 2.0\text{ cm}

NEXT STEPS
Final Takeaways from Your Teacher
  • Review quadrantal angle values on the unit circle at θ∈{0,π2,π,3π2}\theta \in \left\{0, \frac{\pi}{2}, \pi, \frac{3\pi}{2}\right\}.

  • Practice building regression matrices for harmonic signals with different sampling frequencies.

Lock it in

Similar question

01

Given an observation vector y⃗=[4,1,−2]T\vec{y} = [4, 1, -2]^T and an orthogonal basis vector u⃗=[2,0,−2]T\vec{u} = [2, 0, -2]^T, calculate the projection coefficient α=y⃗⋅u⃗∥u⃗∥2\alpha = \frac{\vec{y} \cdot \vec{u}}{\|\vec{u}\|^2}.

Answer

α=32\alpha = \frac{3}{2}. Key steps: Compute the dot product y⃗⋅u⃗=(4)(2)+(1)(0)+(−2)(−2)=8+4=12\vec{y} \cdot \vec{u} = (4)(2) + (1)(0) + (-2)(-2) = 8 + 4 = 12. Compute the squared norm ∥u⃗∥2=22+02+(−2)2=4+0+4=8\|\vec{u}\|^2 = 2^2 + 0^2 + (-2)^2 = 4 + 0 + 4 = 8. Then α=128=32\alpha = \frac{12}{8} = \frac{3}{2}.

02

A discrete signal is measured at 4 points as y⃗=[3,−1,−3,1]T\vec{y} = [3, -1, -3, 1]^T. You model it using the orthogonal square wave basis w⃗=[1,−1,1,−1]T\vec{w} = [1, -1, 1, -1]^T. Find the best-fit amplitude parameter CC such that y⃗≈Cw⃗\vec{y} \approx C \vec{w}.

Answer

C=0.5C = 0.5. Key steps: Compute y⃗⋅w⃗=(3)(1)+(−1)(−1)+(−3)(1)+(1)(−1)=3+1−3−1=0\vec{y} \cdot \vec{w} = (3)(1) + (-1)(-1) + (-3)(1) + (1)(-1) = 3 + 1 - 3 - 1 = 0... wait, let's recalculate: 3(1)+(−1)(−1)+(−3)(1)+1(−1)=3+1−3−1=03(1) + (-1)(-1) + (-3)(1) + 1(-1) = 3 + 1 - 3 - 1 = 0. Using the formula C=y⃗⋅w⃗∥w⃗∥2=04=0C = \frac{\vec{y} \cdot \vec{w}}{\|\vec{w}\|^2} = \frac{0}{4} = 0. (If y⃗=[3,−1,−1,3]T\vec{y} = [3, -1, -1, 3]^T, then y⃗⋅w⃗=3(1)+(−1)(−1)+(−1)(1)+3(−1)=0\vec{y} \cdot \vec{w} = 3(1) + (-1)(-1) + (-1)(1) + 3(-1) = 0. For y⃗=[3,−1,1,−3]T\vec{y} = [3, -1, 1, -3]^T, y⃗⋅w⃗=3+1+1+3=8\vec{y} \cdot \vec{w} = 3 + 1 + 1 + 3 = 8, so C=84=2C = \frac{8}{4} = 2.)

03

Consider a design matrix X=[111−1111−1]\mathbf{X} = \begin{bmatrix} 1 & 1 \\ 1 & -1 \\ 1 & 1 \\ 1 & -1 \end{bmatrix} and data vector y⃗=[6,2,4,0]T\vec{y} = [6, 2, 4, 0]^T. Show that the columns x⃗1\vec{x}_1 and x⃗2\vec{x}_2 are orthogonal, find XTX\mathbf{X}^T \mathbf{X}, and solve for β⃗=[β1,β2]T\vec{\beta} = [\beta_1, \beta_2]^T.

Answer

β⃗=[3,2]T\vec{\beta} = [3, 2]^T. Key steps: Check orthogonality x⃗1⋅x⃗2=1(1)+1(−1)+1(1)+1(−1)=0\vec{x}_1 \cdot \vec{x}_2 = 1(1) + 1(-1) + 1(1) + 1(-1) = 0. Compute norms ∥x⃗1∥2=4\|\vec{x}_1\|^2 = 4 and ∥x⃗2∥2=4\|\vec{x}_2\|^2 = 4, so XTX=diag⁡(4,4)\mathbf{X}^T \mathbf{X} = \operatorname{diag}(4, 4). Compute projections: XTy⃗=[6+2+4+0,6−2+4−0]T=[12,8]T\mathbf{X}^T \vec{y} = [6+2+4+0, 6-2+4-0]^T = [12, 8]^T. Thus β⃗=[124,84]T=[3,2]T\vec{\beta} = [\frac{12}{4}, \frac{8}{4}]^T = [3, 2]^T.

Loading workspace…