πŸ“ Week 02 (Part I: Pre-Calculus Foundations) β€’ Student Lecture Materials
🐍 Download Notebook (.ipynb) πŸ“‘ Download Blank Slides (PDF) πŸ“Š Download Dataset (.csv)

Week 02 β€” Unit-Circle Trigonometry, Radians & Harmonic Waves

Engineering Focus: Rotating Shaft Kinematics, Involute Spur Gears, Harmonic Bearing Vibrations & Solar Panel Incidence Geometry Companion Dataset: Week02_Turbine_Bearing_Vibration_and_Solar_Elevation_Data.csv


1. β€œCalculus Made Easy” Intuition: Why Do Engineers Insist on Radians?

High-school geometry loves dividing a full circle into \(360^\circ\) (an arbitrary number left over from ancient Babylonian calendars). Yet every single equation in calculus, dynamics, AC circuits, and robotics breaks down or picks up an ugly factor of \(\frac{\pi}{180}\) unless angles are measured in radians. Why?

Imagine wrapping a flexible measuring tape of length \(s\) around a bicycle wheel of radius \(r\): \[\theta\text{ [radians]} \equiv \frac{\text{arc length } s}{\text{wheel radius } r} \quad \implies \quad \mathbf{s = r\theta}\] Look at that definition:

  1. A radian is a dimensionless ratio (\(\text{m}/\text{m} = 1\)). So when a flywheel spins at angular speed \(\omega\ [\text{rad/s}]\), the rim speed is simply \(v = \frac{ds}{dt} = r\frac{d\theta}{dt} = r\omega\), with zero conversion constants!
  2. Even more miraculously: picture a super-thin pie slice of angle \(d\theta\) on a circle of radius \(1\). Its curved outer crust has length \(1 \cdot d\theta = d\theta\), while its straight vertical height is \(\sin(d\theta)\). As the slice shrinks tiny (\(d\theta \to 0\)), the tiny arc and the tiny vertical side become indistinguishable: \[\sin(d\theta) \approx d\theta \qquad \text{and} \qquad \frac{\sin\theta}{\theta} \to 1 \text{ as } \theta \to 0\] That only happens in radians! In degrees, \(\sin(1^\circ) = 0.017452 \neq 1\). Radians make sine’s slope at zero equal exactly \(1\), which keeps all calculus formulas clean and uncluttered!

How Sine, Cosine, and Tangent Actually Talk to Each Other

Picture a point \(P\) riding counterclockwise around a circle of radius \(1\):

2. Complete Mathematical Derivations & Reference Guide

2.1 Step-by-Step Derivation of Harmonic Wave Superposition (Phasor Identity)

Vibration and AC circuit signals frequently arrive as a mixture of cosine and sine at the same circular frequency \(\omega\): \[x(t) = A\cos(\omega t) + B\sin(\omega t)\] Instead of wrestling with two oscillating waves, we can collapse them into one wave \(R\cos(\omega t - \phi)\) in three clean steps:

  1. Expand the target wave using the cosine difference formula \(\cos(\alpha - \beta) = \cos\alpha\cos\beta + \sin\alpha\sin\beta\): \[R\cos(\omega t - \phi) = (R\cos\phi)\cos(\omega t) + (R\sin\phi)\sin(\omega t)\]

  2. Match coefficients of \(\cos(\omega t)\) and \(\sin(\omega t)\) term-by-term: \[R\cos\phi = A, \qquad R\sin\phi = B\]

  3. Square and add both equations (using \(\cos^2\phi + \sin^2\phi = 1\)) to get amplitude \(R\), and divide to get phase lag \(\phi\): \[\mathbf{R = \sqrt{A^2 + B^2}}, \qquad \mathbf{\phi = \operatorname{atan2}(B, A)}\] (Note: always use two-argument atan2(B, A) in code or check the quadrant of \((A, B)\) so signs in Quadrants II and III are never lost!)

2.2 Master Trigonometric & Wave Formulas for Engineering

Identity / Formula Exact Mathematical Expression Engineering Application
Arc Length & Rim Speed \(s = r\theta,\quad v = r\omega,\quad a_c = r\omega^2\) Pulley belts, wheel odometry, centrifuges
Small-Angle Approximation \(\sin\theta \approx \theta,\quad \cos\theta \approx 1 - \frac{\theta^2}{2}\) (\(\theta\) in rad) Simple pendulum, beam small-deflection slopes
Pythagorean Trig Triad \(\cos^2\theta + \sin^2\theta = 1,\quad 1 + \tan^2\theta = \sec^2\theta\) Force resolution & Mohr’s circle stresses
Phasor Combination \(A\cos(\omega t) + B\sin(\omega t) = R\cos(\omega t - \phi)\) Rotor unbalance & harmonic response amplitude \(R\)
Frequency & Period \(\omega = 2\pi f = \frac{2\pi}{T_{\text{per}}} = \frac{2\pi\cdot\text{RPM}}{60}\) Converting \(\text{Hz}\) or \(\text{RPM}\) into rad/s
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sympy as sp
from scipy.optimize import brentq
from pathlib import Path

plt.rcParams.update({
    "figure.dpi": 150,
    "font.size": 10,
    "axes.grid": True,
    "grid.alpha": 0.30,
    "axes.spines.top": False,
    "axes.spines.right": False,
})

def load_week_csv(filename):
    for p in [Path("datasets") / filename, Path("../datasets") / filename]:
        if p.exists():
            return pd.read_csv(p)
    raise FileNotFoundError(f"Dataset not found: {filename}")

3. Real-World Vibration & Solar Geometry Dataset Analysis

We inspect Week02_Turbine_Bearing_Vibration_and_Solar_Elevation_Data.csv, containing high-speed rotor bearing displacement telemetry \(x(t)\) alongside hourly solar collector tilt/altitude measurements. We verify the exact phasor collapse \(R = \sqrt{A^2+B^2}\) and visualize both the phase-shifted harmonic wave and the small-angle radian accuracy region.

df = load_week_csv("Week02_Turbine_Bearing_Vibration_and_Solar_Elevation_Data.csv")
print("Week 02 Vibration & Solar Telemetry (first 6 rows):")
print(df.head(6).to_string(index=False))

# Extract turbine phasor check: x(t) = 1.8 cos(wt) + 2.4 sin(wt) mm
A_amp, B_amp = 1.8, 2.4
R_peak = np.hypot(A_amp, B_amp)
phi_rad = np.arctan2(B_amp, A_amp)
t_arr = df["Time_ms"].values / 1000.0
omega = 100.0 * np.pi  # 3000 RPM = 50 Hz
x_formula = R_peak * np.cos(omega * t_arr - phi_rad)
max_diff = np.max(np.abs(x_formula - df["Bearing_Disp_x_mm"].values))
print(f"\n[Phasor Fit] Amplitude R = {R_peak:.3f} mm, Phase lag phi = {phi_rad:.4f} rad ({np.degrees(phi_rad):.2f} deg)")
print(f"[Phasor Fit] Max residual vs telemetry = {max_diff:.5e} mm")

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(11.8, 4.3))
t_fine = np.linspace(0, 0.020, 400)
ax1.plot(t_fine * 1e3, R_peak * np.cos(omega * t_fine - phi_rad), color="#0284c7", lw=2.2, label=r"$R\cos(\omega t - \phi)$ Envelope")
ax1.plot(df["Time_ms"], df["Bearing_Disp_x_mm"], "o", color="#dc2626", ms=5, label="Measured Telemetry")
ax1.axhline(R_peak, color="#059669", ls="--", lw=1.4, label=f"Peak $R = {R_peak:.2f}$ mm")
ax1.set_title("3000 RPM Turbine Bearing Vibration Telemetry")
ax1.set_xlabel("Time $t$ [ms]")
ax1.set_ylabel("Radial Vibration $x(t)$ [mm]")
ax1.legend(fontsize=8.3)

ax2.plot(df["Solar_Hour_h"], df["Collector_Irradiance_W_m2"], "s-", color="#d97706", lw=2.1, label="Tilted Collector Flux")
ax2.set_title("Hourly Solar Collector Flux vs. Solar Time")
ax2.set_xlabel("Solar Time [hr]")
ax2.set_ylabel("Irradiance [W/m$^2$]")
ax2.legend(fontsize=8.8)

plt.tight_layout()
plt.show()
# Verified Output:
Week 02 Vibration & Solar Telemetry (first 6 rows):
 Time_ms  Bearing_Disp_x_mm  Solar_Hour_h  Collector_Irradiance_W_m2
    0.00             1.8000          6.00                        0.0
    1.25             2.5814          6.75                      149.6
    2.50             2.9698          7.50                      324.7
    3.75             2.9061          8.25                      498.5
    5.00             2.4000          9.00                      657.9
    6.25             1.5285          9.75                      792.6

[Phasor Fit] Amplitude R = 3.000 mm, Phase lag phi = 0.9273 rad (53.13 deg)
[Phasor Fit] Max residual vs telemetry = 4.84810e-05 mm
Week 02 Engineering Plot

4. Three Unabridged Worked Engineering Problems

Worked Example 1 β€” Open Belt-Drive Pulley Wrap Angles & Belt Length

Problem: A flat belt connects a small electric-motor drive pulley of radius \(r_1 = 40\text{ mm}\) to a large compressor flywheel pulley of radius \(r_2 = 120\text{ mm}\) separated by center distance \(C = 160\text{ mm}\). Compute:

  1. The belt inclination angle \(\beta = \arcsin\!\left(\frac{r_2 - r_1}{C}\right)\) in exact radians and degrees.
  2. The exact wrap angles \(\theta_1 = \pi - 2\beta\) and \(\theta_2 = \pi + 2\beta\) (radians) and total closed belt length: \[L = 2C\cos\beta + r_1\theta_1 + r_2\theta_2\]

Unabridged Hand Solution:

  1. Compute \(\beta\): Notice a right triangle formed between pulley centers of hypotenuse \(C = 160\text{ mm}\) and opposite side \(r_2 - r_1 = 120 - 40 = 80\text{ mm}\): \[\sin\beta = \frac{80}{160} = \frac{1}{2} \implies \beta = \frac{\pi}{6}\text{ rad} \approx 0.5236\text{ rad } (= 30^\circ)\]

  2. Compute Wrap Angles in Radians (we MUST use radians so \(s = r\theta\) holds without extra factors!):

    • Small pulley: \(\theta_1 = \pi - 2\left(\frac{\pi}{6}\right) = \frac{2\pi}{3}\text{ rad } (120^\circ)\)
    • Large pulley: \(\theta_2 = \pi + 2\left(\frac{\pi}{6}\right) = \frac{4\pi}{3}\text{ rad } (240^\circ)\) Notice \(\theta_1 + \theta_2 = 2\pi\) (together they always form one complete circle!).
  3. Total Belt Length: Since \(\cos(\pi/6) = \frac{\sqrt{3}}{2}\): \[L = 2(160)\frac{\sqrt{3}}{2} + 40\left(\frac{2\pi}{3}\right) + 120\left(\frac{4\pi}{3}\right) = 160\sqrt{3} + \frac{560\pi}{3} \approx 277.13 + 586.43 = \mathbf{863.56\text{ mm}}\]


Worked Example 2 β€” Involute Gear Tooth Geometry (\(\operatorname{inv}\phi = \tan\phi - \phi\))

Problem: Standard involute gear teeth obey \(\operatorname{inv}(\phi) = \tan\phi - \phi\), where every \(\phi\) must be in radians (adding \(\tan 20^\circ - 20\) in degrees is physical nonsense!). Given base radius \(r_b = 50\text{ mm}\), pitch pressure angle \(\phi_p = 20^\circ\), and circular tooth thickness \(t_p = 8.0\text{ mm}\) at pitch radius \(r_p = r_b / \cos\phi_p\), find the tip pressure angle \(\phi_{\text{tip}}\) where tooth thickness shrinks to zero (pointed tooth limit): \[\operatorname{inv}(\phi_{\text{tip}}) = \frac{t_p}{2 r_p} + \operatorname{inv}(\phi_p)\]

Unabridged Hand Strategy:

  1. Convert \(\phi_p = 20^\circ = \frac{20\pi}{180} = 0.349066\text{ rad}\).
  2. Compute \(r_p = \frac{50}{\cos(0.349066)} = 53.2089\text{ mm}\) and \(\operatorname{inv}(\phi_p) = \tan(0.349066) - 0.349066 = 0.014904\text{ rad}\).
  3. Target involute value: \(\operatorname{inv}(\phi_{\text{tip}}) = \frac{8.0}{2(53.2089)} + 0.014904 = 0.090080\text{ rad}\).
  4. Notice why \(\operatorname{inv}(\phi)\) is small when \(\phi\) is small: since \(\tan\phi \approx \phi + \frac{\phi^3}{3}\), we immediately estimate \(\frac{\phi^3}{3} \approx 0.09008 \implies \phi \approx (0.2702)^{1/3} \approx 0.646\text{ rad}\) (\(37^\circ\)), then polish to high precision numerically below!

Worked Example 3 β€” Phasor Reduction of Unbalanced 3000-RPM Turbine Bearing Vibration

Problem: Collapse \(x(t) = 1.8\cos(100\pi t) + 2.4\sin(100\pi t)\ [\text{mm}]\) into single-wave form \(R\cos(100\pi t - \phi)\), and find the exact first time \(t_{\text{peak}} > 0\) when vibration hits its positive maximum.

Unabridged Hand Solution:

  1. Match \(A = 1.8\), \(B = 2.4\) (notice the classic \(3\text{-}4\text{-}5\) right triangle scaled by \(0.6\)!).
  2. Amplitude: \(R = \sqrt{1.8^2 + 2.4^2} = 0.6\sqrt{3^2 + 4^2} = 0.6(5) = \mathbf{3.00\text{ mm}}\).
  3. Phase angle (Quadrant I since \(A>0, B>0\)): \(\phi = \arctan\!\left(\frac{2.4}{1.8}\right) = \arctan(4/3) = \mathbf{0.9273\text{ rad}}\) (\(53.13^\circ\)).
  4. Cosine peaks when its argument equals \(0\) (first time after \(t=0\)): \[100\pi t_{\text{peak}} - 0.927295 = 0 \implies t_{\text{peak}} = \frac{0.927295}{100\pi} = \mathbf{0.002952\text{ s } (2.952\text{ ms})}\]
# Exact Symbolic & Numerical Check for Worked Examples 1, 2, 3
# Example 1: Belt Drive
beta_exact = np.arcsin((120.0 - 40.0) / 160.0)
L_belt = 2*160*np.cos(beta_exact) + 40*(np.pi - 2*beta_exact) + 120*(np.pi + 2*beta_exact)
print(f"[Example 1] beta = {beta_exact:.5f} rad ({np.degrees(beta_exact):.1f} deg), Belt Length L = {L_belt:.2f} mm")

# Example 2: Involute Gear Tooth Tip Angle
phi_p = np.radians(20.0)
r_p = 50.0 / np.cos(phi_p)
inv_target = (8.0 / (2.0 * r_p)) + (np.tan(phi_p) - phi_p)
phi_tip = brentq(lambda p: (np.tan(p) - p) - inv_target, 0.1, 1.3)
print(f"[Example 2] Tip pressure angle phi_tip = {phi_tip:.4f} rad ({np.degrees(phi_tip):.2f} deg)")

# Example 3: 3-4-5 Scaled Phasor Vibration Peak
R_vib = np.hypot(1.8, 2.4)
phi_vib = np.arctan2(2.4, 1.8)
t_pk_ms = (phi_vib / (100.0 * np.pi)) * 1000.0
print(f"[Example 3] R = {R_vib:.3f} mm, phi = {phi_vib:.4f} rad, first peak at t = {t_pk_ms:.3f} ms")
# Verified Output:
[Example 1] beta = 0.52360 rad (30.0 deg), Belt Length L = 863.56 mm
[Example 2] Tip pressure angle phi_tip = 0.6124 rad (35.09 deg)
[Example 3] R = 3.000 mm, phi = 0.9273 rad, first peak at t = 2.952 ms

5. Engineering Practice Problems (Self-Study Exercises)

Practice Problem 1 β€” Optical Small-Angle Error Check

A laser leveling rig tilts by \(\theta = 6.0^\circ\). Convert \(\theta\) to radians, evaluate \(\sin\theta\) and the small-angle linear approximation \(\theta\), and compute the exact percent relative error. How large can \(\theta\) (in degrees) grow before the small-angle error exceeds \(1.0\%\)?

πŸ” Click to View Complete Step-by-Step Solution
  1. Convert to radians: \(\theta = 6.0^\circ \times \frac{\pi}{180^\circ} = 0.104720\text{ rad}\).
  2. Evaluate exact sine: \(\sin(0.104720) = 0.104528\).
  3. Relative Error: \(\frac{0.104720 - 0.104528}{0.104528} \times 100\% = \mathbf{0.183\%}\) (remarkably accurate!).
  4. 1% Threshold: Since \(\sin\theta \approx \theta - \frac{\theta^3}{6}\), fractional error is \(\approx \frac{\theta^2}{6}\). Setting \(\frac{\theta^2}{6} = 0.01 \implies \theta \approx \sqrt{0.06} = 0.2449\text{ rad} \approx \mathbf{14.0^\circ}\)!

Practice Problem 2 β€” Crank-Mechanism Quadrant Reconstruction (atan2 vs atan)

A robotic arm end-effector sits at \((x, y) = (-120\text{ mm}, -160\text{ mm})\). Why does a naive calculator computation \(\arctan(y/x)\) give the wrong pointing angle, and what is the true angle \(\theta \in (-\pi, \pi]\) in radians and degrees?

πŸ” Click to View Complete Step-by-Step Solution
  1. Notice \(y/x = (-160)/(-120) = +4/3\), which is identical to Quadrant I point \((+120, +160)\)! Naive \(\arctan(4/3) = +53.13^\circ\) points in the exact opposite direction!
  2. Because both \(x < 0\) and \(y < 0\), the vector lies in Quadrant III, so subtract \(\pi\) (\(180^\circ\)): \[\theta = \arctan\!\left(\frac{160}{120}\right) - \pi = 0.9273 - 3.1416 = \mathbf{-2.2143\text{ rad } (-126.87^\circ)}\]

Practice Problem 3 β€” AC Power Phasor Cancellation

Two \(60\text{ Hz}\) (\(\omega = 120\pi\text{ rad/s}\)) AC voltage sources \(v_1(t) = 12\cos(\omega t)\) and \(v_2(t) = -5\sin(\omega t)\) (in Volts) are wired in series. Express total voltage \(v_{\text{tot}}(t) = v_1(t) + v_2(t)\) in amplitude-phase form \(R\cos(\omega t - \phi)\).

πŸ” Click to View Complete Step-by-Step Solution
  1. Here \(A = 12\text{ V}\) and \(B = -5\text{ V}\) (notice the \(5\text{-}12\text{-}13\) right triangle!).
  2. Amplitude: \(R = \sqrt{12^2 + (-5)^2} = \sqrt{169} = \mathbf{13.0\text{ V}}\).
  3. Phase angle (Quadrant IV since \(A>0, B<0\)): \(\phi = \arctan(-5/12) = \mathbf{-0.3948\text{ rad } (-22.62^\circ)}\).
  4. Thus \(v_{\text{tot}}(t) = \mathbf{13\cos(120\pi t + 0.3948)\ [\text{V}]}\) (leading by \(22.62^\circ\)).

Practice Problem 4 β€” Flywheel Angular Speed & Rim Acceleration

A carbon-fiber energy-storage flywheel of outer radius \(r = 0.35\text{ m}\) spins at \(12{,}000\text{ RPM}\). Compute its angular velocity \(\omega\) in \(\text{rad/s}\), rim linear speed \(v\) in \(\text{m/s}\), and centripetal rim acceleration \(a_c\) in \(g\)’s (\(1g = 9.81\text{ m/s}^2\)).

πŸ” Click to View Complete Step-by-Step Solution
  1. Convert RPM to rad/s: \(\omega = \frac{2\pi \times 12{,}000}{60} = 400\pi \approx \mathbf{1256.64\text{ rad/s}}\).
  2. Rim linear speed: \(v = r\omega = 0.35 \times 1256.64 = \mathbf{439.82\text{ m/s}}\) (supersonic in airβ€”hence why high-speed flywheels run in vacuum!).
  3. Centripetal acceleration: \(a_c = r\omega^2 = 0.35 \times (1256.64)^2 = 552{,}698\text{ m/s}^2 = \mathbf{56{,}340\,g}\)!

References

🎬 Visual Intuition Animation β€” Unit Circle To Sine Cosine Phase